Documentation

ExperienceOrb extends Entity
in package

Table of Contents

MAX_TARGET_DISTANCE  = 8.0
Max distance an orb will follow a player across.
MOTION_THRESHOLD  = 1.0E-5
ORB_SPLIT_SIZES  = [2477, 1237, 617, 307, 149, 73, 37, 17, 7, 3, 1]
Split sizes used for dropping experience orbs.
TAG_VALUE_PC  = "Value"
TAG_VALUE_PE  = "experience value"
STEP_CLIP_MULTIPLIER  = 0.4
$boundingBox  : AxisAlignedBB
$canCollide  : bool
$drag  : float
$fallDistance  : float
$gravity  : float
$isCollided  : bool
$isCollidedHorizontally  : bool
$isCollidedVertically  : bool
$keepMovement  : bool
$lastUpdate  : int
$noDamageTicks  : int
$onGround  : bool
$size  : EntitySizeInfo
$ticksLived  : int
$age  : int
$alwaysShowNameTag  : bool
$attributeMap  : AttributeMap
$blocksAround  : array<string|int, Block>|null
$canClimb  : bool
$canClimbWalls  : bool
$closed  : bool
$fireTicks  : int
$forceMovementUpdate  : bool
$gravityEnabled  : bool
$hasSpawned  : array<string|int, Player>
$id  : int
$immobile  : bool
$invisible  : bool
$isStatic  : bool
$justCreated  : bool
$lastDamageCause  : EntityDamageEvent|null
$lastLocation  : Location
$lastMotion  : Vector3
$location  : Location
$lookForTargetTime  : int
$motion  : Vector3
$nameTag  : string
$nameTagVisible  : bool
$networkPropertiesDirty  : bool
$ownerId  : int|null
$scale  : float
$scoreTag  : string
$server  : Server
$silent  : bool
$stepHeight  : float
$targetId  : int|null
$targetPlayerRuntimeId  : int|null
$timings  : TimingsHandler
$xpValue  : int
$ySize  : float
$closeInFlight  : bool
$entityCount  : int
$health  : float
$maxHealth  : int
$needsDespawn  : bool
$networkProperties  : EntityMetadataCollection
$savedWithChunk  : bool
__construct()  : mixed
__destruct()  : mixed
__toString()  : mixed
addMotion()  : void
Adds the given values to the entity's motion vector.
attack()  : void
broadcastAnimation()  : void
broadcastSound()  : void
Broadcasts a sound caused by the entity. If the entity is considered "silent", the sound will be dropped.
canBeCollidedWith()  : bool
canBeMovedByCurrents()  : bool
Returns whether this entity can be moved by currents in liquids.
canClimb()  : bool
Returns whether the entity is able to climb blocks such as ladders or vines.
canClimbWalls()  : bool
Returns whether this entity is climbing a block. By default this is only true if the entity is climbing a ladder or vine or similar block.
canCollideWith()  : bool
canSaveWithChunk()  : bool
Returns whether this entity will be saved when its chunk is unloaded.
close()  : void
Closes the entity and frees attached references.
despawnFrom()  : void
despawnFromAll()  : void
extinguish()  : void
flagForDespawn()  : void
Flags the entity to be removed from the world on the next tick.
getAttributeMap()  : AttributeMap
getBoundingBox()  : AxisAlignedBB
getDirectionPlane()  : Vector2
getDirectionVector()  : Vector3
getEyeHeight()  : float
getEyePos()  : Vector3
getFallDistance()  : float
getFireTicks()  : int
getHealth()  : float
getHorizontalFacing()  : int
getId()  : int
getLastDamageCause()  : EntityDamageEvent|null
getLocation()  : Location
getMaxHealth()  : int
getMaxOrbSize()  : 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.
getMotion()  : Vector3
getNameTag()  : string
getNetworkProperties()  : EntityMetadataCollection
getNetworkTypeId()  : string
getOffsetPosition()  : Vector3
getOwningEntity()  : Entity|null
Returns the owning entity, or null if the entity was not found.
getOwningEntityId()  : int|null
Returns the entity ID of the owning entity, or null if the entity doesn't have an owner.
getPosition()  : Position
getScale()  : float
getScoreTag()  : string|null
getTargetEntity()  : Entity|null
Returns the entity's target entity, or null if not found.
getTargetEntityId()  : int|null
Returns the entity ID of the entity's target, or null if it doesn't have a target.
getTargetPlayer()  : Human|null
getViewers()  : array<string|int, Player>
getWorld()  : World
getXpValue()  : int
hasGravity()  : bool
hasMovementUpdate()  : bool
Returns whether the entity needs a movement update on the next tick.
hasTargetPlayer()  : bool
heal()  : void
isAlive()  : bool
isClosed()  : bool
Returns whether the entity has been "closed".
isFireProof()  : bool
isFlaggedForDespawn()  : bool
isImmobile()  : bool
isInsideOfSolid()  : bool
isInvisible()  : bool
isNameTagAlwaysVisible()  : bool
isNameTagVisible()  : bool
isOnFire()  : bool
isOnGround()  : bool
isSilent()  : bool
isUnderwater()  : bool
kill()  : void
nextRuntimeId()  : int
Returns a new runtime entity ID for a new entity.
onCollideWithPlayer()  : void
onInteract()  : bool
Called when interacted or tapped by a Player. Returns whether something happened as a result of the interaction.
onNearbyBlockChange()  : void
onRandomUpdate()  : void
Called when a random update is performed on the chunk the entity is in. This happens when the chunk is within the ticking chunk range of a player (or chunk loader).
onUpdate()  : bool
resetFallDistance()  : void
respawnToAll()  : void
saveNBT()  : CompoundTag
scheduleUpdate()  : void
sendData()  : void
setCanClimb()  : void
Sets whether the entity is able to climb climbable blocks.
setCanClimbWalls()  : void
Sets whether the entity is climbing a block. If true, the entity can climb anything.
setCanSaveWithChunk()  : void
Sets whether this entity will be saved when its chunk is unloaded. This can be used to prevent the entity being saved to disk.
setFallDistance()  : void
setFireTicks()  : void
setForceMovementUpdate()  : void
Flags the entity as needing a movement update on the next tick. Setting this forces a movement update even if the entity's motion is zero. Used to trigger movement updates when blocks change near entities.
setHasGravity()  : void
setHealth()  : void
Sets the health of the Entity. This won't send any update to the players
setImmobile()  : void
setInvisible()  : void
setLastDamageCause()  : void
setMaxHealth()  : void
setMotion()  : bool
setNameTag()  : void
setNameTagAlwaysVisible()  : void
setNameTagVisible()  : void
setOnFire()  : void
setOwningEntity()  : void
Sets the owner of the entity. Passing null will remove the current owner.
setRotation()  : void
setScale()  : void
setScoreTag()  : void
setSilent()  : void
setTargetEntity()  : void
Sets the entity's target entity. Passing null will remove the current target.
setTargetPlayer()  : void
setXpValue()  : void
spawnTo()  : void
spawnToAll()  : void
splitIntoOrbSizes()  : array<string|int, int>
Splits the specified amount of XP into an array of acceptable XP orb sizes.
teleport()  : bool
addAttributes()  : void
applyDragBeforeGravity()  : bool
broadcastMotion()  : void
broadcastMovement()  : void
checkBlockIntersections()  : void
checkGroundState()  : void
checkObstruction()  : bool
dealFireDamage()  : void
Called to deal damage to entities when they are on fire.
destroyCycles()  : void
Called when the entity is disposed, after all events have been fired. This should be used to perform destructive circular object references and things which could impact memory usage.
doOnFireTick()  : bool
entityBaseTick()  : bool
getAllNetworkData()  : array<string|int, MetadataProperty>
getBlocksAroundWithEntityInsideActions()  : array<string|int, Block>
getDirtyNetworkData()  : array<string|int, MetadataProperty>
getInitialSizeInfo()  : EntitySizeInfo
initEntity()  : void
move()  : void
onDeath()  : void
Override this to do actions on death.
onDeathUpdate()  : bool
Called to tick entities while dead. Returns whether the entity should be flagged for despawn yet.
onDispose()  : void
Called when the entity is disposed to clean up things like viewers. This SHOULD NOT destroy internal state, because it may be needed by descendent classes.
onHitGround()  : float|null
Called when a falling entity hits the ground.
recalculateBoundingBox()  : void
resetLastMovements()  : void
sendSpawnPacket()  : void
Called by spawnTo() to send whatever packets needed to spawn the entity to the client.
setPosition()  : bool
setPositionAndRotation()  : bool
syncNetworkData()  : void
tryChangeMovement()  : void
updateFallState()  : float|null
updateMovement()  : void

