Minecraft – ny way to test if a Players inventory is not full in Minecraft

minecraft-commandsminecraft-java-edition

Is there any way to test if a player's inventory is not full (eg. atleast 1 empty slot anywhere in the inventory, not counting Armor Slots) with command blocks and whatnot?

Best Answer

I found /testfor @p {Inventory:[{Slot:0b}]}, which outputs a 1 block signal if there's an item there, and no signal if that slot is empty. This would require 36 command blocks, to check every slot (including the hotbar; 27 to just check the inventory, 40 if you wanted to check armor slots)