|
| __clone () |
|
| __toString () |
|
| addPage (int $pageId) |
|
| canBePlaced () |
|
| canStackWith (Item $other) |
|
| clearCustomBlockData () |
|
| clearCustomName () |
|
| clearNamedTag () |
|
| deletePage (int $pageId) |
|
| equals (Item $item, bool $checkDamage=true, bool $checkCompound=true) |
|
| equalsExact (Item $other) |
|
| getAttackPoints () |
|
| getBlock (?int $clickedFace=null) |
|
| getBlockToolHarvestLevel () |
|
| getBlockToolType () |
|
| getCanDestroy () |
|
| getCanPlaceOn () |
|
| getCooldownTag () |
|
| getCooldownTicks () |
|
| getCount () |
|
| getCustomBlockData () |
|
| getCustomName () |
|
| getDefensePoints () |
|
| getEnchantability () |
|
| getEnchantmentTags () |
|
| getFuelResidue () |
|
| getFuelTime () |
|
| getLore () |
|
| getMaxStackSize () |
|
| getMiningEfficiency (bool $isCorrectTool) |
|
| getName () |
|
| getNamedTag () |
|
| getPages () |
|
| getPageText (int $pageId) |
|
| getStateId () |
|
| getTypeId () |
|
| getVanillaName () |
|
| hasCustomBlockData () |
|
| hasCustomName () |
|
| hasNamedTag () |
|
| insertPage (int $pageId, string $pageText="") |
|
| isFireProof () |
|
| isNull () |
|
| jsonSerialize () |
|
| keepOnDeath () |
|
| nbtSerialize (int $slot=-1) |
|
| onAttackEntity (Entity $victim, array &$returnedItems) |
|
| onClickAir (Player $player, Vector3 $directionVector, array &$returnedItems) |
|
| onDestroyBlock (Block $block, array &$returnedItems) |
|
| onInteractBlock (Player $player, Block $blockReplace, Block $blockClicked, int $face, Vector3 $clickVector, array &$returnedItems) |
|
| onInteractEntity (Player $player, Entity $entity, Vector3 $clickVector) |
|
| onReleaseUsing (Player $player, array &$returnedItems) |
|
| onTickWorn (Living $entity) |
|
| pageExists (int $pageId) |
|
| pop (int $count=1) |
|
| setCanDestroy (array $canDestroy) |
|
| setCanPlaceOn (array $canPlaceOn) |
|
| setCount (int $count) |
|
| setCustomBlockData (CompoundTag $compound) |
|
| setCustomName (string $name) |
|
| setKeepOnDeath (bool $keepOnDeath) |
|
| setLore (array $lines) |
|
| setNamedTag (CompoundTag $tag) |
|
| setPages (array $pages) |
|
| setPageText (int $pageId, string $pageText) |
|
| swapPages (int $pageId1, int $pageId2) |
|
Definition at line 26 of file WritableBook.php.
◆ __clone()
pocketmine\item\Item::__clone |
( |
| ) |
|
|
inherited |
◆ __toString()
pocketmine\item\Item::__toString |
( |
| ) |
|
|
finalinherited |
◆ addPage()
pocketmine\item\WritableBookBase::addPage |
( |
int | $pageId | ) |
|
|
inherited |
Adds a new page with the given page ID. Creates a new page for every page between the given ID and existing pages that doesn't yet exist.
- Returns
- $this
Definition at line 87 of file WritableBookBase.php.
◆ canBePlaced()
pocketmine\item\Item::canBePlaced |
( |
| ) |
|
|
finalinherited |
◆ canStackWith()
pocketmine\item\Item::canStackWith |
( |
Item | $other | ) |
|
|
finalinherited |
Returns whether this item could stack with the given item (ignoring stack size and count).
Definition at line 685 of file Item.php.
◆ clearCustomBlockData()
pocketmine\item\Item::clearCustomBlockData |
( |
| ) |
|
|
inherited |
◆ clearCustomName()
pocketmine\item\Item::clearCustomName |
( |
| ) |
|
|
inherited |
◆ clearNamedTag()
pocketmine\item\Item::clearNamedTag |
( |
| ) |
|
|
inherited |
Removes the Item's NBT.
- Returns
- $this
- Exceptions
-
Definition at line 279 of file Item.php.
◆ deletePage()
pocketmine\item\WritableBookBase::deletePage |
( |
int | $pageId | ) |
|
|
inherited |
◆ describeState()
Describes state properties of the item, such as colour, skull type, etc. This allows associating basic extra data with the item at runtime in a more efficient format than NBT.
Reimplemented in pocketmine\item\Banner, pocketmine\item\CoralFan, pocketmine\item\Dye, pocketmine\item\GoatHorn, pocketmine\item\ItemBlock, pocketmine\item\Medicine, pocketmine\item\Potion, pocketmine\item\SplashPotion, and pocketmine\item\SuspiciousStew.
Definition at line 513 of file Item.php.
◆ deserializeCompoundTag()
pocketmine\item\WritableBookBase::deserializeCompoundTag |
( |
CompoundTag | $tag | ) |
|
|
protectedinherited |
◆ equals()
pocketmine\item\Item::equals |
( |
Item | $item, |
|
|
bool | $checkDamage = true, |
|
|
bool | $checkCompound = true ) |
|
finalinherited |
Compares an Item to this Item and check if they match.
- Parameters
-
- Deprecated
- Parameters
-
bool | $checkCompound | Whether to verify that the items' NBT match. |
Definition at line 677 of file Item.php.
◆ equalsExact()
pocketmine\item\Item::equalsExact |
( |
Item | $other | ) |
|
|
finalinherited |
Returns whether the specified item stack has the same ID, damage, NBT and count as this item stack.
Definition at line 692 of file Item.php.
◆ getAttackPoints()
pocketmine\item\Item::getAttackPoints |
( |
| ) |
|
|
inherited |
◆ getBlock()
pocketmine\item\Item::getBlock |
( |
?int | $clickedFace = null | ) |
|
|
inherited |
Returns the block corresponding to this Item.
Reimplemented in pocketmine\item\Bamboo, pocketmine\item\BeetrootSeeds, pocketmine\item\Carrot, pocketmine\item\CocoaBeans, pocketmine\item\CoralFan, pocketmine\item\GlowBerries, pocketmine\item\ItemBlock, pocketmine\item\ItemBlockWallOrFloor, pocketmine\item\MelonSeeds, pocketmine\item\PitcherPod, pocketmine\item\Potato, pocketmine\item\PumpkinSeeds, pocketmine\item\Redstone, pocketmine\item\StringItem, pocketmine\item\SweetBerries, pocketmine\item\TorchflowerSeeds, and pocketmine\item\WheatSeeds.
Definition at line 491 of file Item.php.
Referenced by pocketmine\block\Cake\onInteract().
◆ getBlockToolHarvestLevel()
pocketmine\item\Item::getBlockToolHarvestLevel |
( |
| ) |
|
|
inherited |
◆ getBlockToolType()
pocketmine\item\Item::getBlockToolType |
( |
| ) |
|
|
inherited |
◆ getCanDestroy()
pocketmine\item\Item::getCanDestroy |
( |
| ) |
|
|
inherited |
- Returns
- string[] @phpstan-return array<string, string>
Definition at line 216 of file Item.php.
◆ getCanPlaceOn()
pocketmine\item\Item::getCanPlaceOn |
( |
| ) |
|
|
inherited |
- Returns
- string[] @phpstan-return array<string, string>
Definition at line 198 of file Item.php.
◆ getCooldownTag()
pocketmine\item\Item::getCooldownTag |
( |
| ) |
|
|
inherited |
◆ getCooldownTicks()
pocketmine\item\Item::getCooldownTicks |
( |
| ) |
|
|
inherited |
◆ getCount()
pocketmine\item\Item::getCount |
( |
| ) |
|
|
inherited |
◆ getCustomBlockData()
pocketmine\item\Item::getCustomBlockData |
( |
| ) |
|
|
inherited |
◆ getCustomName()
pocketmine\item\Item::getCustomName |
( |
| ) |
|
|
inherited |
◆ getDefensePoints()
pocketmine\item\Item::getDefensePoints |
( |
| ) |
|
|
inherited |
◆ getEnchantability()
pocketmine\item\Item::getEnchantability |
( |
| ) |
|
|
inherited |
Returns the value that defines how enchantable the item is.
The higher an item's enchantability is, the more likely it will be to gain high-level enchantments or multiple enchantments upon being enchanted in an enchanting table.
Reimplemented in pocketmine\item\Armor, and pocketmine\item\TieredTool.
Definition at line 480 of file Item.php.
◆ getEnchantmentTags()
pocketmine\item\Item::getEnchantmentTags |
( |
| ) |
|
|
inherited |
Returns tags that represent the type of item being enchanted and are used to determine what enchantments can be applied to this item during in-game enchanting (enchanting table, anvil, fishing, etc.).
- See also
- ItemEnchantmentTags
-
ItemEnchantmentTagRegistry
-
AvailableEnchantmentRegistry
- Returns
- string[]
Definition at line 470 of file Item.php.
◆ getFuelResidue()
pocketmine\item\Item::getFuelResidue |
( |
| ) |
|
|
inherited |
◆ getFuelTime()
pocketmine\item\Item::getFuelTime |
( |
| ) |
|
|
inherited |
Returns the time in ticks which the item will fuel a furnace for.
Reimplemented in pocketmine\item\Bamboo, pocketmine\item\Banner, pocketmine\item\BlazeRod, pocketmine\item\Boat, pocketmine\item\Bow, pocketmine\item\Bowl, pocketmine\item\Coal, pocketmine\item\CoralFan, pocketmine\item\ItemBlock, pocketmine\item\ItemBlockWallOrFloor, pocketmine\item\LiquidBucket, pocketmine\item\Stick, and pocketmine\item\TieredTool.
Definition at line 527 of file Item.php.
◆ getLore()
pocketmine\item\Item::getLore |
( |
| ) |
|
|
inherited |
- Returns
- string[]
Definition at line 174 of file Item.php.
◆ getMaxStackSize()
pocketmine\item\WritableBookBase::getMaxStackSize |
( |
| ) |
|
|
inherited |
◆ getMiningEfficiency()
pocketmine\item\Item::getMiningEfficiency |
( |
bool | $isCorrectTool | ) |
|
|
inherited |
◆ getName()
pocketmine\item\Item::getName |
( |
| ) |
|
|
finalinherited |
Returns the name of the item, or the custom name if it is set.
Definition at line 450 of file Item.php.
◆ getNamedTag()
pocketmine\item\Item::getNamedTag |
( |
| ) |
|
|
inherited |
Returns a tree of Tag objects representing the Item's NBT. If the item does not have any NBT, an empty CompoundTag object is returned to allow the caller to manipulate and apply back to the item.
Definition at line 252 of file Item.php.
◆ getPages()
pocketmine\item\WritableBookBase::getPages |
( |
| ) |
|
|
inherited |
Returns an array containing all pages of this book.
- Returns
- WritableBookPage[]
Definition at line 149 of file WritableBookBase.php.
◆ getPageText()
pocketmine\item\WritableBookBase::getPageText |
( |
int | $pageId | ) |
|
|
inherited |
Returns a string containing the content of a page (which could be empty), or null if the page doesn't exist.
- Exceptions
-
OutOfRangeException if requesting a nonexisting page
Definition at line 63 of file WritableBookBase.php.
◆ getStateId()
pocketmine\item\Item::getStateId |
( |
| ) |
|
|
finalinherited |
◆ getTypeId()
pocketmine\item\Item::getTypeId |
( |
| ) |
|
|
finalinherited |
◆ getVanillaName()
pocketmine\item\Item::getVanillaName |
( |
| ) |
|
|
inherited |
Returns the vanilla name of the item, disregarding custom names.
Definition at line 457 of file Item.php.
◆ hasCustomBlockData()
pocketmine\item\Item::hasCustomBlockData |
( |
| ) |
|
|
inherited |
◆ hasCustomName()
pocketmine\item\Item::hasCustomName |
( |
| ) |
|
|
inherited |
◆ hasNamedTag()
pocketmine\item\Item::hasNamedTag |
( |
| ) |
|
|
inherited |
Returns whether this Item has a non-empty NBT.
Definition at line 244 of file Item.php.
◆ insertPage()
pocketmine\item\WritableBookBase::insertPage |
( |
int | $pageId, |
|
|
string | $pageText = "" ) |
|
inherited |
Inserts a new page with the given text and moves other pages upwards.
- Returns
- $this
Definition at line 114 of file WritableBookBase.php.
◆ isFireProof()
pocketmine\item\Item::isFireProof |
( |
| ) |
|
|
inherited |
◆ isNull()
pocketmine\item\Item::isNull |
( |
| ) |
|
|
inherited |
◆ jsonSerialize()
pocketmine\item\Item::jsonSerialize |
( |
| ) |
|
|
inherited |
@phpstan-return never
Definition at line 703 of file Item.php.
◆ keepOnDeath()
pocketmine\item\Item::keepOnDeath |
( |
| ) |
|
|
inherited |
Returns whether players will retain this item on death. If a non-player dies it will be excluded from the drops.
Definition at line 233 of file Item.php.
◆ legacyJsonDeserialize()
static pocketmine\item\Item::legacyJsonDeserialize |
( |
array | $data | ) |
|
|
staticfinalinherited |
Deserializes item JSON data produced by json_encode()ing Item instances in older versions of PocketMine-MP. This method exists solely to allow upgrading old JSON data stored by plugins.
- Parameters
-
- Exceptions
-
SavedDataLoadingException | |
Definition at line 715 of file Item.php.
◆ nbtDeserialize()
static pocketmine\item\Item::nbtDeserialize |
( |
CompoundTag | $tag | ) |
|
|
staticinherited |
Deserializes an Item from an NBT CompoundTag
- Exceptions
-
SavedDataLoadingException | |
Definition at line 754 of file Item.php.
◆ nbtSerialize()
pocketmine\item\Item::nbtSerialize |
( |
int | $slot = -1 | ) |
|
|
inherited |
Serializes the item to an NBT CompoundTag
- Parameters
-
int | $slot | optional, the inventory slot of the item |
Definition at line 746 of file Item.php.
◆ onAttackEntity()
pocketmine\item\Item::onAttackEntity |
( |
Entity | $victim, |
|
|
array & | $returnedItems ) |
|
inherited |
◆ onClickAir()
pocketmine\item\Item::onClickAir |
( |
Player | $player, |
|
|
Vector3 | $directionVector, |
|
|
array & | $returnedItems ) |
|
inherited |
◆ onDestroyBlock()
pocketmine\item\Item::onDestroyBlock |
( |
Block | $block, |
|
|
array & | $returnedItems ) |
|
inherited |
◆ onInteractBlock()
pocketmine\item\Item::onInteractBlock |
( |
Player | $player, |
|
|
Block | $blockReplace, |
|
|
Block | $blockClicked, |
|
|
int | $face, |
|
|
Vector3 | $clickVector, |
|
|
array & | $returnedItems ) |
|
inherited |
◆ onInteractEntity()
pocketmine\item\Item::onInteractEntity |
( |
Player | $player, |
|
|
Entity | $entity, |
|
|
Vector3 | $clickVector ) |
|
inherited |
Called when a player uses the item to interact with entity, for example by using a name tag.
- Parameters
-
Vector3 | $clickVector | The exact position of the click (absolute coordinates) |
- Returns
- bool whether some action took place
Reimplemented in pocketmine\item\NameTag.
Definition at line 646 of file Item.php.
◆ onReleaseUsing()
pocketmine\item\Item::onReleaseUsing |
( |
Player | $player, |
|
|
array & | $returnedItems ) |
|
inherited |
Called when a player is using this item and releases it. Used to handle bow shoot actions. Returns whether the item was changed, for example count decrease or durability change.
- Parameters
-
Item[] | &$returnedItems | Items to be added to the target's inventory (or dropped, if the inventory is full) |
Reimplemented in pocketmine\item\Bow.
Definition at line 610 of file Item.php.
◆ onTickWorn()
pocketmine\item\Item::onTickWorn |
( |
Living | $entity | ) |
|
|
inherited |
◆ pageExists()
pocketmine\item\WritableBookBase::pageExists |
( |
int | $pageId | ) |
|
|
inherited |
◆ pop()
pocketmine\item\Item::pop |
( |
int | $count = 1 | ) |
|
|
inherited |
Pops an item from the stack and returns it, decreasing the stack count of this item stack by one.
- Returns
- static A clone of this itemstack containing the amount of items that were removed from this stack.
- Exceptions
-
InvalidArgumentException if trying to pop more items than are on the stack
Definition at line 430 of file Item.php.
Referenced by pocketmine\block\Bamboo\onInteract(), pocketmine\block\BambooSapling\onInteract(), pocketmine\block\BaseBigDripleaf\onInteract(), pocketmine\block\Cake\onInteract(), pocketmine\block\CocoaBlock\onInteract(), pocketmine\block\Crops\onInteract(), pocketmine\block\DoublePitcherCrop\onInteract(), pocketmine\block\GlowLichen\onInteract(), pocketmine\block\Jukebox\onInteract(), pocketmine\block\Lectern\onInteract(), pocketmine\block\NetherVines\onInteract(), pocketmine\block\PinkPetals\onInteract(), pocketmine\block\PitcherCrop\onInteract(), pocketmine\block\Sapling\onInteract(), pocketmine\block\SmallDripleaf\onInteract(), pocketmine\block\Sugarcane\onInteract(), pocketmine\block\SweetBerryBush\onInteract(), pocketmine\block\TNT\onInteract(), pocketmine\block\TorchflowerCrop\onInteract(), pocketmine\item\EndCrystal\onInteractBlock(), pocketmine\item\FireCharge\onInteractBlock(), pocketmine\item\GlassBottle\onInteractBlock(), and pocketmine\item\NameTag\onInteractEntity().
◆ serializeCompoundTag()
pocketmine\item\WritableBookBase::serializeCompoundTag |
( |
CompoundTag | $tag | ) |
|
|
protectedinherited |
◆ setCanDestroy()
pocketmine\item\Item::setCanDestroy |
( |
array | $canDestroy | ) |
|
|
inherited |
◆ setCanPlaceOn()
pocketmine\item\Item::setCanPlaceOn |
( |
array | $canPlaceOn | ) |
|
|
inherited |
◆ setCount()
pocketmine\item\Item::setCount |
( |
int | $count | ) |
|
|
inherited |
◆ setCustomBlockData()
pocketmine\item\Item::setCustomBlockData |
( |
CompoundTag | $compound | ) |
|
|
inherited |
◆ setCustomName()
pocketmine\item\Item::setCustomName |
( |
string | $name | ) |
|
|
inherited |
◆ setKeepOnDeath()
pocketmine\item\Item::setKeepOnDeath |
( |
bool | $keepOnDeath | ) |
|
|
inherited |
◆ setLore()
pocketmine\item\Item::setLore |
( |
array | $lines | ) |
|
|
inherited |
- Parameters
-
- Returns
- $this
Definition at line 183 of file Item.php.
◆ setNamedTag()
Sets the Item's NBT from the supplied CompoundTag object.
- Returns
- $this
- Exceptions
-
Definition at line 263 of file Item.php.
◆ setPages()
pocketmine\item\WritableBookBase::setPages |
( |
array | $pages | ) |
|
|
inherited |
◆ setPageText()
pocketmine\item\WritableBookBase::setPageText |
( |
int | $pageId, |
|
|
string | $pageText ) |
|
inherited |
Sets the text of a page in the book. Adds the page if the page does not yet exist.
- Returns
- $this
Definition at line 72 of file WritableBookBase.php.
◆ swapPages()
pocketmine\item\WritableBookBase::swapPages |
( |
int | $pageId1, |
|
|
int | $pageId2 ) |
|
inherited |
Switches the text of two pages with each other.
- Returns
- bool indicating success
- Exceptions
-
OutOfRangeException if either of the pages does not exist
Definition at line 131 of file WritableBookBase.php.
◆ $blockEntityTag
CompoundTag pocketmine\item\Item::$blockEntityTag = null |
|
protectedinherited |
TODO: this needs to die in a fire
Definition at line 88 of file Item.php.
◆ $canDestroy
array pocketmine\item\Item::$canDestroy = [] |
|
protectedinherited |
◆ $canPlaceOn
array pocketmine\item\Item::$canPlaceOn = [] |
|
protectedinherited |
◆ $count
int pocketmine\item\Item::$count = 1 |
|
protectedinherited |
◆ $customName
string pocketmine\item\Item::$customName = "" |
|
protectedinherited |
◆ $keepOnDeath
bool pocketmine\item\Item::$keepOnDeath = false |
|
protectedinherited |
◆ $lore
array pocketmine\item\Item::$lore = [] |
|
protectedinherited |
◆ TAG_BLOCK_ENTITY_TAG
const pocketmine\item\Item::TAG_BLOCK_ENTITY_TAG = "BlockEntityTag" |
|
inherited |
◆ TAG_DISPLAY
const pocketmine\item\Item::TAG_DISPLAY = "display" |
|
inherited |
◆ TAG_DISPLAY_LORE
const pocketmine\item\Item::TAG_DISPLAY_LORE = "Lore" |
|
inherited |
◆ TAG_DISPLAY_NAME
const pocketmine\item\Item::TAG_DISPLAY_NAME = "Name" |
|
inherited |
◆ TAG_ENCH
const pocketmine\item\Item::TAG_ENCH = "ench" |
|
inherited |
◆ TAG_KEEP_ON_DEATH
const pocketmine\item\Item::TAG_KEEP_ON_DEATH = "minecraft:keep_on_death" |
|
inherited |
◆ TAG_PAGE_PHOTONAME
const pocketmine\item\WritableBookBase::TAG_PAGE_PHOTONAME = "photoname" |
|
inherited |
◆ TAG_PAGE_TEXT
const pocketmine\item\WritableBookBase::TAG_PAGE_TEXT = "text" |
|
inherited |
◆ TAG_PAGES
const pocketmine\item\WritableBookBase::TAG_PAGES = "pages" |
|
inherited |
The documentation for this class was generated from the following file: