PocketMine-MP 5.21.2 git-a6534ecbbbcf369264567d27e5ed70f7f5be9816
|
Static Public Member Functions | |
static | legacyJsonDeserialize (array $data) |
static | nbtDeserialize (CompoundTag $tag) |
Public Attributes | |
const | TAG_BLOCK_ENTITY_TAG = "BlockEntityTag" |
const | TAG_DISPLAY = "display" |
const | TAG_DISPLAY_LORE = "Lore" |
const | TAG_DISPLAY_NAME = "Name" |
const | TAG_ENCH = "ench" |
const | TAG_KEEP_ON_DEATH = "minecraft:keep_on_death" |
Protected Member Functions | |
describeState (RuntimeDataDescriber $w) | |
deserializeCompoundTag (CompoundTag $tag) | |
serializeCompoundTag (CompoundTag $tag) | |
Protected Attributes | |
CompoundTag | $blockEntityTag = null |
array | $canDestroy = [] |
array | $canPlaceOn = [] |
int | $count = 1 |
string | $customName = "" |
bool | $keepOnDeath = false |
array | $lore = [] |
Class used for Items that directly represent blocks, such as stone, dirt, wood etc.
This should NOT be used for items which are merely associated with blocks (e.g. seeds are not wheat crops; they just place wheat crops when used on the ground).
Definition at line 36 of file ItemBlock.php.
pocketmine\item\ItemBlock::__construct | ( | private Block | $block | ) |
Definition at line 37 of file ItemBlock.php.
|
finalinherited |
|
inherited |
|
inherited |
|
inherited |
|
protected |
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 from pocketmine\item\Item.
Definition at line 43 of file ItemBlock.php.
|
protectedinherited |
NbtException |
Reimplemented in pocketmine\item\Armor, pocketmine\item\Banner, pocketmine\item\Durable, pocketmine\item\WritableBookBase, and pocketmine\item\WrittenBook.
|
finalinherited |
Compares an Item to this Item and check if they match.
bool | $checkDamage |
bool | $checkCompound | Whether to verify that the items' NBT match. |
|
finalinherited |
|
inherited |
Returns how many points of damage this item will deal to an entity when used as a weapon.
Reimplemented in pocketmine\item\Axe, pocketmine\item\Pickaxe, pocketmine\item\Shovel, and pocketmine\item\Sword.
pocketmine\item\ItemBlock::getBlock | ( | ?int | $clickedFace = null | ) |
Returns the block corresponding to this Item.
Reimplemented from pocketmine\item\Item.
Definition at line 47 of file ItemBlock.php.
|
inherited |
Returns the harvesting power that this tool has. This affects what blocks it can mine when the tool type matches the mined block. This should return 1 for non-tiered tools, and the tool tier for tiered tools.
Reimplemented in pocketmine\item\Axe, pocketmine\item\Pickaxe, pocketmine\item\Shears, pocketmine\item\Shovel, and pocketmine\item\Sword.
|
inherited |
Returns what type of block-breaking tool this is. Blocks requiring the same tool type as the item will break faster (except for blocks requiring no tool, which break at the same speed regardless of the tool used)
Reimplemented in pocketmine\item\Axe, pocketmine\item\Hoe, pocketmine\item\Pickaxe, pocketmine\item\Shears, pocketmine\item\Shovel, and pocketmine\item\Sword.
|
inherited |
|
inherited |
|
inherited |
Returns a tag that identifies a group of items that should have cooldown at the same time regardless of their state or type. When cooldown starts, any other items with the same cooldown tag can't be used until the cooldown expires. Such behaviour can be seen in goat horns and shields.
If tag is null, item state id will be used to store cooldown.
Reimplemented in pocketmine\item\ChorusFruit, pocketmine\item\EnderPearl, and pocketmine\item\GoatHorn.
Definition at line 667 of file Item.php.
Referenced by pocketmine\player\Player\resetItemCooldown().
|
inherited |
Returns the number of ticks a player must wait before activating this item again.
Reimplemented in pocketmine\item\ChorusFruit, pocketmine\item\EnderPearl, and pocketmine\item\GoatHorn.
|
inherited |
Returns how many armor points can be gained by wearing this item.
Reimplemented in pocketmine\item\Armor.
|
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.
|
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.).
|
inherited |
Returns an item after burning fuel
Reimplemented in pocketmine\item\LiquidBucket.
pocketmine\item\ItemBlock::getFuelTime | ( | ) |
Returns the time in ticks which the item will fuel a furnace for.
Reimplemented from pocketmine\item\Item.
Definition at line 51 of file ItemBlock.php.
|
inherited |
pocketmine\item\ItemBlock::getMaxStackSize | ( | ) |
Returns the highest amount of this item which will fit into one inventory slot.
Reimplemented from pocketmine\item\Item.
Definition at line 59 of file ItemBlock.php.
|
inherited |
|
finalinherited |
|
inherited |
|
inherited |
|
inherited |
pocketmine\item\ItemBlock::isFireProof | ( | ) |
Returns whether this item can survive being dropped into lava, or fire.
Reimplemented from pocketmine\item\Item.
Definition at line 55 of file ItemBlock.php.
pocketmine\item\ItemBlock::isNull | ( | ) |
Reimplemented from pocketmine\item\Item.
Definition at line 63 of file ItemBlock.php.
|
inherited |
|
inherited |
|
staticfinalinherited |
|
staticinherited |
|
inherited |
|
inherited |
Called when this item is used to attack an entity. Usually used to update durability.
Item[] | &$returnedItems | Items to be added to the target's inventory (or dropped, if the inventory is full) |
Reimplemented in pocketmine\item\Axe, pocketmine\item\Hoe, pocketmine\item\Pickaxe, pocketmine\item\Shovel, and pocketmine\item\Sword.
|
inherited |
Called when a player uses the item on air, for example throwing a projectile. Returns whether the item was changed, for example count decrease or durability change.
Item[] | &$returnedItems | Items to be added to the target's inventory (or dropped, if the inventory is full) |
Reimplemented in pocketmine\item\Armor, pocketmine\item\GoatHorn, and pocketmine\item\ProjectileItem.
|
inherited |
Called when this item is used to destroy a block. Usually used to update durability.
Item[] | &$returnedItems | Items to be added to the target's inventory (or dropped, if the inventory is full) |
Reimplemented in pocketmine\item\Axe, pocketmine\item\Hoe, pocketmine\item\Pickaxe, pocketmine\item\Shears, pocketmine\item\Shovel, and pocketmine\item\Sword.
|
inherited |
Called when a player uses this item on a block.
Item[] | &$returnedItems | Items to be added to the target's inventory (or dropped, if the inventory is full) |
Reimplemented in pocketmine\item\Bucket, pocketmine\item\EndCrystal, pocketmine\item\FireCharge, pocketmine\item\FlintSteel, pocketmine\item\GlassBottle, pocketmine\item\LiquidBucket, pocketmine\item\PaintingItem, and pocketmine\item\SpawnEgg.
|
inherited |
Called when a player uses the item to interact with entity, for example by using a name tag.
Vector3 | $clickVector | The exact position of the click (absolute coordinates) |
Reimplemented in pocketmine\item\NameTag.
|
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.
Item[] | &$returnedItems | Items to be added to the target's inventory (or dropped, if the inventory is full) |
Reimplemented in pocketmine\item\Bow.
|
inherited |
Called when this item is being worn by an entity. Returns whether it did something.
Reimplemented in pocketmine\item\TurtleHelmet.
|
inherited |
Pops an item from the stack and returns it, decreasing the stack count of this item stack by one.
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().
|
protectedinherited |
|
inherited |
|
inherited |
|
inherited |
|
inherited |
|
inherited |
|
inherited |
|
inherited |
|
inherited |
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
|
inherited |
|
inherited |
|
inherited |
|
inherited |
|
inherited |