how do i get a swords attack damage?

Started by Pickle on

Topic category: Help with modding (Java Edition)

Last seen on 16:01, 6. Sep 2021
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()))));