PocketMine-MP 5.28.1 git-04de72e85ec8c8da36e1d527db3cbe4ee855a124
Loading...
Searching...
No Matches
pocketmine\entity\object\Painting Class Reference
+ Inheritance diagram for pocketmine\entity\object\Painting:
+ Collaboration diagram for pocketmine\entity\object\Painting:

Public Member Functions

 __construct (Location $location, Vector3 $blockIn, int $facing, PaintingMotive $motive, ?CompoundTag $nbt=null)
 
 __toString ()
 
 addMotion (float $x, float $y, float $z)
 
 attack (EntityDamageEvent $source)
 
 broadcastAnimation (Animation $animation, ?array $targets=null)
 
 broadcastSound (Sound $sound, ?array $targets=null)
 
 canBeCollidedWith ()
 
 canBeMovedByCurrents ()
 
 canBeRenamed ()
 
 canClimb ()
 
 canClimbWalls ()
 
 canCollideWith (Entity $entity)
 
 canSaveWithChunk ()
 
 close ()
 
 despawnFrom (Player $player, bool $send=true)
 
 despawnFromAll ()
 
 extinguish ()
 
 flagForDespawn ()
 
 getAttributeMap ()
 
 getBoundingBox ()
 
 getDirectionPlane ()
 
 getDirectionVector ()
 
 getEyeHeight ()
 
 getEyePos ()
 
 getFacing ()
 
 getFallDistance ()
 
 getFireTicks ()
 
 getGravity ()
 
 getHealth ()
 
 getHorizontalFacing ()
 
 getId ()
 
 getLastDamageCause ()
 
 getLocation ()
 
 getMaxHealth ()
 
 getMotion ()
 
 getMotive ()
 
 getNameTag ()
 
 getNetworkProperties ()
 
 getOffsetPosition (Vector3 $vector3)
 
 getOwningEntity ()
 
 getOwningEntityId ()
 
 getPickedItem ()
 
 getPosition ()
 
 getScale ()
 
 getScoreTag ()
 
 getSize ()
 
 getTargetEntity ()
 
 getTargetEntityId ()
 
 getViewers ()
 
 getWorld ()
 
 hasGravity ()
 
 hasMovementUpdate ()
 
 hasNoClientPredictions ()
 
 heal (EntityRegainHealthEvent $source)
 
 isAlive ()
 
 isClosed ()
 
 isFireProof ()
 
 isFlaggedForDespawn ()
 
 isInsideOfSolid ()
 
 isInvisible ()
 
 isNameTagAlwaysVisible ()
 
 isNameTagVisible ()
 
 isOnFire ()
 
 isOnGround ()
 
 isSilent ()
 
 isUnderwater ()
 
 kill ()
 
 onCollideWithPlayer (Player $player)
 
 onInteract (Player $player, Vector3 $clickPos)
 
 onNearbyBlockChange ()
 
 onRandomUpdate ()
 
 onUpdate (int $currentTick)
 
 resetFallDistance ()
 
 respawnToAll ()
 
 saveNBT ()
 
 scheduleUpdate ()
 
 sendData (?array $targets, ?array $data=null)
 
 setCanClimb (bool $value=true)
 
 setCanClimbWalls (bool $value=true)
 
 setCanSaveWithChunk (bool $value)
 
 setFallDistance (float $fallDistance)
 
 setFireTicks (int $fireTicks)
 
 setForceMovementUpdate (bool $value=true)
 
 setGravity (float $gravity)
 
 setHasGravity (bool $v=true)
 
 setHealth (float $amount)
 
 setInvisible (bool $value=true)
 
 setLastDamageCause (EntityDamageEvent $type)
 
 setMaxHealth (int $amount)
 
 setMotion (Vector3 $motion)
 
 setNameTag (string $name)
 
 setNameTagAlwaysVisible (bool $value=true)
 
 setNameTagVisible (bool $value=true)
 
 setNoClientPredictions (bool $value=true)
 
 setOnFire (int $seconds)
 
 setOwningEntity (?Entity $owner)
 
 setRotation (float $yaw, float $pitch)
 
 setScale (float $value)
 
 setScoreTag (string $score)
 
 setSilent (bool $value=true)
 
 setTargetEntity (?Entity $target)
 
 spawnTo (Player $player)
 
 spawnToAll ()
 
 teleport (Vector3 $pos, ?float $yaw=null, ?float $pitch=null)
 

Static Public Member Functions

static canFit (World $world, Vector3 $blockIn, int $facing, bool $checkOverlap, PaintingMotive $motive)
 
static getNetworkTypeId ()
 
static nextRuntimeId ()
 

Public Attributes

AxisAlignedBB $boundingBox
 
float $fallDistance = 0.0
 
bool $isCollided = false
 
bool $isCollidedHorizontally = false
 
bool $isCollidedVertically = false
 
bool $keepMovement = false
 
int $lastUpdate
 
int $noDamageTicks = 0
 
bool $onGround = false
 
EntitySizeInfo $size
 
int $ticksLived = 0
 
const DATA_TO_FACING
 
const MOTION_THRESHOLD = 0.00001
 
const TAG_DIRECTION_BE = "Direction"
 
const TAG_FACING_JE = "Facing"
 
const TAG_MOTION = "Motion"
 
const TAG_MOTIVE = "Motive"
 
const TAG_POS = "Pos"
 
const TAG_ROTATION = "Rotation"
 
const TAG_TILE_X = "TileX"
 
const TAG_TILE_Y = "TileY"
 
