PHP Class pocketmine\entity\Entity

Inheritance: extends pocketmine\level\Location, implements pocketmine\metadata\Metadatable
Show file Open project: iTXTech/Genisys Class Usage Examples

Public Properties

Property Type Description
$boundingBox pocketmine\math\AxisAlignedBB
$canCollide
$chunk pocketmine\level\format\Chunk
$closed
$deadTicks
$dropExp
$entityCount
$eyeHeight
$fallDistance
$fireTicks
$height
$inBlock
$isCollided
$isCollidedHorizontally
$isCollidedVertically
$keepMovement
$lastMotionX
$lastMotionY
$lastMotionZ
$lastPitch
$lastUpdate
$lastX
$lastY
$lastYaw
$lastZ
$length
$maxFireTicks
$motionChanged
$motionX
$motionY
$motionZ
$namedtag
$noDamageTicks
$onGround
$passenger
$positionChanged
$temporalVector pocketmine\math\Vector3
$ticksLived
$vehicle
$width

Protected Properties

Property Type Description
$activatedPressurePlates pocketmine\block\PressurePlate
$age
$attributeMap AttributeMap
$dataFlags
$dataProperties
$drag
$effects Effect[]
$fireProof
$gravity
$hasSpawned pocketmine\Player[]
$id
$isPlayer
$isStatic
$justCreated
$lastDamageCause
$linkedEntity Entity
$linkedType 0 no linked 1 linked other 2 be linked
$riding
$server pocketmine\Server
$stepHeight
$timings pocketmine\event\TimingsHandler
$ySize

Public Methods

Method Description
__construct ( pocketmine\level\format\FullChunk $chunk, CompoundTag $nbt )
__destruct ( )
__toString ( )
addEffect ( Effect $effect )
addMovement ( $x, $y, $z, $yaw, $pitch, $headYaw = null )
attack ( float $damage, EntityDamageEvent $source ) : boolean
canCollideWith ( Entity $entity )
canTriggerWalking ( )
close ( )
createEntity ( integer | string $type, pocketmine\level\format\FullChunk $chunk, CompoundTag $nbt, $args ) : Entity | Projectile
despawnFrom ( Player $player )
despawnFromAll ( )
entityBaseTick ( $tickDiff = 1 )
extinguish ( )
fall ( $fallDistance )
fastMove ( $dx, $dy, $dz )
getAttributeMap ( )
getBlocksAround ( )
getBoundingBox ( )
getDataFlag ( integer $propertyId, integer $id ) : boolean
getDataProperty ( integer $id ) : mixed
getDataPropertyType ( integer $id ) : integer
getDirection ( )
getDirectionPlane ( )
getDirectionVector ( ) : Vector3
getDropExpMax ( ) : integer
getDropExpMin ( ) : integer
getEffect ( $effectId )
getEffects ( ) : Effect[]
getEyeHeight ( )
getHealth ( ) : integer
getId ( )
getLastDamageCause ( ) : EntityDamageEvent | null
getLinkedEntity ( )
getLinkedType ( )
getLocation ( )
getMaxHealth ( ) : integer
getMetadata ( $metadataKey )
getMotion ( )
getNameTag ( ) : string
getPosition ( )
getSaveId ( ) : string Returns the short save name
getViewers ( ) : Player[]
handleLavaMovement ( )
hasEffect ( $effectId )
hasMetadata ( $metadataKey )
heal ( float $amount, EntityRegainHealthEvent $source )
isAlive ( )
isInsideOfFire ( )
isInsideOfPortal ( )
isInsideOfSolid ( )
isInsideOfWater ( )
isNameTagVisible ( ) : boolean
isOnFire ( )
isOnGround ( )
isSneaking ( )
isSprinting ( )
kill ( )
linkEntity ( Entity $entity )
move ( $dx, $dy, $dz )
moveFlying ( )
onCollideWithPlayer ( Human $entityPlayer )
onUpdate ( $currentTick )
registerEntity ( $className, $force = false )
removeAllEffects ( )
removeEffect ( $effectId )
removeMetadata ( $metadataKey, pocketmine\plugin\Plugin $plugin )
resetFallDistance ( )
respawnToAll ( )
saveNBT ( )
scheduleUpdate ( )
sendData ( Player[] | Player $player, array $data = null )
sendLinkedData ( )
sendPotionEffects ( Player $player )
setDataFlag ( $propertyId, $id, boolean $value = true, integer $type = self::DATA_TYPE_BYTE )
setDataProperty ( integer $id, integer $type, mixed $value ) : boolean
setHealth ( integer $amount ) Sets the health of the Entity. This won't send any update to the players
setLastDamageCause ( EntityDamageEvent $type )
setLinked ( $type, Entity $entity )
setLocation ( Location $pos )
setMaxHealth ( integer $amount )
setMetadata ( $metadataKey, MetadataValue $metadataValue )
setMotion ( Vector3 $motion )
setNameTag ( string $name )
setNameTagVisible ( boolean $value = true )
setOnFire ( $seconds )
setPosition ( Vector3 $pos )
setPositionAndRotation ( Vector3 $pos, $yaw, $pitch )
setRotation ( $yaw, $pitch )
setSneaking ( $value = true )
setSprinting ( $value = true )
spawnTo ( Player $player )
spawnToAll ( )
teleport ( Vector3 $pos, float $yaw = null, float $pitch = null ) : boolean

