Skip to content

Inventory Commands

Conorsmine edited this page Oct 14, 2023 · 1 revision

PDM provides many options to deal with the player's inventory.
Moreover, all commands listed can also be used on offline Players!

Inventory Paths

PDM tries to have any and all inventories accessible if need be. To achieve this, PDM implements a system of Inventory paths.
These are paths determined by the NBT structure of the player. Creating paths might be overwhelming at first, that's why PDM provide 3 common Inventory paths:

  • inv - The main inventory of the player
  • ec - The ender chest of the player
  • baubles - The baubles inventory used in many modpacks

To add your own custom Inventory paths, view the config.yml under the section "inventory_paths".

Commands

Open

Usability:
Full command: /pdm open <target> <inventoryPath>
Permission: pdm.inv.open
This command opens an inventory editor in-game. Any changes made to the opened inventory will be applied to the player.
This editor does not update if the player should pick something up while it's opened!

The Barrier block items are an indicator that something is wrong with this item. Either it has malformed NBT data or it's not a valid material.
Hovering over these items will provide some basic information, similar to the list command. To get more information about the item, use the info command.

Clear

Usability:
Full command: /pdm clear <target> <inventoryPath>
Permission: pdm.inv.clear
This command clears the whole inventory of the player specified. This should only be used as a last resort!

Remove

Usability:
Full command: /pdm remove <target> <inventoryPath> <slot>
Permission: pdm.inv.remove
This command removes the item at the specified slot.

List

Usability:
Full command: /pdm list <target> <inventoryPath>
Permission: pdm.inv.list
This command provides a list of all the items and very basic information about them. It is intended to quickly check for any problematic items.

Info

Usability:
Full command: /pdm remove <target> <inventoryPath> <slot>
Permission: pdm.inv.info
This command provides more information about an item and provides the whole NBT of the item.

Store

Usability:
Full command: /pdm store <target> <inventoryPath> <slot>
Permission: pdm.inv.store
This command stores the NBT of the item at the specified slot into an external file. This file can then either be manipulated manually or used as a form of backup.
Best use this command with addStore.

Add

Usability:
Full command: /pdm add <target> <inventoryPath> <itemID> [data] [count]
Permission: pdm.inv.add
This command functions much like the vanilla /give command; However you can add an item to a specific inventory.
data and count are optional arguments; data will default to 0 and count defaults to 1.

Add NBT

Usability:
Full command: /pdm addNBT <target> <inventoryPath> <itemNBT>
Permission: pdm.inv.addnbt
This command provides the option to add an item to the player's inventory and for you to write the NBT of the item yourself.
E.g. of an itemNBT value: {id:"minecraft:stone",Count:5,Damage:0}
The itemNBT has to have at least the following tags:

  • id - item id of the item you want to add
  • Damage - The durability of the item
  • Count - The amount of the item

Add Store

Usability:
Full command: /pdm addStore <target> <inventoryPath> <iremStore>
Permission: pdm.inv.addstore
This command will add a stored item to the player's inventory.

Search

Usability:
Full command: /pdm search <itemID> [data]
Permission: pdm.inv.search
This command will search in all inventories of all players for items matching the itemID.
If a data value is specified, it will also try to match that.
The command then returns a list of players and inventory paths that contain the specified item.

Clone this wiki locally