const TAG_TILE_Z = "TileZ"
 

Protected Member Functions

 addAttributes ()
 
 applyDragBeforeGravity ()
 
 broadcastMotion ()
 
 broadcastMovement (bool $teleport=false)
 
 checkBlockIntersections ()
 
 checkGroundState (float $wantedX, float $wantedY, float $wantedZ, float $dx, float $dy, float $dz)
 
 checkObstruction (float $x, float $y, float $z)
 
 dealFireDamage ()
 
 destroyCycles ()
 
 doOnFireTick (int $tickDiff=1)
 
 entityBaseTick (int $tickDiff=1)
 
 getAllNetworkData ()
 
 getBlocksAroundWithEntityInsideActions ()
 
 getBlocksIntersected (float $inset)
 
 getDirtyNetworkData ()
 
 getInitialDragMultiplier ()
 
 getInitialGravity ()
 
 getInitialSizeInfo ()
 
 initEntity (CompoundTag $nbt)
 
 move (float $dx, float $dy, float $dz)
 
 onDeath ()
 
 onDeathUpdate (int $tickDiff)
 
 onDispose ()
 
 onFirstUpdate (int $currentTick)
 
 onHitGround ()
 
 recalculateBoundingBox ()
 
 resetLastMovements ()
 
 sendSpawnPacket (Player $player)
 
 setPosition (Vector3 $pos)
 
 setPositionAndRotation (Vector3 $pos, float $yaw, float $pitch)
 
 setSize (EntitySizeInfo $size)
 
 syncNetworkData (EntityMetadataCollection $properties)
 
 tryChangeMovement ()
 
 updateFallState (float $distanceThisTick, bool $onGround)
 
 updateMovement (bool $teleport=false)
 

Protected Attributes

bool $alwaysShowNameTag = false
 
AttributeMap $attributeMap
 
Vector3 $blockIn
 
array $blocksAround = null
 
bool $canClimb = false
 
bool $canClimbWalls = false
 
bool $closed = false
 
float $drag
 
int $facing
 
int $fireTicks = 0
 
bool $forceMovementUpdate = false
 
float $gravity
 
bool $gravityEnabled = true
 
array $hasSpawned = []
 
int $id
 
bool $invisible = false
 
bool $justCreated = true
 
EntityDamageEvent $lastDamageCause = null
 
Location $lastLocation
 
Vector3 $lastMotion
 
Location $location
 
Vector3 $motion
 
PaintingMotive $motive
 
string $nameTag = ""
 
bool $nameTagVisible = true
 
bool $networkPropertiesDirty = false
 
bool $noClientPredictions = false
 
int $ownerId = null
 
float $scale = 1.0
 
string $scoreTag = ""
 
Server $server
 
bool $silent = false
 
float $stepHeight = 0.0
 
int $targetId = null
 
TimingsHandler $timings
 
float $ySize = 0.0
 
const STEP_CLIP_MULTIPLIER = 0.4
 

Detailed Description

Definition at line 44 of file Painting.php.

Constructor & Destructor Documentation

◆ __construct()

pocketmine\entity\object\Painting::__construct ( Location $location,
Vector3 $blockIn,
int $facing,
PaintingMotive $motive,
?CompoundTag $nbt = null )

Definition at line 71 of file Painting.php.

Member Function Documentation

◆ __toString()

pocketmine\entity\Entity::__toString ( )
inherited

Definition at line 1725 of file Entity.php.

◆ addAttributes()

pocketmine\entity\Entity::addAttributes ( )
protectedinherited

Definition at line 531 of file Entity.php.

◆ addMotion()

pocketmine\entity\Entity::addMotion ( float $x,
float $y,
float $z )
inherited

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

Definition at line 1436 of file Entity.php.

Referenced by pocketmine\entity\effect\LevitationEffect\applyEffect().

+ Here is the caller graph for this function:

◆ applyDragBeforeGravity()

pocketmine\entity\Entity::applyDragBeforeGravity ( )
protectedinherited

Definition at line 836 of file Entity.php.

◆ attack()

pocketmine\entity\Entity::attack ( EntityDamageEvent $source)
inherited

Definition at line 535 of file Entity.php.

◆ broadcastAnimation()

pocketmine\entity\Entity::broadcastAnimation ( Animation $animation,
?array $targets = null )
inherited
Parameters
Player[] | null$targets

Reimplemented in pocketmine\player\Player.

Definition at line 1707 of file Entity.php.

◆ broadcastMotion()

pocketmine\entity\Entity::broadcastMotion ( )
protectedinherited

Definition at line 815 of file Entity.php.

◆ broadcastMovement()

pocketmine\entity\Entity::broadcastMovement ( bool $teleport = false)
protectedinherited

Definition at line 797 of file Entity.php.

◆ broadcastSound()

pocketmine\entity\Entity::broadcastSound ( Sound $sound,
?array $targets = null )
inherited

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

Parameters
Player[] | null$targets

Reimplemented in pocketmine\player\Player.

Definition at line 1715 of file Entity.php.

◆ canBeCollidedWith()

pocketmine\entity\object\Painting::canBeCollidedWith ( )

Reimplemented from pocketmine\entity\Entity.

Definition at line 151 of file Painting.php.

◆ canBeMovedByCurrents()

pocketmine\entity\Entity::canBeMovedByCurrents ( )
inherited

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

Reimplemented in pocketmine\entity\object\FallingBlock, and pocketmine\player\Player.

