how do i get a swords attack damage?

Started by Pickle on

Topic category: Help with Minecraft modding (Java Edition)

Active 11 months ago
Joined Aug 2020
Points:
646

User statistics:

  • Modifications: 0
  • Forum topics: 6
  • Wiki pages: 0
  • MCreator plugins: 0
  • Comments: 7
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()))));