From 487ea6ea4e13eb5d05c00a88ec1d586078a797bf Mon Sep 17 00:00:00 2001 From: "Luis C.M" Date: Sun, 3 Jul 2022 08:50:10 -0500 Subject: [PATCH] Custom item swinging fix for multiplayer --- src/main/java/noppes/npcs/items/ItemScripted.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main/java/noppes/npcs/items/ItemScripted.java b/src/main/java/noppes/npcs/items/ItemScripted.java index 4608c66be..1414eff3a 100644 --- a/src/main/java/noppes/npcs/items/ItemScripted.java +++ b/src/main/java/noppes/npcs/items/ItemScripted.java @@ -71,8 +71,9 @@ public class ItemScripted extends Item implements ItemRenderInterface { @Override public boolean onEntitySwing(EntityLivingBase entityLivingBase, ItemStack stack){ - if(entityLivingBase instanceof EntityClientPlayerMP) + if (entityLivingBase.worldObj.isRemote) { return false; + } IItemStack istack = NpcAPI.Instance().getIItemStack(stack); ItemEvent.AttackEvent eve = new ItemEvent.AttackEvent( (ScriptCustomItem) istack, NpcAPI.Instance().getIEntity(entityLivingBase), 2, null);