ExperienceOrb
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_DELAYMAX_TARGET_DISTANCE
php
public const MAX_TARGET_DISTANCE = 8.0Max distance an orb will follow a player across.
NEVER_DESPAWN
php
public const NEVER_DESPAWN = -1ORB_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 $lookForTargetTimeTicker used for determining interval in which to look for new target players.
$targetPlayerRuntimeId protected
php
protected ?int $targetPlayerRuntimeIdRuntime entity ID of the player this XP orb is targeting.
$xpValue protected
php
protected int $xpValueMethods
__construct()
php
public function __construct(\pocketmine\entity\Location $location, int $xpValue, ?\pocketmine\nbt\tag\CompoundTag $nbt = null)canBeCollidedWith()
php
public function canBeCollidedWith() : boolentityBaseTick() protected
php
protected function entityBaseTick(int $tickDiff = 1) : boolgetDespawnDelay()
php
public function getDespawnDelay() : intgetInitialDragMultiplier() protected
php
protected function getInitialDragMultiplier() : floatgetInitialGravity() protected
php
protected function getInitialGravity() : floatgetInitialSizeInfo() protected
php
protected function getInitialSizeInfo() : \pocketmine\entity\EntitySizeInfogetMaxOrbSize()
php
public static function getMaxOrbSize(int $amount) : intReturns 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() : stringgetTargetPlayer()
php
public function getTargetPlayer() : ?\pocketmine\entity\HumangetXpValue()
php
public function getXpValue() : inthasTargetPlayer()
php
public function hasTargetPlayer() : boolinitEntity() protected
php
protected function initEntity(\pocketmine\nbt\tag\CompoundTag $nbt) : voidsaveNBT()
php
public function saveNBT() : \pocketmine\nbt\tag\CompoundTagsetDespawnDelay()
php
public function setDespawnDelay(int $despawnDelay) : voidsetTargetPlayer()
php
public function setTargetPlayer(?\pocketmine\entity\Human $player) : voidsetXpValue()
php
public function setXpValue(int $amount) : voidsplitIntoOrbSizes()
php
public static function splitIntoOrbSizes(int $amount) : arraySplits 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) : voidtryChangeMovement() protected
php
protected function tryChangeMovement() : void