Constants

MAX_TARGET_DISTANCE

Max distance an orb will follow a player across.

public mixed MAX_TARGET_DISTANCE = 8.0

MOTION_THRESHOLD

public mixed MOTION_THRESHOLD = 1.0E-5

ORB_SPLIT_SIZES

Split sizes used for dropping experience orbs.

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

STEP_CLIP_MULTIPLIER

protected mixed STEP_CLIP_MULTIPLIER = 0.4

Properties

$canCollide

public bool $canCollide = true

$fallDistance

public float $fallDistance = 0.0

$isCollided

public bool $isCollided = false

$isCollidedHorizontally

public bool $isCollidedHorizontally = false

$isCollidedVertically

public bool $isCollidedVertically = false

$keepMovement

public bool $keepMovement = false

$lastUpdate

public int $lastUpdate

$noDamageTicks

public int $noDamageTicks = 0

$onGround

public bool $onGround = false

$ticksLived

public int $ticksLived = 0

$alwaysShowNameTag

protected bool $alwaysShowNameTag = false

$blocksAround

protected array<string|int, Block>|null $blocksAround

$canClimb

protected bool $canClimb = false

$canClimbWalls

protected bool $canClimbWalls = false

$closed

protected bool $closed = false

$fireTicks

protected int $fireTicks = 0

