Custom item swinging fix for multiplayer

This commit is contained in:
Luis C.M committed 2022-07-03 08:50:10 -05:00
1 parent a3407ed9b2
commit 487ea6ea4e
1 file changed
+2 -1
@@ -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);