mob fall damage

This commit is contained in:
GameHerobrine 2023-02-23 18:54:10 +03:00
parent 3e3a020d2e
commit 6b68b88572
2 changed files with 21 additions and 4 deletions

View file

@ -17,7 +17,12 @@ abstract class Living extends Entity implements Damageable, Pathfindable{
$this->hasKnockback = true;
if(self::$despawnMobs) $this->server->schedule(self::$despawnTimer, [$this, "close"]); //900*20
}
public function fall(){
$dmg = floor($this->fallDistance - 3);
if($dmg > 0){
$this->harm($dmg, "fall");
}
}
public function hasPath(){
return $this->path != null;
}