/inventory block <pos>
is a block's inventory/inventory entity <targets>
is an entity's inventory- For players, the "domain" here is the same as
/clear
-- the entire inventory including armor and off-hand. For other entities, it includesArmorItems
andHandItems
. Horses include saddle and armor slots, as well as inventory if applicable.
- For players, the "domain" here is the same as
-
add <item> [<count>] [<slot>]
is similar to the current/give
-- it adds an item to the inventory.- If
slot
is unspecified, it stacks or adds similarly to picking up an item. Ifslot
is specified and the slot is empty or can stack with the item, it will do so, otherwise it will fail. - Unlike the current
/give
, items are typically placed directly in the inventory instead of appearing as a dropped item. - If there are no available slots for a block, the command fails.
- If there are no available slots for an entity, the item appears as a dropped item similar to the current
/give
.
- If
-
set <item> <count> <slot>
is a replacement for the current/replaceitem
. It's the only action which requires aslot
. -
clear [<item>] [<count>] [<slot>]
is similar to the current/clear
-- it removes items from the inventory.- If
count
is-1
, it clears all relevant items from the inventory or slot. Otherwise, it functions as it would in/clear
-- clearing only up to that many. - If
slot
is unspecified, it searches the entire inventory. Otherwise, it only tests that slot against theitem
.
- If
-
query [<item>] [<slot>]
returns the number of items found in the inventory or slot, to be used in conjunction with/execute store
.- If
item
is unspecified, it returns the total number of items. Otherwise, it returns the number of items that matchitem
. - If
slot
is unspecified, it searches the entire inventory. Otherwise, it only counts the matching items in that slot.
- If
/replaceitem
and/clear
would be phased out by this command./give <targets>
would become an alias of/inventory entity <targets> add
.