Skip to content

ExperienceOrb ​

class · pocketmine\entity\object\ExperienceOrb · 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

MAX_TARGET_DISTANCE ​

php
public const MAX_TARGET_DISTANCE = 8.0

Max distance an orb will follow a player across.

NEVER_DESPAWN ​

php
public const NEVER_DESPAWN = -1

ORB_SPLIT_SIZES ​

php
public const ORB_SPLIT_SIZES = [2477, 1237, 617, 307, 149, 73, 37, 17, 7, 3, 1]

Split sizes used for dropping experience orbs.

TAG_VALUE_PC ​

php
public const TAG_VALUE_PC = "Value"

TAG_VALUE_PE ​

php
public const TAG_VALUE_PE = "experience value"

Properties ​

$lookForTargetTime protected ​

php
protected int $lookForTargetTime

Ticker used for determining interval in which to look for new target players.

$targetPlayerRuntimeId protected ​

php
protected ?int $targetPlayerRuntimeId

Runtime entity ID of the player this XP orb is targeting.

$xpValue protected ​

php
protected int $xpValue

Methods ​

__construct() ​

php
public function __construct(\pocketmine\entity\Location $location, int $xpValue, ?\pocketmine\nbt\tag\CompoundTag $nbt = null)

canBeCollidedWith() ​

php
public function canBeCollidedWith() : bool

entityBaseTick() protected ​

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

getDespawnDelay() ​

php
public function getDespawnDelay() : int

getInitialDragMultiplier() protected ​

php
protected function getInitialDragMultiplier() : float

getInitialGravity() protected ​

php
protected function getInitialGravity() : float

getInitialSizeInfo() protected ​

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

getMaxOrbSize() ​

php
public static function getMaxOrbSize(int $amount) : int

Returns the largest size of normal XP orb that will be spawned for the specified amount of XP. Used to split XP up into multiple orbs when an amount of XP is dropped.

getNetworkTypeId() ​

php
public static function getNetworkTypeId() : string

getTargetPlayer() ​

php
public function getTargetPlayer() : ?\pocketmine\entity\Human

getXpValue() ​

php
public function getXpValue() : int

hasTargetPlayer() ​

php
public function hasTargetPlayer() : bool

initEntity() protected ​

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

saveNBT() ​

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

setDespawnDelay() ​

php
public function setDespawnDelay(int $despawnDelay) : void

setTargetPlayer() ​

php
public function setTargetPlayer(?\pocketmine\entity\Human $player) : void

setXpValue() ​

php
public function setXpValue(int $amount) : void

splitIntoOrbSizes() ​

php
public static function splitIntoOrbSizes(int $amount) : array

Splits the specified amount of XP into an array of acceptable XP orb sizes.

syncNetworkData() protected ​

php
protected function syncNetworkData(\pocketmine\network\mcpe\protocol\types\entity\EntityMetadataCollection $properties) : void

tryChangeMovement() protected ​

php
protected function tryChangeMovement() : void

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