Definition at line 1317 of file Entity.php.

◆ canBeRenamed()

pocketmine\entity\Entity::canBeRenamed ( )
inherited

Returns whether players can rename this entity using a name tag. Note that plugins can still name entities using setNameTag().

Reimplemented in pocketmine\entity\Living, and pocketmine\player\Player.

Definition at line 265 of file Entity.php.

◆ canClimb()

pocketmine\entity\Entity::canClimb ( )
inherited

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

Definition at line 374 of file Entity.php.

◆ canClimbWalls()

pocketmine\entity\Entity::canClimbWalls ( )
inherited

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.

Definition at line 389 of file Entity.php.

◆ canCollideWith()

pocketmine\entity\Entity::canCollideWith ( Entity $entity)
inherited

Definition at line 759 of file Entity.php.

◆ canFit()

static pocketmine\entity\object\Painting::canFit ( World $world,
Vector3 $blockIn,
int $facing,
bool $checkOverlap,
PaintingMotive $motive )
static

Returns whether a painting with the specified motive can be placed at the given position.

Definition at line 205 of file Painting.php.

◆ canSaveWithChunk()

pocketmine\entity\Entity::canSaveWithChunk ( )
inherited

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

Reimplemented in pocketmine\entity\object\ItemEntity, and pocketmine\player\Player.

Definition at line 465 of file Entity.php.

◆ checkBlockIntersections()

pocketmine\entity\Entity::checkBlockIntersections ( )
protectedinherited

Definition at line 1321 of file Entity.php.

◆ checkGroundState()

pocketmine\entity\Entity::checkGroundState ( float $wantedX,
float $wantedY,
float $wantedZ,
float $dx,
float $dy,
float $dz )
protectedinherited

Definition at line 1265 of file Entity.php.

◆ checkObstruction()

pocketmine\entity\Entity::checkObstruction ( float $x,
float $y,
float $z )
protectedinherited

Definition at line 864 of file Entity.php.

◆ close()

pocketmine\entity\Entity::close ( )
finalinherited

Closes the entity and frees attached references.

WARNING: Entities are unusable after this has been executed!

Definition at line 1607 of file Entity.php.

◆ dealFireDamage()

pocketmine\entity\Entity::dealFireDamage ( )
protectedinherited

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

Definition at line 754 of file Entity.php.

◆ despawnFrom()

pocketmine\entity\Entity::despawnFrom ( Player $player,
bool $send = true )
inherited
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.

Definition at line 1554 of file Entity.php.

◆ despawnFromAll()

pocketmine\entity\Entity::despawnFromAll ( )
inherited
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.

Definition at line 1568 of file Entity.php.

◆ destroyCycles()

pocketmine\entity\Entity::destroyCycles ( )
protectedinherited

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.

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

Reimplemented in pocketmine\entity\Human, pocketmine\entity\Living, and pocketmine\player\Player.

Definition at line 1640 of file Entity.php.

◆ doOnFireTick()

pocketmine\entity\Entity::doOnFireTick ( int $tickDiff = 1)
protectedinherited

Definition at line 730 of file Entity.php.

◆ entityBaseTick()

pocketmine\entity\Entity::entityBaseTick ( int $tickDiff = 1)
protectedinherited

Definition at line 640 of file Entity.php.

◆ extinguish()

pocketmine\entity\Entity::extinguish ( )
inherited

Definition at line 721 of file Entity.php.

◆ flagForDespawn()

pocketmine\entity\Entity::flagForDespawn ( )
inherited

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

Definition at line 1586 of file Entity.php.

◆ getAllNetworkData()

pocketmine\entity\Entity::getAllNetworkData ( )
finalprotectedinherited
Returns
MetadataProperty[] @phpstan-return array<int, MetadataProperty>

Definition at line 1673 of file Entity.php.

◆ getAttributeMap()

pocketmine\entity\Entity::getAttributeMap ( )
inherited

Definition at line 632 of file Entity.php.

◆ getBlocksAroundWithEntityInsideActions()

pocketmine\entity\Entity::getBlocksAroundWithEntityInsideActions ( )
protectedinherited
Returns
Block[]

Definition at line 1299 of file Entity.php.

◆ getBlocksIntersected()

pocketmine\entity\Entity::getBlocksIntersected ( float $inset)
protectedinherited

Yields all the blocks whose full-cube areas are intersected by the entity's AABB.

@phpstan-return \Generator<int, Block, void, void>

Definition at line 1277 of file Entity.php.

◆ getBoundingBox()

pocketmine\entity\Entity::getBoundingBox ( )
inherited

Definition at line 305 of file Entity.php.

◆ getDirectionPlane()

pocketmine\entity\Entity::getDirectionPlane ( )
inherited

Definition at line 966 of file Entity.php.

◆ getDirectionVector()

pocketmine\entity\Entity::getDirectionVector ( )
inherited

Definition at line 957 of file Entity.php.

◆ getDirtyNetworkData()

pocketmine\entity\Entity::getDirtyNetworkData ( )
finalprotectedinherited
Returns
MetadataProperty[] @phpstan-return array<int, MetadataProperty>

Definition at line 1661 of file Entity.php.

◆ getEyeHeight()

pocketmine\entity\Entity::getEyeHeight ( )
inherited

Definition at line 1113 of file Entity.php.

◆ getEyePos()

pocketmine\entity\Entity::getEyePos ( )
inherited

Definition at line 1117 of file Entity.php.

◆ getFacing()

pocketmine\entity\object\Painting::getFacing ( )