$forceMovementUpdate

protected bool $forceMovementUpdate = false

$gravityEnabled

protected bool $gravityEnabled = true

$hasSpawned

protected array<string|int, Player> $hasSpawned = []

$immobile

protected bool $immobile = false

$invisible

protected bool $invisible = false

$isStatic

protected bool $isStatic = false

$justCreated

protected bool $justCreated = true

$lookForTargetTime

protected int $lookForTargetTime = 0

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

$nameTag

protected string $nameTag = ""

$nameTagVisible

protected bool $nameTagVisible = true

$networkPropertiesDirty

protected bool $networkPropertiesDirty = false

$ownerId

protected int|null $ownerId = null

$scale

protected float $scale = 1.0

$scoreTag

protected string $scoreTag = ""

$silent

protected bool $silent = false

$stepHeight

protected float $stepHeight = 0.0

$targetId

protected int|null $targetId = null

$targetPlayerRuntimeId

protected int|null $targetPlayerRuntimeId = null

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

$ySize

protected float $ySize = 0.0

$closeInFlight

private bool $closeInFlight = false

$entityCount

private static int $entityCount = 1

$health

private float $health = 20.0

$maxHealth

private int $maxHealth = 20

$needsDespawn

private bool $needsDespawn = false

$savedWithChunk

private bool $savedWithChunk = true

Methods

__destruct()

public __destruct() : mixed
Return values
mixed

__toString()

public __toString() : mixed
Return values
mixed

addMotion()

Adds the given values to the entity's motion vector.

public addMotion(float $x, float $y, float $z) : void
Parameters
$x : float
$y : float
$z : float
Return values
void

broadcastAnimation()

public broadcastAnimation(Animation $animation[, array<string|int, Player>|null $targets = null ]) : void
Parameters
$animation : Animation
$targets : array<string|int, Player>|null = null
Return values
void

broadcastSound()

Broadcasts a sound caused by the entity. If the entity is considered "silent", the sound will be dropped.

public broadcastSound(Sound $sound[, array<string|int, Player>|null $targets = null ]) : void
Parameters
$sound : Sound
$targets : array<string|int, Player>|null = null
Return values
void

canBeCollidedWith()

public canBeCollidedWith() : bool
Return values
bool

canBeMovedByCurrents()

Returns whether this entity can be moved by currents in liquids.

public canBeMovedByCurrents() : bool
Return values
bool

canClimb()

Returns whether the entity is able to climb blocks such as ladders or vines.

public canClimb() : bool
Return values
bool

canClimbWalls()

Returns whether this entity is climbing a block. By default this is only true if the entity is climbing a ladder or vine or similar block.

public canClimbWalls() : bool
Return values
bool

canCollideWith()

public canCollideWith(Entity $entity) : bool
Parameters
$entity : Entity
Return values
bool

canSaveWithChunk()

Returns whether this entity will be saved when its chunk is unloaded.

