1

I need help please.

PaPeedy 8/8/21 10:50 pm
61
8/9/2021 1:26 am
again it is I and how can I stop a command from running if a test is successful for example to test if a player has cobblestone in their inventory and then if it is successful it will stop a command from running until the test is unsuccessful. Please help.
Posted by
PaPeedy
Level 42 : Master Modder
18

  Have something to say?

JoinSign in

1

SUPERIONtheKnight
08/09/2021 1:26 am
Level 30 : Artisan System
history
I think you might be looking for "/execute unless", which is the opposite of "/execute if". With "/execute if", the command will only run if the test is true. With "/execute unless", the command will only run if the test is false.

execute unless entity @s[nbt={Inventory:[{"id":"minecraft:cobblestone"}]}] run say No cobblestone here! :)
You can read more about it here: https://www.planetminecraft.com/blog/function-data-packs-for-dummies-8-check-a-lot-of-things-but-only-once/
Hope this helps! :)
1

Welcome