PocketMine-MP 5.21.2 git-b2aa6396c3cc2cafdd815eacc360e1ad89599899
|
Public Member Functions | |
__construct (private Human $entity) | |
addFood (float $amount) | |
addSaturation (float $amount) | |
exhaust (float $amount, int $cause=PlayerExhaustEvent::CAUSE_CUSTOM) | |
getExhaustion () | |
getFood () | |
getFoodTickTimer () | |
getMaxFood () | |
getSaturation () | |
isEnabled () | |
isHungry () | |
setEnabled (bool $enabled) | |
setExhaustion (float $exhaustion) | |
setFood (float $new) | |
setFoodTickTimer (int $foodTickTimer) | |
setSaturation (float $saturation) | |
tick (int $tickDiff=1) | |
Definition at line 33 of file HungerManager.php.
pocketmine\entity\HungerManager::__construct | ( | private Human | $entity | ) |
Definition at line 43 of file HungerManager.php.
pocketmine\entity\HungerManager::addFood | ( | float | $amount | ) |
Definition at line 84 of file HungerManager.php.
pocketmine\entity\HungerManager::addSaturation | ( | float | $amount | ) |
Definition at line 111 of file HungerManager.php.
pocketmine\entity\HungerManager::exhaust | ( | float | $amount, |
int | $cause = PlayerExhaustEvent::CAUSE_CUSTOM ) |
Increases exhaustion level.
Definition at line 132 of file HungerManager.php.
pocketmine\entity\HungerManager::getExhaustion | ( | ) |
Definition at line 115 of file HungerManager.php.
pocketmine\entity\HungerManager::getFood | ( | ) |
Definition at line 57 of file HungerManager.php.
pocketmine\entity\HungerManager::getFoodTickTimer | ( | ) |
Definition at line 169 of file HungerManager.php.
pocketmine\entity\HungerManager::getMaxFood | ( | ) |
Definition at line 80 of file HungerManager.php.
pocketmine\entity\HungerManager::getSaturation | ( | ) |
Definition at line 97 of file HungerManager.php.
pocketmine\entity\HungerManager::isEnabled | ( | ) |
Definition at line 221 of file HungerManager.php.
pocketmine\entity\HungerManager::isHungry | ( | ) |
Returns whether this Human may consume objects requiring hunger.
Definition at line 93 of file HungerManager.php.
pocketmine\entity\HungerManager::setEnabled | ( | bool | $enabled | ) |
Definition at line 225 of file HungerManager.php.
pocketmine\entity\HungerManager::setExhaustion | ( | float | $exhaustion | ) |
WARNING: This method does not check if exhausted and does not consume saturation/food.
Definition at line 123 of file HungerManager.php.
pocketmine\entity\HungerManager::setFood | ( | float | $new | ) |
WARNING: This method does not check if full and may throw an exception if out of bounds.
InvalidArgumentException
Definition at line 67 of file HungerManager.php.
pocketmine\entity\HungerManager::setFoodTickTimer | ( | int | $foodTickTimer | ) |
Definition at line 173 of file HungerManager.php.
pocketmine\entity\HungerManager::setSaturation | ( | float | $saturation | ) |
WARNING: This method does not check if saturated and may throw an exception if out of bounds.
InvalidArgumentException
Definition at line 107 of file HungerManager.php.
pocketmine\entity\HungerManager::tick | ( | int | $tickDiff = 1 | ) |
Definition at line 180 of file HungerManager.php.