Skip to content

CreativeInventory ​

final class · pocketmine\inventory\CreativeInventory · source

Methods ​

add() ​

php
public function add(\pocketmine\item\Item $item, \pocketmine\inventory\CreativeCategory $category = \pocketmine\inventory\CreativeCategory::ITEMS, ?\pocketmine\inventory\CreativeGroup $group = null) : void

Adds an item to the creative menu. Note: Players who are already online when this is called will not see this change.

clear() ​

php
public function clear() : void

Removes all previously added items from the creative menu. Note: Players who are already online when this is called will not see this change.

contains() ​

php
public function contains(\pocketmine\item\Item $item) : bool

createVanilla() 5.46.0 ​

php
public static function createVanilla(bool $educationItems) : self

Creates the vanilla creative inventory. Education Edition content (see EducationCreativeFilter) is only included if $educationItems is true, like a vanilla world with the "Education Edition" option.

Use with CreativeInventory::setInstance() before players join.

getAll() ​

php
public function getAll() : array

getAllEntries() ​

php
public function getAllEntries() : array

getContentChangedCallbacks() ​

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

getEntry() ​

php
public function getEntry(int $index) : ?\pocketmine\inventory\CreativeInventoryEntry

getItem() ​

php
public function getItem(int $index) : ?\pocketmine\item\Item

getItemIndex() ​

php
public function getItemIndex(\pocketmine\item\Item $item) : int

remove() ​

php
public function remove(\pocketmine\item\Item $item) : void

Removes an item from the creative menu. Note: Players who are already online when this is called will not see this change.

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