Definition at line 180 of file Painting.php.

◆ getFallDistance()

pocketmine\entity\Entity::getFallDistance ( )
inherited

Definition at line 1078 of file Entity.php.

◆ getFireTicks()

pocketmine\entity\Entity::getFireTicks ( )
inherited

Definition at line 697 of file Entity.php.

◆ getGravity()

pocketmine\entity\Entity::getGravity ( )
inherited

Definition at line 819 of file Entity.php.

◆ getHealth()

pocketmine\entity\Entity::getHealth ( )
inherited

Definition at line 589 of file Entity.php.

◆ getHorizontalFacing()

pocketmine\entity\Entity::getHorizontalFacing ( )
inherited

Definition at line 938 of file Entity.php.

◆ getId()

pocketmine\entity\Entity::getId ( )
inherited

Definition at line 1486 of file Entity.php.

◆ getInitialDragMultiplier()

pocketmine\entity\object\Painting::getInitialDragMultiplier ( )
protected

Returns the percentage by which the entity's velocity is reduced per tick when moving through air. The entity's velocity is multiplied by 1 minus this value.

Returns
float 0-1

Reimplemented from pocketmine\entity\Entity.

Definition at line 83 of file Painting.php.

◆ getInitialGravity()

pocketmine\entity\object\Painting::getInitialGravity ( )
protected

Returns the downwards acceleration of the entity when falling, in blocks/tick².

Returns
float minimum 0

Reimplemented from pocketmine\entity\Entity.

Definition at line 85 of file Painting.php.

◆ getInitialSizeInfo()

pocketmine\entity\object\Painting::getInitialSizeInfo ( )
protected

Reimplemented from pocketmine\entity\Entity.

Definition at line 78 of file Painting.php.

◆ getLastDamageCause()

pocketmine\entity\Entity::getLastDamageCause ( )
inherited

Definition at line 628 of file Entity.php.

◆ getLocation()

pocketmine\entity\Entity::getLocation ( )
inherited

Definition at line 1347 of file Entity.php.

◆ getMaxHealth()

pocketmine\entity\Entity::getMaxHealth ( )
inherited

Definition at line 616 of file Entity.php.

◆ getMotion()

pocketmine\entity\Entity::getMotion ( )
inherited

Definition at line 1410 of file Entity.php.

◆ getMotive()

pocketmine\entity\object\Painting::getMotive ( )

Returns the painting motive (which image is displayed on the painting)

Definition at line 176 of file Painting.php.

◆ getNameTag()

pocketmine\entity\Entity::getNameTag ( )
inherited

Definition at line 249 of file Entity.php.

◆ getNetworkProperties()

pocketmine\entity\Entity::getNetworkProperties ( )
inherited

Definition at line 636 of file Entity.php.

◆ getNetworkTypeId()

static pocketmine\entity\object\Painting::getNetworkTypeId ( )
static

Reimplemented from pocketmine\entity\Entity.

Definition at line 52 of file Painting.php.

◆ getOffsetPosition()

pocketmine\entity\Entity::getOffsetPosition ( Vector3 $vector3)
inherited

Definition at line 793 of file Entity.php.

◆ getOwningEntity()

pocketmine\entity\Entity::getOwningEntity ( )
inherited

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

Definition at line 411 of file Entity.php.

References pocketmine\server().

+ Here is the call graph for this function:

◆ getOwningEntityId()

pocketmine\entity\Entity::getOwningEntityId ( )
inherited

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

Definition at line 404 of file Entity.php.

◆ getPickedItem()

pocketmine\entity\object\Painting::getPickedItem ( )

Returns the item that players will equip when middle-clicking on this entity.

Reimplemented from pocketmine\entity\Entity.

Definition at line 169 of file Painting.php.

◆ getPosition()

pocketmine\entity\Entity::getPosition ( )
inherited

Definition at line 1343 of file Entity.php.

◆ getScale()

pocketmine\entity\Entity::getScale ( )
inherited

Definition at line 293 of file Entity.php.

◆ getScoreTag()

pocketmine\entity\Entity::getScoreTag ( )
inherited

Definition at line 284 of file Entity.php.

◆ getSize()

pocketmine\entity\Entity::getSize ( )
inherited

Definition at line 322 of file Entity.php.

◆ getTargetEntity()

pocketmine\entity\Entity::getTargetEntity ( )
inherited

Returns the entity's target entity, or null if not found. This is used for things like hostile mobs attacking entities, and for fishing rods reeling hit entities in.

Definition at line 442 of file Entity.php.

References pocketmine\server().

+ Here is the call graph for this function:

◆ getTargetEntityId()

pocketmine\entity\Entity::getTargetEntityId ( )
inherited

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

Definition at line 434 of file Entity.php.

◆ getViewers()

pocketmine\entity\Entity::getViewers ( )
inherited
Returns
Player[]

Definition at line 1493 of file Entity.php.

◆ getWorld()

pocketmine\entity\Entity::getWorld ( )
inherited

Definition at line 1351 of file Entity.php.

◆ hasGravity()

pocketmine\entity\Entity::hasGravity ( )
inherited

Definition at line 828 of file Entity.php.

◆ hasMovementUpdate()

pocketmine\entity\object\Painting::hasMovementUpdate ( )

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

Reimplemented from pocketmine\entity\Entity.

Definition at line 143 of file Painting.php.

◆ hasNoClientPredictions()

pocketmine\entity\Entity::hasNoClientPredictions ( )
inherited

