How can I test for a totally empty inventory
//ads -- adsterra.com -- native banner
?>
I am making a custom Minecraft map in which I need to /testfor
if a player has a totally empty inventory. I tried Googling but I didn't get any results. So if anyone can help me by providing suitable /testfor
command it would be very very helpful.
Best Answer
1.13+ update
/testfor
was superseded by /execute if entity
. Therefore, the new command is as follows:
/execute if entity @p[nbt={Inventory:[]}] run ...
If you want to include ender chest inventory, you can use:
/execute if entity @p[nbt={Inventory:[],EnderItems:[]}] run ...
Pictures about "How can I test for a totally empty inventory"
How do you test inventory items?
You can clear items from a player's inventory using the /clear command in Minecraft.Monthly production Report Limited company For Microsoft excel Advance Formula
Sources: Stack Exchange - This article follows the attribution requirements of Stack Exchange and is licensed under CC BY-SA 3.0.
Images: Pixabay, Rodolfo Clix, RF._.studio, Karolina Grabowska