public canSaveWithChunk() : bool
Return values
bool

close()

Closes the entity and frees attached references.

public final close() : void

WARNING: Entities are unusable after this has been executed!

Return values
void

despawnFrom()

public despawnFrom(Player $player[, bool $send = true ]) : void
Parameters
$player : Player
$send : bool = true
Tags
deprecated

WARNING: This function DOES NOT permanently hide the entity from the player. As soon as the entity or player moves, the player will once again be able to see the entity.

Return values
void

despawnFromAll()

public despawnFromAll() : void
Tags
deprecated

WARNING: This function DOES NOT permanently hide the entity from viewers. As soon as the entity or player moves, viewers will once again be able to see the entity.

Return values
void

extinguish()

public extinguish() : void
Return values
void

flagForDespawn()

Flags the entity to be removed from the world on the next tick.

public flagForDespawn() : void
Return values
void

getEyeHeight()

public getEyeHeight() : float
Return values
float

getFallDistance()

public getFallDistance() : float
Return values
float

getFireTicks()

public getFireTicks() : int
Return values
int

getHealth()

public getHealth() : float
Return values
float

getHorizontalFacing()

public getHorizontalFacing() : int
Return values
int

getId()

public getId() : int
Return values
int

getMaxHealth()

public getMaxHealth() : int
Return values
int

getMaxOrbSize()

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.

public static getMaxOrbSize(int $amount) : int
Parameters
$amount : int
Return values
int

getNameTag()

public getNameTag() : string
Return values
string

getNetworkTypeId()

public static getNetworkTypeId() : string
Return values
string

getOwningEntity()

Returns the owning entity, or null if the entity was not found.

public getOwningEntity() : Entity|null
Return values
Entity|null

getOwningEntityId()

Returns the entity ID of the owning entity, or null if the entity doesn't have an owner.

public getOwningEntityId() : int|null
Return values
int|null

getScale()

public getScale() : float
Return values
float

getScoreTag()

public getScoreTag() : string|null
Return values
string|null

getTargetEntity()

Returns the entity's target entity, or null if not found.

public getTargetEntity() : Entity|null

This is used for things like hostile mobs attacking entities, and for fishing rods reeling hit entities in.

Return values
Entity|null

getTargetEntityId()

Returns the entity ID of the entity's target, or null if it doesn't have a target.

public getTargetEntityId() : int|null
Return values
int|null

getViewers()

public getViewers() : array<string|int, Player>
Return values
array<string|int, Player>

getXpValue()

public getXpValue() : int
Return values
int

hasGravity()

public hasGravity() : bool
Return values
bool

hasMovementUpdate()

Returns whether the entity needs a movement update on the next tick.

public hasMovementUpdate() : bool
Return values
bool

hasTargetPlayer()

public hasTargetPlayer() : bool
Return values
bool

isAlive()

public isAlive() : bool
Return values
bool

isClosed()

Returns whether the entity has been "closed".

public isClosed() : bool
Return values
bool

isFireProof()

public isFireProof() : bool
Return values
bool

isFlaggedForDespawn()

public isFlaggedForDespawn() : bool
Return values
bool

isImmobile()

public isImmobile() : bool
Return values
bool

isInsideOfSolid()

public isInsideOfSolid() : bool
Return values
bool

isInvisible()

public isInvisible() : bool
Return values
bool

isNameTagAlwaysVisible()

public isNameTagAlwaysVisible() : bool
Return values
bool

isNameTagVisible()

public isNameTagVisible() : bool
Return values
bool

isOnFire()

public isOnFire() : bool
Return values
bool

isOnGround()

public isOnGround() : bool
Return values
bool

isSilent()

public isSilent() : bool
Return values
bool

isUnderwater()

public isUnderwater() : bool
Return values
bool

kill()

public kill() : void
Return values
void

nextRuntimeId()

Returns a new runtime entity ID for a new entity.

public static nextRuntimeId() : int
Return values
int

onCollideWithPlayer()

public onCollideWithPlayer(Player $player) : void
Parameters
$player : Player
Return values
void

onInteract()

Called when interacted or tapped by a Player. Returns whether something happened as a result of the interaction.

public onInteract(Player $player, Vector3 $clickPos) : bool
Parameters
$player : Player
$clickPos : Vector3
Return values
bool

onNearbyBlockChange()

