Name | Inventory |
Syntax | inventory [open/close/copy/move/swap/set/keep/exclude/fill/clear/update/adjust <mechanism>:<value>/flag <name>(:<action>)[:<value>] (expire:<time>)] (destination:<inventory>) (origin:<inventory>/<item>|...) (slot:<slot>) |
Short Description | Edits the inventory of a player, NPC, or chest. |
Full Description | Use this command to edit the state of inventories.
By default, the destination inventory is the current attached player's inventory. If you are copying, swapping, removing from (including via "keep" and "exclude"), adding to, moving, or filling inventories, you'll need both destination and origin inventories. Origin inventories may be specified as a list of ItemTags, but destinations must be actual InventoryTags. Using "open", "clear", or "update" only require a destination. "Update" also requires the destination to be a valid player inventory. Using "close" closes any inventory that the currently attached player has opened. The "adjust" option adjusts mechanisms on an item within a specific slot of an inventory (the "slot" parameter is required). Note that this is only for items, it does NOT adjust the inventory itself. Use adjust to adjust an inventory mechanism. The "flag" option sets a flag on items, similar to flag. See also flag system. The "update" option will refresh the client's view of an inventory to match the server's view, which is useful to workaround some sync bugs. Note that to add items to an inventory, you should usually use give, and to remove items from an inventory, you should usually use take. The slot argument can be any valid slot, see Slot Inputs. |
Related Tags | <PlayerTag.inventory> Returns a InventoryTag of the player's current inventory. (...)
<PlayerTag.enderchest> Gets the player's enderchest inventory. (...)
<PlayerTag.open_inventory> Gets the inventory the player currently has open. If the player has no open (...)
<NPCTag.inventory> Returns the InventoryTag of the NPC.
<LocationTag.inventory> Returns the InventoryTag of the block at the location. If the (...)
|
Usage Example |
|
Usage Example |
|
Usage Example |
|
Usage Example |
|
Usage Example |
|
Usage Example |
|
Usage Example |
|
Usage Example |
|
Usage Example |
|
Usage Example |
|
Group | item |
Source | https://github.com/DenizenScript/Denizen/blob/dev/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/item/InventoryCommand.java#L86 |