Jump to content

ohmaigoshhh

Members
  • Posts

    1
  • Joined

  • Last visited

Everything posted by ohmaigoshhh

  1. Hello Im trying to get this function. Especially the offhand.hitentity to work. Everytime I face a mob the item swings but doesn't hurt the mob and if I face away from the mob the game crashes. @SubscribeEvent public static void dualweild(MouseEvent event) { EntityLivingBase target = (EntityLivingBase) Minecraft.getMinecraft().pointedEntity; EntityPlayer player = Minecraft.getMinecraft().player; ItemStack mainhand = player.getHeldItemMainhand(); ItemStack offhand = player.getHeldItemOffhand(); //right mouse button is 1 if (event.getButton() == 1) { if (offhand.getItem() instanceof ItemKnife) { offhand.hitEntity(target, player); offhand.damageItem(1, player); player.swingArm(EnumHand.OFF_HAND); } else { return; } } }
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.