if (from instanceof EntityPlayerMP) {
ItemStack current = ((EntityPlayerMP)from).getCurrentEquippedItem();
if (current != null && current.getItem() instanceof ItemSword) {
А можно сделать проверку на Entity? Ну у меня из оружия вылетает пуля (EntityBullet)@Kraken, ну создать дополнительную проверку, то что в руке игрока "кто убивает" проверять на то, что у него твой предмет.
if (from instanceof EntityBullet) {
EntityBullet bullet = (EntityBullet)from;
if (bullet.getThrower() instanceof EntityPlayerMP) {
KillerPlayer killerPlayer = KillerPlayer.get((EntityPlayerMP)bullet.getThrower());
if (killerPlayer != null) {
if (to instanceof EntityPlayer) killerPlayer.killPlayer();
else if (to instanceof EntityZombie) killerPlayer.killZombie();
}
}
}
KillerPlayer killerPlayer = KillerPlayer.get((EntityPlayerMP)bullet.owner) && KillerPlayer.get((EntityPlayerMP)from);