Protected Methods

Method Description
addAttributes ( )
checkBlockCollision ( )
checkChunks ( )
checkGroundState ( $movX, $movY, $movZ, $dx, $dy, $dz )
checkObstruction ( $x, $y, $z )
initEntity ( )
recalculateEffectColor ( )
switchLevel ( Level $targetLevel )
updateFallState ( $distanceThisTick, $onGround )
updateMovement ( )

Method Details

__construct() public method

public __construct ( pocketmine\level\format\FullChunk $chunk, CompoundTag $nbt )
$chunk pocketmine\level\format\FullChunk
$nbt pocketmine\nbt\tag\CompoundTag

__destruct() public method

public __destruct ( )

__toString() public method

public __toString ( )

addAttributes() protected method

protected addAttributes ( )

addEffect() public method

public addEffect ( Effect $effect )
$effect Effect

addMovement() public method

public addMovement ( $x, $y, $z, $yaw, $pitch, $headYaw = null )

attack() public method

public attack ( float $damage, EntityDamageEvent $source ) : boolean
$damage float
$source pocketmine\event\entity\EntityDamageEvent
return boolean

canCollideWith() public method

public canCollideWith ( Entity $entity )
$entity Entity

canTriggerWalking() public method

public canTriggerWalking ( )

checkBlockCollision() protected method

protected checkBlockCollision ( )

checkChunks() protected method

protected checkChunks ( )

checkGroundState() protected method

protected checkGroundState ( $movX, $movY, $movZ, $dx, $dy, $dz )

checkObstruction() protected method

protected checkObstruction ( $x, $y, $z )

close() public method

public close ( )

createEntity() public static method

public static createEntity ( integer | string $type, pocketmine\level\format\FullChunk $chunk, CompoundTag $nbt, $args ) : Entity | Projectile
$type integer | string
$chunk pocketmine\level\format\FullChunk
$nbt pocketmine\nbt\tag\CompoundTag
$args
return Entity | Projectile

despawnFrom() public method

public despawnFrom ( Player $player )
$player pocketmine\Player

despawnFromAll() public method

public despawnFromAll ( )

entityBaseTick() public method

public entityBaseTick ( $tickDiff = 1 )

extinguish() public method

public extinguish ( )

fall() public method

public fall ( $fallDistance )

fastMove() public method

public fastMove ( $dx, $dy, $dz )

getAttributeMap() public method

public getAttributeMap ( )

getBlocksAround() public method

public getBlocksAround ( )

getBoundingBox() public method

public getBoundingBox ( )

getDataFlag() public method

public getDataFlag ( integer $propertyId, integer $id ) : boolean
$propertyId integer
$id integer
return boolean

getDataProperty() public method

public getDataProperty ( integer $id ) : mixed
$id integer
return mixed

getDataPropertyType() public method

public getDataPropertyType ( integer $id ) : integer
$id integer
return integer

getDirection() public method

public getDirection ( )

getDirectionPlane() public method

public getDirectionPlane ( )

getDirectionVector() public method

public getDirectionVector ( ) : Vector3
return pocketmine\math\Vector3

getDropExpMax() public method

public getDropExpMax ( ) : integer
return integer

getDropExpMin() public method

public getDropExpMin ( ) : integer
return integer

getEffect() public method

public getEffect ( $effectId )

getEffects() public method

public getEffects ( ) : Effect[]
return Effect[]

getEyeHeight() public method

public getEyeHeight ( )

getHealth() public method