public onNearbyBlockChange() : void
Return values
void

onRandomUpdate()

Called when a random update is performed on the chunk the entity is in. This happens when the chunk is within the ticking chunk range of a player (or chunk loader).

public onRandomUpdate() : void
Return values
void

onUpdate()

public onUpdate(int $currentTick) : bool
Parameters
$currentTick : int
Return values
bool

resetFallDistance()

public resetFallDistance() : void
Return values
void

respawnToAll()

public respawnToAll() : void
Return values
void

scheduleUpdate()

public final scheduleUpdate() : void
Return values
void

sendData()

public sendData(array<string|int, Player>|null $targets[, array<string|int, MetadataProperty$data = null ]) : void
Parameters
$targets : array<string|int, Player>|null
$data : array<string|int, MetadataProperty> = null

Properly formatted entity data, defaults to everything

Tags
phpstan-param

array<int, MetadataProperty> $data

Return values
void

setCanClimb()

Sets whether the entity is able to climb climbable blocks.

public setCanClimb([bool $value = true ]) : void
Parameters
$value : bool = true
Return values
void

setCanClimbWalls()

Sets whether the entity is climbing a block. If true, the entity can climb anything.

public setCanClimbWalls([bool $value = true ]) : void
Parameters
$value : bool = true
Return values
void

setCanSaveWithChunk()

Sets whether this entity will be saved when its chunk is unloaded. This can be used to prevent the entity being saved to disk.

public setCanSaveWithChunk(bool $value) : void
Parameters
$value : bool
Return values
void

setFallDistance()

public setFallDistance(float $fallDistance) : void
Parameters
$fallDistance : float
Return values
void

setFireTicks()

public setFireTicks(int $fireTicks) : void
Parameters
$fireTicks : int
Tags
throws
InvalidArgumentException
Return values
void

setForceMovementUpdate()

Flags the entity as needing a movement update on the next tick. Setting this forces a movement update even if the entity's motion is zero. Used to trigger movement updates when blocks change near entities.

public final setForceMovementUpdate([bool $value = true ]) : void
Parameters
$value : bool = true
Return values
void

setHasGravity()

public setHasGravity([bool $v = true ]) : void
Parameters
$v : bool = true
Return values
void

setHealth()

Sets the health of the Entity. This won't send any update to the players

public setHealth(float $amount) : void
Parameters
$amount : float
Return values
void

setImmobile()

public setImmobile([bool $value = true ]) : void
Parameters
$value : bool = true
Return values
void

setInvisible()

public setInvisible([bool $value = true ]) : void
Parameters
$value : bool = true
Return values
void

setMaxHealth()

public setMaxHealth(int $amount) : void
Parameters
$amount : int
Return values
void

setMotion()

public setMotion(Vector3 $motion) : bool
Parameters
$motion : Vector3
Return values
bool

setNameTag()

public setNameTag(string $name) : void
Parameters
$name : string
Return values
void

setNameTagAlwaysVisible()

public setNameTagAlwaysVisible([bool $value = true ]) : void
Parameters
$value : bool = true
Return values
void

setNameTagVisible()

public setNameTagVisible([bool $value = true ]) : void
Parameters
$value : bool = true
Return values
void

setOnFire()

public setOnFire(int $seconds) : void
Parameters
$seconds : int
Return values
void

setOwningEntity()

Sets the owner of the entity. Passing null will remove the current owner.

public setOwningEntity(Entity|null $owner) : void
Parameters
$owner : Entity|null
Tags
throws
InvalidArgumentException

if the supplied entity is not valid

Return values
void

setRotation()

public setRotation(float $yaw, float $pitch) : void
Parameters
$yaw : float
$pitch : float
Return values
void

setScale()

public setScale(float $value) : void
Parameters
$value : float
Return values
void

setScoreTag()

public setScoreTag(string $score) : void
Parameters
$score : string
Return values
void

setSilent()

public setSilent([bool $value = true ]) : void
Parameters
$value : bool = true
Return values
void

setTargetEntity()

Sets the entity's target entity. Passing null will remove the current target.

public setTargetEntity(Entity|null $target) : void
Parameters
$target : Entity|null
Tags
throws
InvalidArgumentException

if the target entity is not valid

Return values
void

setTargetPlayer()

public setTargetPlayer(Human|null $player) : void
Parameters
$player : Human|null
Return values
void

