◆ addItem()
Stores the given Items in the inventory. This will try to fill existing stacks and empty slots as well as it can.
Returns the Items that did not fit.
- Parameters
-
- Returns
- Item[]
◆ all()
Will return all the Items that has the same id and metadata (if not null). Won't check amount
- Parameters
-
- Returns
- Item[]
Implemented in BaseInventory.
◆ canAddItem()
Checks if a given Item can be added to the inventory
- Parameters
-
- Returns
- bool
Implemented in BaseInventory.
◆ clear()
Will clear a specific slot
- Parameters
-
- Returns
- bool
◆ clearAll()
◆ close()
◆ contains()
Checks if the inventory contains any Item with the same material data. It will check id, amount, and metadata (if not null)
- Parameters
-
- Returns
- bool
Implemented in BaseInventory.
◆ first()
Will return the first slot has the same id and metadata (if not null) as the Item. -1 if not found, will check amount
- Parameters
-
- Returns
- int
Implemented in BaseInventory.
◆ firstEmpty()
Returns the first empty slot, or -1 if not found
- Returns
- int
Implemented in BaseInventory.
◆ getContents()
◆ getHolder()
- Returns
- InventoryHolder
Implemented in PlayerInventory, BaseInventory, EnderChestInventory, DoubleChestInventory, EnchantInventory, AnvilInventory, BeaconInventory, FurnaceInventory, ChestInventory, BrewingInventory, DispenserInventory, DropperInventory, and HopperInventory.
◆ getItem()
◆ getMaxStackSize()
◆ getName()
◆ getSize()
◆ getTitle()
◆ getType()
◆ getViewers()
Gets all the Players viewing the inventory Players will view their inventory at all times, even when not open.
- Returns
- Player[]
Implemented in BaseInventory.
◆ onClose()
◆ onOpen()
◆ onSlotChange()
onSlotChange |
( |
|
$index, |
|
|
|
$before, |
|
|
|
$send |
|
) |
| |
◆ open()
Tries to open the inventory to a player
- Parameters
-
- Returns
- bool
Implemented in BaseInventory.
◆ remove()
Will remove all the Items that has the same id and metadata (if not null)
- Parameters
-
◆ removeItem()
Removes the given Item from the inventory. It will return the Items that couldn't be removed.
- Parameters
-
- Returns
- Item[]
◆ sendContents()
◆ sendSlot()
sendSlot |
( |
|
$index, |
|
|
|
$target |
|
) |
| |
- Parameters
-
int | $index | |
| Player|Player[] | $target |
Implemented in BaseInventory.
◆ setContents()
setContents |
( |
array |
$items | ) |
|
◆ setItem()
setItem |
( |
|
$index, |
|
|
Item |
$item |
|
) |
| |
Puts an Item in a slot. If a plugin refuses the update or $index is invalid, it'll return false If a source Player is specified, it won't send a Inventory update to it
- Parameters
-
- Returns
- bool
◆ setMaxStackSize()
◆ MAX_STACK
The documentation for this interface was generated from the following file:
- src/pocketmine/inventory/Inventory.php