public getHealth ( ) : integer
return integer

getId() public method

public getId ( )

getLastDamageCause() public method

public getLastDamageCause ( ) : EntityDamageEvent | null
return pocketmine\event\entity\EntityDamageEvent | null

getLinkedEntity() public method

public getLinkedEntity ( )

getLinkedType() public method

public getLinkedType ( )

getLocation() public method

public getLocation ( )

getMaxHealth() public method

public getMaxHealth ( ) : integer
return integer

getMetadata() public method

public getMetadata ( $metadataKey )

getMotion() public method

public getMotion ( )

getNameTag() public method

public getNameTag ( ) : string
return string

getPosition() public method

public getPosition ( )

getSaveId() public method

Returns the short save name
public getSaveId ( ) : string
return string

getViewers() public method

public getViewers ( ) : Player[]
return pocketmine\Player[]

handleLavaMovement() public method

public handleLavaMovement ( )

hasEffect() public method

public hasEffect ( $effectId )

hasMetadata() public method

public hasMetadata ( $metadataKey )

heal() public method

public heal ( float $amount, EntityRegainHealthEvent $source )
$amount float
$source pocketmine\event\entity\EntityRegainHealthEvent

initEntity() protected method

protected initEntity ( )

isAlive() public method

public isAlive ( )

isInsideOfFire() public method

public isInsideOfFire ( )

isInsideOfPortal() public method

public isInsideOfPortal ( )

isInsideOfSolid() public method

public isInsideOfSolid ( )

isInsideOfWater() public method

public isInsideOfWater ( )

isNameTagVisible() public method

public isNameTagVisible ( ) : boolean
return boolean

isOnFire() public method

public isOnFire ( )

isOnGround() public method

public isOnGround ( )

isSneaking() public method

public isSneaking ( )

isSprinting() public method

public isSprinting ( )

kill() public method

public kill ( )

linkEntity() public method

public linkEntity ( Entity $entity )
$entity Entity

move() public method

public move ( $dx, $dy, $dz )

moveFlying() public method

public moveFlying ( )

onCollideWithPlayer() public method

public onCollideWithPlayer ( Human $entityPlayer )
$entityPlayer Human

onUpdate() public method

public onUpdate ( $currentTick )

recalculateEffectColor() protected method

protected recalculateEffectColor ( )

registerEntity() public static method

public static registerEntity ( $className, $force = false )

removeAllEffects() public method

public removeAllEffects ( )

removeEffect() public method

public removeEffect ( $effectId )

removeMetadata() public method

public removeMetadata ( $metadataKey, pocketmine\plugin\Plugin $plugin )
$plugin pocketmine\plugin\Plugin

resetFallDistance() public method

public resetFallDistance ( )

respawnToAll() public method

public respawnToAll ( )

saveNBT() public method

public saveNBT ( )

scheduleUpdate() final public method

final public scheduleUpdate ( )

sendData() public method

public sendData ( Player[] | Player $player, array $data = null )
$player pocketmine\Player[] | pocketmine\Player
$data array Properly formatted entity data, defaults to everything

sendLinkedData() public method

public sendLinkedData ( )

sendPotionEffects() public method

public sendPotionEffects ( Player $player )
$player pocketmine\Player

setDataFlag() public method

public setDataFlag ( $propertyId, $id, boolean $value = true, integer $type = self::DATA_TYPE_BYTE )
$propertyId
$id
$value boolean
$type integer

setDataProperty() public method

public setDataProperty ( integer $id, integer $type, mixed $value ) : boolean
$id integer
$type integer
$value mixed
return boolean

setHealth() public method

Sets the health of the Entity. This won't send any update to the players
public setHealth ( integer $amount )
$amount integer

setLastDamageCause() public method

public setLastDamageCause ( EntityDamageEvent $type )
$type pocketmine\event\entity\EntityDamageEvent

setLinked() public method

public setLinked ( $type, Entity $entity )
$entity Entity

setLocation() public method

public setLocation ( Location $pos )
$pos pocketmine\level\Location

setMaxHealth() public method

public setMaxHealth ( integer $amount )
$amount integer

setMetadata() public method

public setMetadata ( $metadataKey, MetadataValue $metadataValue )
$metadataValue pocketmine\metadata\MetadataValue

setMotion() public method

public setMotion ( Vector3 $motion )
$motion pocketmine\math\Vector3

setNameTag() public method

public setNameTag ( string $name )
$name string