setXpValue()

public setXpValue(int $amount) : void
Parameters
$amount : int
Return values
void

spawnTo()

public spawnTo(Player $player) : void
Parameters
$player : Player
Return values
void

spawnToAll()

public spawnToAll() : void
Return values
void

splitIntoOrbSizes()

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

public static splitIntoOrbSizes(int $amount) : array<string|int, int>
Parameters
$amount : int
Return values
array<string|int, int>

addAttributes()

protected addAttributes() : void
Return values
void

applyDragBeforeGravity()

protected applyDragBeforeGravity() : bool
Return values
bool

broadcastMotion()

protected broadcastMotion() : void
Return values
void

broadcastMovement()

protected broadcastMovement([bool $teleport = false ]) : void
Parameters
$teleport : bool = false
Return values
void

checkBlockIntersections()

protected checkBlockIntersections() : void
Return values
void

checkGroundState()

protected checkGroundState(float $wantedX, float $wantedY, float $wantedZ, float $dx, float $dy, float $dz) : void
Parameters
$wantedX : float
$wantedY : float
$wantedZ : float
$dx : float
$dy : float
$dz : float
Return values
void

checkObstruction()

protected checkObstruction(float $x, float $y, float $z) : bool
Parameters
$x : float
$y : float
$z : float
Return values
bool

dealFireDamage()

Called to deal damage to entities when they are on fire.

protected dealFireDamage() : void
Return values
void

destroyCycles()

Called when the entity is disposed, after all events have been fired. This should be used to perform destructive circular object references and things which could impact memory usage.

protected destroyCycles() : void

It is expected that the object is unusable after this is called.

Return values
void

doOnFireTick()

protected doOnFireTick([int $tickDiff = 1 ]) : bool
Parameters
$tickDiff : int = 1
Return values
bool

entityBaseTick()

protected entityBaseTick([int $tickDiff = 1 ]) : bool
Parameters
$tickDiff : int = 1
Return values
bool

getAllNetworkData()

protected final getAllNetworkData() : array<string|int, MetadataProperty>
Tags
phpstan-return

array<int, MetadataProperty>

Return values
array<string|int, MetadataProperty>

getBlocksAroundWithEntityInsideActions()

protected getBlocksAroundWithEntityInsideActions() : array<string|int, Block>
Return values
array<string|int, Block>

getDirtyNetworkData()

protected final getDirtyNetworkData() : array<string|int, MetadataProperty>
Tags
phpstan-return

array<int, MetadataProperty>

Return values
array<string|int, MetadataProperty>

move()

protected move(float $dx, float $dy, float $dz) : void
Parameters
$dx : float
$dy : float
$dz : float
Return values
void

onDeath()

Override this to do actions on death.

protected onDeath() : void
Return values
void

onDeathUpdate()

Called to tick entities while dead. Returns whether the entity should be flagged for despawn yet.

protected onDeathUpdate(int $tickDiff) : bool
Parameters
$tickDiff : int
Return values
bool

onDispose()

Called when the entity is disposed to clean up things like viewers. This SHOULD NOT destroy internal state, because it may be needed by descendent classes.

protected onDispose() : void
Return values
void

onHitGround()

Called when a falling entity hits the ground.

protected onHitGround() : float|null
Return values
float|null

recalculateBoundingBox()

protected recalculateBoundingBox() : void
Return values
void

resetLastMovements()

protected resetLastMovements() : void
Return values
void

sendSpawnPacket()

Called by spawnTo() to send whatever packets needed to spawn the entity to the client.

protected sendSpawnPacket(Player $player) : void
Parameters
$player : Player
Return values
void

setPosition()

protected setPosition(Vector3 $pos) : bool
Parameters
$pos : Vector3
Return values
bool

setPositionAndRotation()

protected setPositionAndRotation(Vector3 $pos, float $yaw, float $pitch) : bool
Parameters
$pos : Vector3
$yaw : float
$pitch : float
Return values
bool

tryChangeMovement()

protected tryChangeMovement() : void
Return values
void

updateFallState()

protected updateFallState(float $distanceThisTick, bool $onGround) : float|null
Parameters
$distanceThisTick : float
$onGround : bool
Return values
float|null

updateMovement()

protected updateMovement([bool $teleport = false ]) : void
Parameters
$teleport : bool = false
Return values
void

Search results