Remove player from tab on death

This commit is contained in:
BattleDash
2021-06-26 19:40:44 -07:00
parent 2d2fb85a6f
commit 44e0e098f4

View File

@@ -186,6 +186,15 @@ public class NPC extends EntityPlayer {
velocity.setZ(velocity.getZ() * 0.5);
}
@Override
public void die() {
super.die();
for (Player player : Bukkit.getOnlinePlayers()) {
PlayerConnection connection = ((CraftPlayer) player).getHandle().playerConnection;
connection.sendPacket(new PacketPlayOutPlayerInfo(PacketPlayOutPlayerInfo.EnumPlayerInfoAction.REMOVE_PLAYER, this));
}
}
public void despawn() {
getBukkitEntity().remove();
}