setNameTagVisible() public method

public setNameTagVisible ( boolean $value = true )
$value boolean

setOnFire() public method

public setOnFire ( $seconds )

setPosition() public method

public setPosition ( Vector3 $pos )
$pos pocketmine\math\Vector3

setPositionAndRotation() public method

public setPositionAndRotation ( Vector3 $pos, $yaw, $pitch )
$pos pocketmine\math\Vector3

setRotation() public method

public setRotation ( $yaw, $pitch )

setSneaking() public method

public setSneaking ( $value = true )

setSprinting() public method

public setSprinting ( $value = true )

spawnTo() public method

public spawnTo ( Player $player )
$player pocketmine\Player

spawnToAll() public method

public spawnToAll ( )

switchLevel() protected method

protected switchLevel ( Level $targetLevel )
$targetLevel pocketmine\level\Level

teleport() public method

public teleport ( Vector3 $pos, float $yaw = null, float $pitch = null ) : boolean
$pos pocketmine\math\Vector3
$yaw float
$pitch float
return boolean

updateFallState() protected method

protected updateFallState ( $distanceThisTick, $onGround )

updateMovement() protected method

protected updateMovement ( )

Property Details

$activatedPressurePlates protected property

protected PressurePlate,pocketmine\block $activatedPressurePlates
return pocketmine\block\PressurePlate

$age protected property

protected $age

$attributeMap protected property

protected AttributeMap,pocketmine\entity $attributeMap
return AttributeMap

$boundingBox public property

public AxisAlignedBB,pocketmine\math $boundingBox
return pocketmine\math\AxisAlignedBB

$canCollide public property

public $canCollide

$chunk public property

public Chunk,pocketmine\level\format $chunk
return pocketmine\level\format\Chunk

$closed public property

public $closed

$dataFlags protected property

protected $dataFlags

$dataProperties protected property

protected $dataProperties

$deadTicks public property

public $deadTicks

$drag protected property

protected $drag

$dropExp public property

public $dropExp

$effects protected property

protected Effect[],pocketmine\entity $effects
return Effect[]

$entityCount public static property

public static $entityCount

$eyeHeight public property

public $eyeHeight

$fallDistance public property

public $fallDistance

$fireProof protected property

protected $fireProof

$fireTicks public property

public $fireTicks

$gravity protected property

protected $gravity

$hasSpawned protected property

protected Player[],pocketmine $hasSpawned
return pocketmine\Player[]

$height public property

public $height

$id protected property

protected $id

$inBlock public property

public $inBlock

$isCollided public property

public $isCollided

$isCollidedHorizontally public property

public $isCollidedHorizontally

$isCollidedVertically public property

public $isCollidedVertically

$isPlayer protected property

protected $isPlayer

$isStatic protected property

protected $isStatic

$justCreated protected property

protected $justCreated

$keepMovement public property

public $keepMovement

$lastDamageCause protected property

protected $lastDamageCause

$lastMotionX public property

public $lastMotionX

$lastMotionY public property

public $lastMotionY

$lastMotionZ public property

public $lastMotionZ

$lastPitch public property

public $lastPitch

$lastUpdate public property

public $lastUpdate

$lastX public property

public $lastX

$lastY public property

public $lastY

$lastYaw public property

public $lastYaw

$lastZ public property

public $lastZ

$length public property

public $length

$linkedEntity protected property

protected Entity,pocketmine\entity $linkedEntity
return Entity

$linkedType protected property

0 no linked 1 linked other 2 be linked
protected $linkedType

$maxFireTicks public property

public $maxFireTicks

$motionChanged public property

public $motionChanged

$motionX public property

public $motionX

$motionY public property

public $motionY

$motionZ public property

public $motionZ

$namedtag public property

public $namedtag

$noDamageTicks public property

public $noDamageTicks

$onGround public property

public $onGround

$passenger public property

public $passenger

$positionChanged public property

public $positionChanged

$riding protected property

protected $riding

$server protected property

protected Server,pocketmine $server
return pocketmine\Server

$stepHeight protected property

protected $stepHeight

$temporalVector public property

public Vector3,pocketmine\math $temporalVector
return pocketmine\math\Vector3

$ticksLived public property

public $ticksLived

$timings protected property

protected TimingsHandler,pocketmine\event $timings
return pocketmine\event\TimingsHandler

$vehicle public property

public $vehicle

$width public property

public $width

$ySize protected property

protected $ySize