Getting Attack Damage Value From Held Item

Started by Alec Cature on

Topic category: Help with Minecraft modding (Java Edition)

Active 1 week ago
Joined Mar 2020
Points:
692

User statistics:

  • Modifications: 0
  • Forum topics: 10
  • Wiki pages: 0
  • MCreator plugins: 0
  • Comments: 20
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!

Active 1 week ago
Joined Mar 2020
Points:
692

User statistics:

  • Modifications: 0
  • Forum topics: 10
  • Wiki pages: 0
  • MCreator plugins: 0
  • Comments: 20
Would this be possible using…
Tue, 01/28/2025 - 21:51

Would this be possible using the block "Get custom data number tag [tagName] of [Provided itemstack]" block? It looks promising as a method but I'm unsure of how to get the attribute values of an item using this block if so.