how to make an object, when holding in your hand, a command is executed or a command that is executed if you hold a certain object in your hand?
4
/execute if entity @p[nbt={SelectedItem:{id:"minecraft:dirt",Count:1b,tag:{optional_tag:1b}}}]Or use a predicate
The selector generator
The predicate generator
Oh, thanks, but how i can tag items?
give @s dirt{custom_tag:1b}
THANKS!