Returns whether clients may predict this entity's behaviour and movement. Used for things like water movement, burning, and movement smoothing (interpolation).

Definition at line 336 of file Entity.php.

◆ heal()

pocketmine\entity\Entity::heal ( EntityRegainHealthEvent $source)
inherited

Definition at line 554 of file Entity.php.

◆ initEntity()

pocketmine\entity\object\Painting::initEntity ( CompoundTag $nbt)
protected

Reimplemented from pocketmine\entity\Entity.

Definition at line 87 of file Painting.php.

◆ isAlive()

pocketmine\entity\Entity::isAlive ( )
inherited

Definition at line 585 of file Entity.php.

◆ isClosed()

pocketmine\entity\Entity::isClosed ( )
inherited

Returns whether the entity has been "closed".

Definition at line 1598 of file Entity.php.

◆ isFireProof()

pocketmine\entity\Entity::isFireProof ( )
inherited

Definition at line 726 of file Entity.php.

◆ isFlaggedForDespawn()

pocketmine\entity\Entity::isFlaggedForDespawn ( )
inherited

Definition at line 1591 of file Entity.php.

◆ isInsideOfSolid()

pocketmine\entity\Entity::isInsideOfSolid ( )
inherited

Definition at line 1143 of file Entity.php.

◆ isInvisible()

pocketmine\entity\Entity::isInvisible ( )
inherited

Definition at line 353 of file Entity.php.

◆ isNameTagAlwaysVisible()

pocketmine\entity\Entity::isNameTagAlwaysVisible ( )
inherited

Definition at line 257 of file Entity.php.

◆ isNameTagVisible()

pocketmine\entity\Entity::isNameTagVisible ( )
inherited

Definition at line 253 of file Entity.php.

◆ isOnFire()

pocketmine\entity\Entity::isOnFire ( )
inherited

Definition at line 685 of file Entity.php.

◆ isOnGround()

pocketmine\entity\Entity::isOnGround ( )
inherited

Definition at line 1443 of file Entity.php.

◆ isSilent()

pocketmine\entity\Entity::isSilent ( )
inherited

Definition at line 362 of file Entity.php.

◆ isUnderwater()

pocketmine\entity\Entity::isUnderwater ( )
inherited

Definition at line 1132 of file Entity.php.

◆ kill()

pocketmine\entity\Entity::kill ( )
inherited

Definition at line 563 of file Entity.php.

◆ move()

pocketmine\entity\Entity::move ( float $dx,
float $dy,
float $dz )
protectedinherited

Definition at line 1149 of file Entity.php.

◆ nextRuntimeId()

static pocketmine\entity\Entity::nextRuntimeId ( )
staticinherited

Returns a new runtime entity ID for a new entity.

Definition at line 104 of file Entity.php.

◆ onCollideWithPlayer()

pocketmine\entity\Entity::onCollideWithPlayer ( Player $player)
inherited

Definition at line 1121 of file Entity.php.

◆ onDeath()

pocketmine\entity\object\Painting::onDeath ( )
protected

Override this to do actions on death.

Reimplemented from pocketmine\entity\Entity.

Definition at line 107 of file Painting.php.

References pocketmine\player\Player\hasFiniteResources().

+ Here is the call graph for this function:

◆ onDeathUpdate()

pocketmine\entity\Entity::onDeathUpdate ( int $tickDiff)
protectedinherited

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

Reimplemented in pocketmine\entity\Living, and pocketmine\player\Player.

Definition at line 581 of file Entity.php.

◆ onDispose()

pocketmine\entity\Entity::onDispose ( )
protectedinherited

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.

Reimplemented in pocketmine\entity\Human, pocketmine\entity\Living, and pocketmine\player\Player.

Definition at line 1627 of file Entity.php.

◆ onFirstUpdate()

pocketmine\entity\Entity::onFirstUpdate ( int $currentTick)
protectedinherited

Called from onUpdate() on the first tick of a new entity. This is called before any movement processing or main ticking logic. Use this to fire any events related to spawning the entity.

Reimplemented in pocketmine\entity\object\ItemEntity.

Definition at line 974 of file Entity.php.

◆ onHitGround()

pocketmine\entity\Entity::onHitGround ( )
protectedinherited

Called when a falling entity hits the ground.

Reimplemented in pocketmine\entity\Living, and pocketmine\entity\object\FallingBlock.

Definition at line 1109 of file Entity.php.

◆ onInteract()

pocketmine\entity\Entity::onInteract ( Player $player,
Vector3 $clickPos )
inherited

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

Definition at line 1128 of file Entity.php.

◆ onNearbyBlockChange()

pocketmine\entity\object\Painting::onNearbyBlockChange ( )

Reimplemented from pocketmine\entity\Entity.

Definition at line 131 of file Painting.php.

◆ onRandomUpdate()

pocketmine\entity\object\Painting::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).

Reimplemented from pocketmine\entity\Entity.

Definition at line 139 of file Painting.php.

◆ onUpdate()

pocketmine\entity\Entity::onUpdate ( int $currentTick)
inherited

Definition at line 978 of file Entity.php.

◆ recalculateBoundingBox()

pocketmine\entity\object\Painting::recalculateBoundingBox ( )
protected

Reimplemented from pocketmine\entity\Entity.

Definition at line 126 of file Painting.php.

◆ resetFallDistance()

pocketmine\entity\Entity::resetFallDistance ( )
inherited

Definition at line 1084 of file Entity.php.

◆ resetLastMovements()

