Skip to content

InventoryManager ​

class · pocketmine\network\mcpe\InventoryManager · source

Constants ​

ENCHANTING_OPTION_NETWORK_OFFSET 5.46.0 ​

php
public const ENCHANTING_OPTION_NETWORK_OFFSET = 100000

SMITHING_RECIPE_NETWORK_OFFSET 5.46.0 ​

php
public const SMITHING_RECIPE_NETWORK_OFFSET = 200000

Methods ​

__construct() ​

php
public function __construct(\pocketmine\player\Player $player, \pocketmine\network\mcpe\NetworkSession $session)

addPredictedSlotChange() ​

php
public function addPredictedSlotChange(\pocketmine\inventory\Inventory $inventory, int $slot, \pocketmine\item\Item $item) : void

addRawPredictedSlotChanges() ​

php
public function addRawPredictedSlotChanges(array $networkInventoryActions) : void

addTransactionPredictedSlotChanges() ​

php
public function addTransactionPredictedSlotChanges(\pocketmine\inventory\transaction\InventoryTransaction $tx) : void

createContainerOpen() protected ​

php
protected static function createContainerOpen(int $id, \pocketmine\inventory\Inventory $inv) : ?array

createHorseEquipPacket() 5.46.0 ​

php
public static function createHorseEquipPacket(int $windowId, \pocketmine\inventory\HorseInventory $inventory) : \pocketmine\network\mcpe\protocol\UpdateEquipPacket

The slots of a horse screen, sent after its ContainerOpen (BDS does so, per gophertunnel's UpdateEquip docs): what each equipment slot accepts and the icon of the empty slot, built like GeyserMC's mount screens. Slot 0 is the saddle (or a llama's carpet), slot 1 the body armor (horse or nautilus armor).

createTradePacket() 5.46.0 ​

php
public static function createTradePacket(int $windowId, \pocketmine\inventory\TradeInventory $inventory) : \pocketmine\network\mcpe\protocol\UpdateTradePacket

Trading screen of a villager or wandering trader (the client opens it on UpdateTradePacket instead of ContainerOpen). Offers are the vanilla "Recipes" list (see \pocketmine\entity\npc\TradeOffer::toNbt()).

flushBundleWritebacks() 5.46.0 ​

php
public function flushBundleWritebacks() : void

Writes the contents of bundle containers changed by the last transaction back to their bundles. Like the client, the contents are compacted (no gaps between stacks); stack IDs move with their items, since the client moves them the same way.

flushPendingUpdates() ​

php
public function flushPendingUpdates() : void

getBundleContainerById() 5.46.0 ​

php
public function getBundleContainerById(int $dynamicId) : ?\pocketmine\network\mcpe\BundleContainer

getBundleContainerByInventory() 5.46.0 ​

php
public function getBundleContainerByInventory(\pocketmine\inventory\Inventory $inventory) : ?\pocketmine\network\mcpe\BundleContainer

Returns the bundle container mirrored by the given inventory, if it is one.

getContainerOpenCallbacks() ​

php
public function getContainerOpenCallbacks() : \pocketmine\utils\ObjectSet

getCurrentWindowId() ​

php
public function getCurrentWindowId() : int

getEnchantingTableOptionIndex() ​

php
public function getEnchantingTableOptionIndex(int $recipeId) : ?int

getItemStackInfo() ​

php
public function getItemStackInfo(\pocketmine\inventory\Inventory $inventory, int $slot) : ?\pocketmine\network\mcpe\ItemStackInfo

getWindowId() ​

php
public function getWindowId(\pocketmine\inventory\Inventory $inventory) : ?int

locateBundleContainerSlot() 5.46.0 ​

php
public function locateBundleContainerSlot(int $dynamicId, int $slot) : ?array

Returns the inventory mirroring a bundle's dynamic container and the slot in it, as referenced by the client with a FullContainerName (DynamicContainer, $dynamicId).

locateWindowAndSlot() ​

php
public function locateWindowAndSlot(int $windowId, int $netSlotId) : ?array

onBundleMoved() 5.46.0 ​

php
public function onBundleMoved(\pocketmine\inventory\Inventory $inventoryA, int $slotA, \pocketmine\inventory\Inventory $inventoryB, int $slotB) : void

Called when an ItemStackRequest moves or swaps bundles between two slots, so that the bundles keep their dynamic containers: the client keeps the bundle_id of a bundle it moves.

onClientOpenMainInventory() ​

php
public function onClientOpenMainInventory() : void

onClientRemoveWindow() ​

php
public function onClientRemoveWindow(int $id) : void

onClientSelectHotbarSlot() ​

php
public function onClientSelectHotbarSlot(int $slot) : void

onCurrentWindowChange() ​

php
public function onCurrentWindowChange(\pocketmine\inventory\Inventory $inventory) : void

onCurrentWindowRemove() ​

php
public function onCurrentWindowRemove() : void

onSlotChange() ​

php
public function onSlotChange(\pocketmine\inventory\Inventory $inventory, int $slot) : void

requestSyncAll() ​

php
public function requestSyncAll() : void

setCurrentItemStackRequestId() ​

php
public function setCurrentItemStackRequestId(?int $id) : void

syncAll() ​

php
public function syncAll() : void

syncContents() ​

php
public function syncContents(\pocketmine\inventory\Inventory $inventory) : void

syncCreative() ​

php
public function syncCreative() : void

syncData() ​

php
public function syncData(\pocketmine\inventory\Inventory $inventory, int $propertyId, int $value) : void

syncEnchantingTableOptions() ​

php
public function syncEnchantingTableOptions(array $options) : void

syncMismatchedPredictedSlotChanges() ​

php
public function syncMismatchedPredictedSlotChanges() : void

syncSelectedHotbarSlot() ​

php
public function syncSelectedHotbarSlot() : void

syncSlot() ​

php
public function syncSlot(\pocketmine\inventory\Inventory $inventory, int $slot, \pocketmine\network\mcpe\protocol\types\inventory\ItemStack $itemStack) : void

syncTrades() 5.46.0 ​

php
public function syncTrades(\pocketmine\inventory\TradeInventory $inventory) : void

Sends the trades again (after a trade changed their uses or the trader's level).

VanillaMine is a fork of PocketMine-MP, maintained by Luxury Nodes. Not affiliated with the PMMP team or Mojang.