Execute command if an entity has an item
hello everyone, how can I write an execute program that only activates when an entity (say a donkey) does not have a specific item in their inventory? E.g., to give a diamond to a donkey when the player takes the item out? Is it possible? thank you in advance
edit: java 1.20.1 forge
edit: java 1.20.1 forge
Commentaires
* Downvote this comment if this post is poor quality or does not fit the purpose of r/Minecraft
* Downvote this comment *and report the post* if it breaks the [rules](https://www.reddit.com/r/Minecraft/wiki/rules)
----
(*Vote has already ended*)
execute if entity @e[type=donkey,nbt=!{Inventory:[{id:"minecraft:diamond"}]}]