Create a datapack with a predicate like test:1
{
"condition": "minecraft:entity_properties",
"entity": "this",
"predicate": {
"equipment": {
"mainhand":{
"nbt": "{id:\"cpp:broom\"}"
}
}
}
}
Then run
/give @s carrot_on_a_stick{id:"cpp:broom"}
and put it on mainhand, this predicate will pass.
Then drop the item, this predicate will still pass, but now there is no item on mainhand.
If one add
"items": ["minecraft:carrot_on_a_stick"],
in this predicate, the predicate works well.
Moreover, if you have two predicates, one for mainhand, one for offhand. Then you drop the item from your mainhand, you can still press F to switch the predicate you can pass.
Thank you for your report!
We're tracking this issue in MC-229882, so this ticket is being resolved and linked as a duplicate.
That ticket has already been resolved as working as intended, which means this is not considered a bug and won't be fixed. Please do not leave a comment on the linked ticket.
If you haven't already, you might like to make use of the search feature to see if the issue has already been mentioned.
Quick Links:
📓 Bug Tracker Guidelines – 💬 Community Support – 📧 Mojang Support
📓 Project Summary – ✍️ Feedback and Suggestions – 📖 Game Wiki
-- I am a bot. This action was performed automatically! The ticket was resolved by one of our moderators, and I left this message to give more information to you.