Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ProtocolLibrary.getProtocolManager().addPacketListener(new PacketAdapter(this, PacketType.Play.Server.NAMED_ENTITY_SPAWN) {
- @Override
- public void onPacketSending(PacketEvent event) {
- PacketContainer packetContainer = ProtocolLibrary.getProtocolManager().createPacket(PacketType.Play.Server.PLAYER_INFO);
- PlayerInfoData data = new PlayerInfoData(WrappedGameProfile.fromHandle(event.getPlayer()), 0, EnumWrappers.NativeGameMode.SURVIVAL, WrappedChatComponent.fromText(event.getPlayer().getName()));
- packetContainer.getPlayerInfoAction().write(0, EnumWrappers.PlayerInfoAction.REMOVE_PLAYER);
- packetContainer.getPlayerInfoDataLists().write(0, Collections.singletonList(data));
- broadcastPacket(packetContainer);
- }
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement