PHP Class pocketmine\entity\Human

Inheritance: extends Creature, implements ProjectileSource, implements pocketmine\inventory\InventoryHolder
Show file Open project: iTXTech/Genisys Class Usage Examples

Public Properties

Property Type Description
$eyeHeight
$height
$length
$width

Protected Properties

Property Type Description
$floatingInventory pocketmine\inventory\FloatingInventory
$foodTickTimer
$inventory pocketmine\inventory\PlayerInventory
$rawUUID
$skin
$skinId
$totalXp
$transactionQueue pocketmine\inventory\SimpleTransactionQueue
$uuid pocketmine\utils\UUID
$xpCooldown
$xpSeed

Public Methods

Method Description
addFood ( float $amount )
addSaturation ( float $amount )
addXp ( integer $xp, boolean $syncLevel = false ) : boolean
addXpLevel ( integer $level ) : boolean
canPickupXp ( ) : boolean
close ( )
despawnFrom ( Player $player )
entityBaseTick ( $tickDiff = 1, $EnchantL )
exhaust ( float $amount, integer $cause = PlayerExhaustEvent::CAUSE_CUSTOM ) : float Increases a human's exhaustion level.
getAbsorption ( ) : integer
getDrops ( )
getExhaustion ( ) : float
getFilledXp ( ) : integer
getFloatingInventory ( )
getFood ( ) : float
getInventory ( )
getLevelFromXp ( integer $xp ) : array Converts a quantity of exp into a level and a progress percentage
getLevelXpRequirement ( integer $level ) : integer Returns the amount of exp required to complete the specified level.
getMaxFood ( ) : float
getName ( )
getRawUniqueId ( ) : string
getRemainderXp ( ) : integer
getSaturation ( ) : float
getSkinData ( )
getSkinId ( )
getTotalXp ( ) : integer
getTotalXpRequirement ( integer $level ) : integer Returns the total amount of exp required to reach the specified level.
getTransactionQueue ( )
getUniqueId ( ) : UUID | null
getXpLevel ( ) : integer
getXpProgress ( ) : float
getXpSeed ( ) : integer
recalculateXpProgress ( ) : float
resetXpCooldown ( )
saveNBT ( )
setAbsorption ( integer $absorption )
setExhaustion ( float $exhaustion ) WARNING: This method does not check if exhausted and does not consume saturation/food.
setFood ( float $new ) WARNING: This method does not check if full and may throw an exception if out of bounds.
setSaturation ( float $saturation ) WARNING: This method does not check if saturated and may throw an exception if out of bounds.
setSkin ( string $str, string $skinId )
setTotalXp ( integer $xp, boolean $syncLevel = false ) : boolean Changes the total exp of a player
setXpLevel ( integer $level ) : boolean
setXpProgress ( float $progress ) : boolean
spawnTo ( Player $player )
takeXp ( integer $xp, boolean $syncLevel = false ) : boolean
takeXpLevel ( integer $level ) : boolean

Protected Methods

Method Description
addAttributes ( )
initEntity ( )

Method Details

addAttributes() protected method

protected addAttributes ( )

addFood() public method

public addFood ( float $amount )
$amount float

addSaturation() public method

public addSaturation ( float $amount )
$amount float

addXp() public method

public addXp ( integer $xp, boolean $syncLevel = false ) : boolean
$xp integer
$syncLevel boolean
return boolean

addXpLevel() public method

public addXpLevel ( integer $level ) : boolean
$level integer
return boolean

canPickupXp() public method

public canPickupXp ( ) : boolean
return boolean

close() public method

public close ( )

despawnFrom() public method

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

entityBaseTick() public method

public entityBaseTick ( $tickDiff = 1, $EnchantL )

exhaust() public method

Increases a human's exhaustion level.
public exhaust ( float $amount, integer $cause = PlayerExhaustEvent::CAUSE_CUSTOM ) : float
$amount float
$cause integer
return float the amount of exhaustion level increased

getAbsorption() public method

public getAbsorption ( ) : integer
return integer

getDrops() public method

public getDrops ( )

getExhaustion() public method

public getExhaustion ( ) : float
return float

getFilledXp() public method

