0

I havent done stuff with command blocks for a while, so I'm a bit rusty. I'm trying to make something with a wand in it and I'm using a custom model for the wand. I want to test if my selected item is a carrot on a stick with a specific CustomModelData.

This is what I've tried so far:

execute if entity @p[nbt={SelectedItem:{id:"minecraft:carrot_on_a_stick",CustomModelData:10000001}}]

This doesn't give me any output and says test failed, even though I am holding an item that meets all the requirements. Does it matter that the item I am using also has other tags (custom name, enchanted)? Thanks in advance.

1 Answer 1

1

CustomModelData is in tag.

execute if entity @p[nbt={SelectedItem:{id:"minecraft:carrot_on_a_stick",tag:{CustomModelData:10000001}}}]

One of my favourite commands can help in such a situation:

/data get entity @s SelectedItem

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.