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[]
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.
Checks if a given Item can be added to the inventory
- Parameters
-
- Returns
- bool
Implemented in BaseInventory.
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.
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.
Returns the first empty slot, or -1 if not found
- Returns
- int
Implemented in BaseInventory.
- Returns
- InventoryHolder
Implemented in PlayerInventory, BaseInventory, EnderChestInventory, EnchantInventory, DoubleChestInventory, AnvilInventory, FurnaceInventory, ChestInventory, BrewingInventory, DispenserInventory, DropperInventory, and HopperInventory.
Gets all the Players viewing the inventory Players will view their inventory at all times, even when not open.
- Returns
- Player[]
Implemented in BaseInventory.
onSlotChange |
( |
|
$index, |
|
|
|
$before, |
|
|
|
$send |
|
) |
| |
Tries to open the inventory to a player
- Parameters
-
- Returns
- bool
Implemented in BaseInventory.
Will remove all the Items that has the same id and metadata (if not null)
- Parameters
-
Removes the given Item from the inventory. It will return the Items that couldn't be removed.
- Parameters
-
- Returns
- Item[]
sendSlot |
( |
|
$index, |
|
|
|
$target |
|
) |
| |
- Parameters
-
int | $index | |
| Player|Player[] | $target |
Implemented in BaseInventory.
setContents |
( |
array |
$items | ) |
|
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
Implemented in DoubleChestInventory.
The documentation for this interface was generated from the following file:
- src/pocketmine/inventory/Inventory.php