public getFilledXp ( ) : integer
return integer

getFloatingInventory() public method

getFood() public method

public getFood ( ) : float
return float

getInventory() public method

public getInventory ( )

getLevelFromXp() public static method

Converts a quantity of exp into a level and a progress percentage
public static getLevelFromXp ( integer $xp ) : array
$xp integer
return array

getLevelXpRequirement() public static method

Returns the amount of exp required to complete the specified level.
public static getLevelXpRequirement ( integer $level ) : integer
$level integer
return integer

getMaxFood() public method

public getMaxFood ( ) : float
return float

getName() public method

public getName ( )

getRawUniqueId() public method

public getRawUniqueId ( ) : string
return string

getRemainderXp() public method

public getRemainderXp ( ) : integer
return integer

getSaturation() public method

public getSaturation ( ) : float
return float

getSkinData() public method

public getSkinData ( )

getSkinId() public method

public getSkinId ( )

getTotalXp() public method

public getTotalXp ( ) : integer
return integer

getTotalXpRequirement() public static method

Returns the total amount of exp required to reach the specified level.
public static getTotalXpRequirement ( integer $level ) : integer
$level integer
return integer

getTransactionQueue() public method

public getTransactionQueue ( )

getUniqueId() public method

public getUniqueId ( ) : UUID | null
return pocketmine\utils\UUID | null

getXpLevel() public method

public getXpLevel ( ) : integer
return integer

getXpProgress() public method

public getXpProgress ( ) : float
return float

getXpSeed() public method

public getXpSeed ( ) : integer
return integer

initEntity() protected method

protected initEntity ( )

recalculateXpProgress() public method

public recalculateXpProgress ( ) : float
return float

resetXpCooldown() public method

public resetXpCooldown ( )

saveNBT() public method

public saveNBT ( )

setAbsorption() public method

public setAbsorption ( integer $absorption )
$absorption integer

setExhaustion() public method

Use {@link Human::exhaust()} for this purpose.
public setExhaustion ( float $exhaustion )
$exhaustion float

setFood() public method

Use {@link Human::addFood()} for this purpose
public setFood ( float $new )
$new float

setSaturation() public method

Use {@link Human::addSaturation()} for this purpose
public setSaturation ( float $saturation )
$saturation float

setSkin() public method

public setSkin ( string $str, string $skinId )
$str string
$skinId string

setTotalXp() public method

Changes the total exp of a player
public setTotalXp ( integer $xp, boolean $syncLevel = false ) : boolean
$xp integer
$syncLevel boolean This will reset the level to be in sync with the total. Usually you don't want to do this, because it'll mess up use of xp in anvils and enchanting tables.
return boolean

setXpLevel() public method

public setXpLevel ( integer $level ) : boolean
$level integer
return boolean

setXpProgress() public method

public setXpProgress ( float $progress ) : boolean
$progress float
return boolean

spawnTo() public method

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

takeXp() public method

public takeXp ( integer $xp, boolean $syncLevel = false ) : boolean
$xp integer
$syncLevel boolean
return boolean

takeXpLevel() public method

public takeXpLevel ( integer $level ) : boolean
$level integer
return boolean

Property Details

$eyeHeight public property

public $eyeHeight

$floatingInventory protected property

protected FloatingInventory,pocketmine\inventory $floatingInventory
return pocketmine\inventory\FloatingInventory

$foodTickTimer protected property

protected $foodTickTimer

$height public property

public $height

$inventory protected property

protected PlayerInventory,pocketmine\inventory $inventory
return pocketmine\inventory\PlayerInventory

$length public property

public $length

$rawUUID protected property

protected $rawUUID

$skin protected property

protected $skin

$skinId protected property

protected $skinId

$totalXp protected property

protected $totalXp

$transactionQueue protected property

protected SimpleTransactionQueue,pocketmine\inventory $transactionQueue
return pocketmine\inventory\SimpleTransactionQueue

$uuid protected property

protected UUID,pocketmine\utils $uuid
return pocketmine\utils\UUID

$width public property

public $width

$xpCooldown protected property

protected $xpCooldown

$xpSeed protected property

protected $xpSeed