pocketmine\entity\Entity::resetLastMovements ( )
protectedinherited

Definition at line 1405 of file Entity.php.

◆ respawnToAll()

pocketmine\entity\Entity::respawnToAll ( )
inherited

Definition at line 1543 of file Entity.php.

◆ saveNBT()

pocketmine\entity\object\Painting::saveNBT ( )

Reimplemented from pocketmine\entity\Entity.

Definition at line 93 of file Painting.php.

◆ scheduleUpdate()

pocketmine\entity\Entity::scheduleUpdate ( )
finalinherited

Definition at line 1035 of file Entity.php.

◆ sendData()

pocketmine\entity\Entity::sendData ( ?array $targets,
?array $data = null )
inherited
Parameters
Player[] | null$targets
MetadataProperty[]$dataProperly formatted entity data, defaults to everything

@phpstan-param array<int, MetadataProperty> $data

Reimplemented in pocketmine\player\Player.

Definition at line 1650 of file Entity.php.

◆ sendSpawnPacket()

pocketmine\entity\object\Painting::sendSpawnPacket ( Player $player)
protected

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

Reimplemented from pocketmine\entity\Entity.

Definition at line 155 of file Painting.php.

◆ setCanClimb()

pocketmine\entity\Entity::setCanClimb ( bool $value = true)
inherited

Sets whether the entity is able to climb climbable blocks.

Definition at line 381 of file Entity.php.

◆ setCanClimbWalls()

pocketmine\entity\Entity::setCanClimbWalls ( bool $value = true)
inherited

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

Definition at line 396 of file Entity.php.

◆ setCanSaveWithChunk()

pocketmine\entity\Entity::setCanSaveWithChunk ( bool $value)
inherited

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

Reimplemented in pocketmine\player\Player.

Definition at line 473 of file Entity.php.

◆ setFallDistance()

pocketmine\entity\Entity::setFallDistance ( float $fallDistance)
inherited

Definition at line 1080 of file Entity.php.

◆ setFireTicks()

pocketmine\entity\Entity::setFireTicks ( int $fireTicks)
inherited
Exceptions

InvalidArgumentException

Definition at line 704 of file Entity.php.

◆ setForceMovementUpdate()

pocketmine\entity\Entity::setForceMovementUpdate ( bool $value = true)
finalinherited

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.

Definition at line 1059 of file Entity.php.

◆ setGravity()

pocketmine\entity\Entity::setGravity ( float $gravity)
inherited

Definition at line 823 of file Entity.php.

◆ setHasGravity()

pocketmine\entity\Entity::setHasGravity ( bool $v = true)
inherited

Definition at line 832 of file Entity.php.

◆ setHealth()

pocketmine\entity\Entity::setHealth ( float $amount)
inherited

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

Reimplemented in pocketmine\entity\Living.

Definition at line 596 of file Entity.php.

◆ setInvisible()

pocketmine\entity\Entity::setInvisible ( bool $value = true)
inherited

Definition at line 357 of file Entity.php.

◆ setLastDamageCause()

pocketmine\entity\Entity::setLastDamageCause ( EntityDamageEvent $type)
inherited

Definition at line 624 of file Entity.php.

◆ setMaxHealth()

pocketmine\entity\Entity::setMaxHealth ( int $amount)
inherited

Definition at line 620 of file Entity.php.

◆ setMotion()

pocketmine\entity\Entity::setMotion ( Vector3 $motion)
inherited

Definition at line 1414 of file Entity.php.

◆ setNameTag()

pocketmine\entity\Entity::setNameTag ( string $name)
inherited

Definition at line 269 of file Entity.php.

◆ setNameTagAlwaysVisible()

pocketmine\entity\Entity::setNameTagAlwaysVisible ( bool $value = true)
inherited

Definition at line 279 of file Entity.php.

◆ setNameTagVisible()

pocketmine\entity\Entity::setNameTagVisible ( bool $value = true)
inherited

Definition at line 274 of file Entity.php.

◆ setNoClientPredictions()

pocketmine\entity\Entity::setNoClientPredictions ( bool $value = true)
inherited

Things such as movement in water, burning, etc. may be predicted by the client. This is sometimes not desirable, since server-side logic may differ from client-side prediction. However, things like movement smoothing (interpolation) are also controlled by this, so it should be used with care.

Setting this flag will also disable player movement inputs, but this should not be relied on, as cheat clients will be able to bypass it.

Definition at line 348 of file Entity.php.

◆ setOnFire()

pocketmine\entity\Entity::setOnFire ( int $seconds)
inherited

Definition at line 689 of file Entity.php.

◆ setOwningEntity()

pocketmine\entity\Entity::setOwningEntity ( ?Entity $owner)
inherited

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

Exceptions

InvalidArgumentException if the supplied entity is not valid

Definition at line 420 of file Entity.php.

◆ setPosition()

pocketmine\entity\Entity::setPosition ( Vector3 $pos)
protectedinherited

Definition at line 1355 of file Entity.php.

◆ setPositionAndRotation()

pocketmine\entity\Entity::setPositionAndRotation ( Vector3 $pos,
float $yaw,
float $pitch )
protectedinherited

Definition at line 1395 of file Entity.php.

◆ setRotation()

pocketmine\entity\Entity::setRotation ( float $yaw,
float $pitch )
inherited

Definition at line 1387 of file Entity.php.

◆ setScale()

pocketmine\entity\Entity::setScale ( float $value)
inherited

Definition at line 297 of file Entity.php.

