how do i get a swords attack damage?

Started by Pickle on

Topic category: Help with Minecraft modding (Java Edition)

Joined Aug 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
how do i get a swords attack damage?

I think I need SwordItem#getDamage I do this at the moment: 

PvpPlusMod.LOGGER
                    .info(("" + (((((sourceentity instanceof LivingEntity) ? ((LivingEntity) sourceentity).getHeldItemOffhand() : ItemStack.EMPTY))
                            .getMaxDamage()))));