Getting Attack Damage Value From Held Item

Started by Alec Cature on

Topic category: Help with Minecraft modding (Java Edition)

Joined Mar 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Getting Attack Damage Value From Held Item

Hello! I'm wanting to make a mod feature that restricts use of weapons with higher attack damage until they reach a certain level in a skill, but I can't seem to find a way to get the value that's listed in the item's tooltip.

I DO NOT want to use the method of grabbing the attack value after hitting a mob as there's many variables at play here like a wooden sword used with a strength potion making it damage similar to an iron sword, and the procedure disabling it due to thinking its a better weapon. I am only looking to grab the raw damage number from the weapon itself.

if possible, I would also like to do the same for attack speed, armor, and armor toughness values. Thank you all in advance!