◆ setScoreTag()

pocketmine\entity\Entity::setScoreTag ( string $score)
inherited

Definition at line 288 of file Entity.php.

◆ setSilent()

pocketmine\entity\Entity::setSilent ( bool $value = true)
inherited

Definition at line 366 of file Entity.php.

◆ setSize()

pocketmine\entity\Entity::setSize ( EntitySizeInfo $size)
protectedinherited

Definition at line 326 of file Entity.php.

◆ setTargetEntity()

pocketmine\entity\Entity::setTargetEntity ( ?Entity $target)
inherited

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

Exceptions

InvalidArgumentException if the target entity is not valid

Definition at line 451 of file Entity.php.

◆ spawnTo()

pocketmine\entity\Entity::spawnTo ( Player $player)
inherited

Definition at line 1522 of file Entity.php.

◆ spawnToAll()

pocketmine\entity\Entity::spawnToAll ( )
inherited

Definition at line 1534 of file Entity.php.

◆ syncNetworkData()

pocketmine\entity\Entity::syncNetworkData ( EntityMetadataCollection $properties)
protectedinherited

Definition at line 1681 of file Entity.php.

◆ teleport()

pocketmine\entity\Entity::teleport ( Vector3 $pos,
?float $yaw = null,
?float $pitch = null )
inherited
Parameters
Vector3 | Position | Location$pos

Reimplemented in pocketmine\player\Player.

Definition at line 1450 of file Entity.php.

Referenced by pocketmine\item\ChorusFruit\onConsume().

+ Here is the caller graph for this function:

◆ tryChangeMovement()

pocketmine\entity\Entity::tryChangeMovement ( )
protectedinherited

Definition at line 840 of file Entity.php.

◆ updateFallState()

pocketmine\entity\Entity::updateFallState ( float $distanceThisTick,
bool $onGround )
protectedinherited

Definition at line 1088 of file Entity.php.

◆ updateMovement()

pocketmine\entity\object\Painting::updateMovement ( bool $teleport = false)
protected

Reimplemented from pocketmine\entity\Entity.

Definition at line 147 of file Painting.php.

Member Data Documentation

◆ $alwaysShowNameTag

bool pocketmine\entity\Entity::$alwaysShowNameTag = false
protectedinherited

Definition at line 174 of file Entity.php.

◆ $attributeMap

AttributeMap pocketmine\entity\Entity::$attributeMap
protectedinherited

Definition at line 156 of file Entity.php.

◆ $blockIn

Vector3 pocketmine\entity\object\Painting::$blockIn
protected

Definition at line 67 of file Painting.php.

◆ $blocksAround

array pocketmine\entity\Entity::$blocksAround = null
protectedinherited

Definition at line 121 of file Entity.php.

◆ $boundingBox

AxisAlignedBB pocketmine\entity\Entity::$boundingBox
inherited

Definition at line 130 of file Entity.php.

◆ $canClimb

bool pocketmine\entity\Entity::$canClimb = false
protectedinherited

Definition at line 178 of file Entity.php.

◆ $canClimbWalls

bool pocketmine\entity\Entity::$canClimbWalls = false
protectedinherited

Definition at line 179 of file Entity.php.

◆ $closed

bool pocketmine\entity\Entity::$closed = false
protectedinherited

Definition at line 164 of file Entity.php.

◆ $drag

float pocketmine\entity\Entity::$drag
protectedinherited

Definition at line 159 of file Entity.php.

◆ $facing

int pocketmine\entity\object\Painting::$facing
protected

Definition at line 68 of file Painting.php.

◆ $fallDistance

float pocketmine\entity\Entity::$fallDistance = 0.0
inherited

Definition at line 142 of file Entity.php.

◆ $fireTicks

int pocketmine\entity\Entity::$fireTicks = 0
protectedinherited

Definition at line 145 of file Entity.php.

◆ $forceMovementUpdate

bool pocketmine\entity\Entity::$forceMovementUpdate = false
protectedinherited

Definition at line 127 of file Entity.php.

◆ $gravity

float pocketmine\entity\Entity::$gravity
protectedinherited

Definition at line 158 of file Entity.php.

◆ $gravityEnabled

bool pocketmine\entity\Entity::$gravityEnabled = true
protectedinherited

Definition at line 160 of file Entity.php.

◆ $hasSpawned

array pocketmine\entity\Entity::$hasSpawned = []
protectedinherited

Definition at line 112 of file Entity.php.

◆ $id

int pocketmine\entity\Entity::$id
protectedinherited

Definition at line 114 of file Entity.php.

◆ $invisible

bool pocketmine\entity\Entity::$invisible = false
protectedinherited

Definition at line 181 of file Entity.php.

◆ $isCollided

bool pocketmine\entity\Entity::$isCollided = false
inherited

Definition at line 149 of file Entity.php.

◆ $isCollidedHorizontally

bool pocketmine\entity\Entity::$isCollidedHorizontally = false
inherited

Definition at line 150 of file Entity.php.

◆ $isCollidedVertically

bool pocketmine\entity\Entity::$isCollidedVertically = false
inherited

Definition at line 151 of file Entity.php.

◆ $justCreated

bool pocketmine\entity\Entity::$justCreated = true
protectedinherited

Definition at line 154 of file Entity.php.

◆ $keepMovement

bool pocketmine\entity\Entity::$keepMovement = false
inherited

Definition at line 140 of file Entity.php.

◆ $lastDamageCause

