mirror of
https://github.com/oldminecraftcommunity/NostalgiaCore.git
synced 2026-11-21 12:09:43 +00:00
mob fall damage
This commit is contained in:
parent
3e3a020d2e
commit
6b68b88572
2 changed files with 21 additions and 4 deletions
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue