Minecraft Java Edition – How to Call SelectedItem Damage Tag in Minecraft 1.14

minecraft-commandsminecraft-java-edition

I am trying to call the Damage tag of an item in my selected hand, but cannot for the life of me figure out how to do it!

If there needs to be a work around in place for this I would be entirely happy to use it.

Best Answer

An example code:
run initialy: /scoreboard objectives add damage dummy
run repeatedly: /execute as @a store result score @s damage run data get entity @s SelectedItem.tag.Damage
this stores for each player the damage of the item in his hand in the scoreboard damage.