mirror of
https://github.com/oldminecraftcommunity/NostalgiaCore.git
synced 2026-11-21 12:09:43 +00:00
Eating
This commit is contained in:
parent
2011d1d339
commit
71b12191b2
4 changed files with 42 additions and 1 deletions
|
|
@ -162,7 +162,7 @@ class Entity extends stdClass{
|
|||
}
|
||||
|
||||
if($this->y < -16){
|
||||
$this->harm(8, "void", true); //4 per second
|
||||
$this->harm(8, "void", true);
|
||||
}
|
||||
|
||||
if($this->fire > 0){
|
||||
|
|
@ -470,6 +470,10 @@ class Entity extends stdClass{
|
|||
return $this->setHealth($this->getHealth() - ((int) $dmg), $cause, $force);
|
||||
}
|
||||
|
||||
public function heal($health, $cause = "generic"){
|
||||
return $this->setHealth(min(20, $this->getHealth() + ((int) $health)), $cause);
|
||||
}
|
||||
|
||||
public function setHealth($health, $cause = "generic", $force = false){
|
||||
$health = (int) $health;
|
||||
$harm = false;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue