Remove player from tab on death
This commit is contained in:
@@ -186,6 +186,15 @@ public class NPC extends EntityPlayer {
|
|||||||
velocity.setZ(velocity.getZ() * 0.5);
|
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() {
|
public void despawn() {
|
||||||
getBukkitEntity().remove();
|
getBukkitEntity().remove();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user