How to check a player’s inventory on minecraft
Jessica Burns
Published Mar 26, 2026

In Minecraft Vanilla 1.12.2 you can’t look up other player’s inventories, you can only test if a certain item is in it. But in 1.13 (and already in the snapshots) you can use /data get entity
There are other answers below:
Hey everyone in this video i show you how to check players inventories in Minecraft! This is a really cool command which can execute other commands if it che…
Don’t forget to like and subscribe for more new content and don’t forget to follow me on all socials for announcements and to help this rapidly growing commu…
Just go into the world the player was on, go into the folder called players, you’ll see a file for each player on the server. Find YOUR filename, and rename it to something else, like add “.bak” to the end so it’s different.
If you want to find if a player has an item, you can use the /execute command and test for player NBT: /execute if entity @p [nbt = {Inventory: [ {id: “minecraft:iron_sword”}]}] run say Hi. (Says hi only if the player has the selected item somewhere in their inventory) To give a player an item, you can use the /give command.
I guess the issue is, that a player inventory can not contain Material.AIR. Try the following: public boolean invFull (Player p) { return p.getInventory ().firstEmpty () == -1; } I’m currently not 100% sure if this firstEmpty () will fail if an armor slot is empty, but i …
I know on Java Edition servers, every player gets an nbt file that holds their inventory, which you can check with an NBT editor like NBTExplorer. I’m not sure if you can access those files from a Realm, though. 1.
You’ve just checked if the inventory contains any item, not if it’s full (not to mention that you’re sending a separate message to the player for every single item stack in their inventory). player.getInventory().firstEmpty() is the correct way to do this.
After seeing that a player opening his inventory is client-side, the server doesn’t even get alerted when a player opens his inventory. You can use the Open Inventory Achievement (yeah, the first one) to check when they open their inventory.
The easiest method would be to simply check their inventory, though this will only be able to check for an exact amount and not minimum: /testfor @a {Inventory:[{id:minecraft:arrow,Count:2b}]} or /scoreboard players set @a OBJECTIVE 1 {Inventory:[{id:minecraft:arrow,Count:2b}]}
- To look a player inventory: To look a chest inventory: To set a player inventory in a chest and clean his inventory (command block): Provided you are using a multiplayer server, the common (and useful) Essentials plugin comes with an in-build command to view a player’s inventory. You can use the /invsee <name> command to achieve this.
- Similar search: how to look at a player inventory
Related Questions
How to tell if a player has an item in inventory?
If you want to find if a player has an item, you can use the /execute command and test for player NBT: /execute if entity @p [nbt = {Inventory: [ {id: “minecraft:iron_sword”}]}] run say Hi (Says hi only if the player has the selected item somewhere in their inventory) To give a player an item, you can use the /give command.
How to see other players’inventories in Minecraft?
In Minecraft Vanilla 1.12.2 you can’t look up other player’s inventories, you can only test if a certain item is in it. But in 1.13 (and already in the snapshots) you can use /data get entity
How do you get inventory from a chest in Minecraft?
To look a player inventory: /data get entity @p Inventory. To look a chest inventory: /data get block 0 0 0 Items. To set a player inventory in a chest and clean his inventory (command block): execute at @p run data modify block 762 70 1565 Items set from entity @p Inventory clear @p. Share.
How to set player inventory in chest and clean his inventory?
To set a player inventory in a chest and clean his inventory (command block): execute at @p run data modify block 762 70 1565 Items set from entity @p Inventory clear @p