EntityDamageEvent pocketmine\entity\Entity::$lastDamageCause = null
protectedinherited

Definition at line 118 of file Entity.php.

◆ $lastLocation

Location pocketmine\entity\Entity::$lastLocation
protectedinherited

Definition at line 124 of file Entity.php.

◆ $lastMotion

Vector3 pocketmine\entity\Entity::$lastMotion
protectedinherited

Definition at line 126 of file Entity.php.

◆ $lastUpdate

int pocketmine\entity\Entity::$lastUpdate
inherited

Definition at line 144 of file Entity.php.

◆ $location

Location pocketmine\entity\Entity::$location
protectedinherited

Definition at line 123 of file Entity.php.

◆ $motion

Vector3 pocketmine\entity\Entity::$motion
protectedinherited

Definition at line 125 of file Entity.php.

◆ $motive

PaintingMotive pocketmine\entity\object\Painting::$motive
protected

Definition at line 69 of file Painting.php.

◆ $nameTag

string pocketmine\entity\Entity::$nameTag = ""
protectedinherited

Definition at line 172 of file Entity.php.

◆ $nameTagVisible

bool pocketmine\entity\Entity::$nameTagVisible = true
protectedinherited

Definition at line 173 of file Entity.php.

◆ $networkPropertiesDirty

bool pocketmine\entity\Entity::$networkPropertiesDirty = false
protectedinherited

Definition at line 170 of file Entity.php.

◆ $noClientPredictions

bool pocketmine\entity\Entity::$noClientPredictions = false
protectedinherited

Definition at line 180 of file Entity.php.

◆ $noDamageTicks

int pocketmine\entity\Entity::$noDamageTicks = 0
inherited

Definition at line 153 of file Entity.php.

◆ $onGround

bool pocketmine\entity\Entity::$onGround = false
inherited

Definition at line 131 of file Entity.php.

◆ $ownerId

int pocketmine\entity\Entity::$ownerId = null
protectedinherited

Definition at line 184 of file Entity.php.

◆ $scale

float pocketmine\entity\Entity::$scale = 1.0
protectedinherited

Definition at line 176 of file Entity.php.

◆ $scoreTag

string pocketmine\entity\Entity::$scoreTag = ""
protectedinherited

Definition at line 175 of file Entity.php.

◆ $server

Server pocketmine\entity\Entity::$server
protectedinherited

Definition at line 162 of file Entity.php.

◆ $silent

bool pocketmine\entity\Entity::$silent = false
protectedinherited

Definition at line 182 of file Entity.php.

◆ $size

EntitySizeInfo pocketmine\entity\Entity::$size
inherited

Definition at line 133 of file Entity.php.

◆ $stepHeight

float pocketmine\entity\Entity::$stepHeight = 0.0
protectedinherited

Definition at line 139 of file Entity.php.

◆ $targetId

int pocketmine\entity\Entity::$targetId = null
protectedinherited

Definition at line 185 of file Entity.php.

◆ $ticksLived

int pocketmine\entity\Entity::$ticksLived = 0
inherited

Definition at line 143 of file Entity.php.

◆ $timings

TimingsHandler pocketmine\entity\Entity::$timings
protectedinherited

Definition at line 168 of file Entity.php.

◆ $ySize

float pocketmine\entity\Entity::$ySize = 0.0
protectedinherited

Definition at line 138 of file Entity.php.

◆ DATA_TO_FACING

const pocketmine\entity\object\Painting::DATA_TO_FACING
Initial value:
= [
0 => Facing::SOUTH,
1 => Facing::WEST,
2 => Facing::NORTH,
3 => Facing::EAST
]

Definition at line 54 of file Painting.php.

◆ MOTION_THRESHOLD

const pocketmine\entity\Entity::MOTION_THRESHOLD = 0.00001
inherited

Definition at line 87 of file Entity.php.

◆ STEP_CLIP_MULTIPLIER

const pocketmine\entity\Entity::STEP_CLIP_MULTIPLIER = 0.4
protectedinherited

Definition at line 88 of file Entity.php.

◆ TAG_DIRECTION_BE

const pocketmine\entity\object\Painting::TAG_DIRECTION_BE = "Direction"

Definition at line 49 of file Painting.php.

◆ TAG_FACING_JE

const pocketmine\entity\object\Painting::TAG_FACING_JE = "Facing"

Definition at line 48 of file Painting.php.

◆ TAG_MOTION

const pocketmine\entity\Entity::TAG_MOTION = "Motion"
inherited

Definition at line 96 of file Entity.php.

◆ TAG_MOTIVE

const pocketmine\entity\object\Painting::TAG_MOTIVE = "Motive"

Definition at line 50 of file Painting.php.

◆ TAG_POS

const pocketmine\entity\Entity::TAG_POS = "Pos"
inherited

Definition at line 95 of file Entity.php.

◆ TAG_ROTATION

const pocketmine\entity\Entity::TAG_ROTATION = "Rotation"
inherited

Definition at line 97 of file Entity.php.

◆ TAG_TILE_X

const pocketmine\entity\object\Painting::TAG_TILE_X = "TileX"

Definition at line 45 of file Painting.php.

◆ TAG_TILE_Y

const pocketmine\entity\object\Painting::TAG_TILE_Y = "TileY"

Definition at line 46 of file Painting.php.

◆ TAG_TILE_Z

const pocketmine\entity\object\Painting::TAG_TILE_Z = "TileZ"

Definition at line 47 of file Painting.php.


The documentation for this class was generated from the following file: