ItemEntity
Extends Entity
Constants
DEFAULT_DESPAWN_DELAY
php
public const DEFAULT_DESPAWN_DELAY = 6000MAX_DESPAWN_DELAY
php
public const MAX_DESPAWN_DELAY = 32767 + self::DEFAULT_DESPAWN_DELAYMERGE_CHECK_PERIOD
php
public const MERGE_CHECK_PERIOD = 2NEVER_DESPAWN
php
public const NEVER_DESPAWN = -1TAG_ITEM
php
public const TAG_ITEM = "Item"Properties
$despawnDelay protected
php
protected int $despawnDelay$item protected
php
protected \pocketmine\item\Item $item$owner protected
php
protected string $owner$pickupDelay protected
php
protected int $pickupDelay$thrower protected
php
protected string $throwerMethods
__construct()
php
public function __construct(\pocketmine\entity\Location $location, \pocketmine\item\Item $item, ?\pocketmine\nbt\tag\CompoundTag $nbt = null)applyDragBeforeGravity() protected
php
protected function applyDragBeforeGravity() : boolcanBeCollidedWith()
php
public function canBeCollidedWith() : boolcanCollideWith()
php
public function canCollideWith(\pocketmine\entity\Entity $entity) : boolcanSaveWithChunk()
php
public function canSaveWithChunk() : boolentityBaseTick() protected
php
protected function entityBaseTick(int $tickDiff = 1) : boolgetDespawnDelay()
php
public function getDespawnDelay() : intReturns the number of ticks left before this item will despawn. If -1, the item will never despawn.
getInitialDragMultiplier() protected
php
protected function getInitialDragMultiplier() : floatgetInitialGravity() protected
php
protected function getInitialGravity() : floatgetInitialSizeInfo() protected
php
protected function getInitialSizeInfo() : \pocketmine\entity\EntitySizeInfogetItem()
php
public function getItem() : \pocketmine\item\ItemgetNetworkTypeId()
php
public static function getNetworkTypeId() : stringgetOffsetPosition()
php
public function getOffsetPosition(\pocketmine\math\Vector3 $vector3) : \pocketmine\math\Vector3getOwner()
php
public function getOwner() : stringgetPickupDelay()
php
public function getPickupDelay() : intgetThrower()
php
public function getThrower() : stringinitEntity() protected
php
protected function initEntity(\pocketmine\nbt\tag\CompoundTag $nbt) : voidisFireProof()
php
public function isFireProof() : boolisMergeable()
php
public function isMergeable(\pocketmine\entity\object\ItemEntity $entity) : boolReturns whether this item entity can merge with the given one.
onCollideWithPlayer()
php
public function onCollideWithPlayer(\pocketmine\player\Player $player) : voidonDeath() 5.46.0 protected
php
protected function onDeath() : voidonFirstUpdate() protected
php
protected function onFirstUpdate(int $currentTick) : voidsaveNBT()
php
public function saveNBT() : \pocketmine\nbt\tag\CompoundTagsendSpawnPacket() protected
php
protected function sendSpawnPacket(\pocketmine\player\Player $player) : voidsetDespawnDelay()
php
public function setDespawnDelay(int $despawnDelay) : voidsetOwner()
php
public function setOwner(string $owner) : voidsetPickupDelay()
php
public function setPickupDelay(int $delay) : voidsetStackSize()
php
public function setStackSize(int $newCount) : voidsetThrower()
php
public function setThrower(string $thrower) : voidtryChangeMovement() protected
php
protected function tryChangeMovement() : voidtryMergeInto()
php
public function tryMergeInto(\pocketmine\entity\object\ItemEntity $consumer) : boolAttempts to merge this item entity into the given item entity. Returns true if it was successful.
