Skip to content

ItemEntity ​

class · pocketmine\entity\object\ItemEntity · source

Extends Entity

Constants ​

DEFAULT_DESPAWN_DELAY ​

php
public const DEFAULT_DESPAWN_DELAY = 6000

MAX_DESPAWN_DELAY ​

php
public const MAX_DESPAWN_DELAY = 32767 + self::DEFAULT_DESPAWN_DELAY

MERGE_CHECK_PERIOD ​

php
public const MERGE_CHECK_PERIOD = 2

NEVER_DESPAWN ​

php
public const NEVER_DESPAWN = -1

TAG_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 $thrower

Methods ​

__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() : bool

canBeCollidedWith() ​

php
public function canBeCollidedWith() : bool

canCollideWith() ​

php
public function canCollideWith(\pocketmine\entity\Entity $entity) : bool

canSaveWithChunk() ​

php
public function canSaveWithChunk() : bool

entityBaseTick() protected ​

php
protected function entityBaseTick(int $tickDiff = 1) : bool

getDespawnDelay() ​

php
public function getDespawnDelay() : int

Returns the number of ticks left before this item will despawn. If -1, the item will never despawn.

getInitialDragMultiplier() protected ​

php
protected function getInitialDragMultiplier() : float

getInitialGravity() protected ​

php
protected function getInitialGravity() : float

getInitialSizeInfo() protected ​

php
protected function getInitialSizeInfo() : \pocketmine\entity\EntitySizeInfo

getItem() ​

php
public function getItem() : \pocketmine\item\Item

getNetworkTypeId() ​

php
public static function getNetworkTypeId() : string

getOffsetPosition() ​

php
public function getOffsetPosition(\pocketmine\math\Vector3 $vector3) : \pocketmine\math\Vector3

getOwner() ​

php
public function getOwner() : string

getPickupDelay() ​

php
public function getPickupDelay() : int

getThrower() ​

php
public function getThrower() : string

initEntity() protected ​

php
protected function initEntity(\pocketmine\nbt\tag\CompoundTag $nbt) : void

isFireProof() ​

php
public function isFireProof() : bool

isMergeable() ​

php
public function isMergeable(\pocketmine\entity\object\ItemEntity $entity) : bool

Returns whether this item entity can merge with the given one.

onCollideWithPlayer() ​

php
public function onCollideWithPlayer(\pocketmine\player\Player $player) : void

onDeath() 5.46.0 protected ​

php
protected function onDeath() : void

onFirstUpdate() protected ​

php
protected function onFirstUpdate(int $currentTick) : void

saveNBT() ​

php
public function saveNBT() : \pocketmine\nbt\tag\CompoundTag

sendSpawnPacket() protected ​

php
protected function sendSpawnPacket(\pocketmine\player\Player $player) : void

setDespawnDelay() ​

php
public function setDespawnDelay(int $despawnDelay) : void

setOwner() ​

php
public function setOwner(string $owner) : void

setPickupDelay() ​

php
public function setPickupDelay(int $delay) : void

setStackSize() ​

php
public function setStackSize(int $newCount) : void

setThrower() ​

php
public function setThrower(string $thrower) : void

tryChangeMovement() protected ​

php
protected function tryChangeMovement() : void

tryMergeInto() ​

php
public function tryMergeInto(\pocketmine\entity\object\ItemEntity $consumer) : bool

Attempts to merge this item entity into the given item entity. Returns true if it was successful.

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