mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-04-21 08:17:34 +00:00
added Entity::setHealth() force
This commit is contained in:
parent
2b28e26392
commit
3cffa66490
@ -956,7 +956,7 @@ class Entity extends Position{
|
||||
}elseif($health === $this->health){
|
||||
return false;
|
||||
}
|
||||
if($this->server->api->dhandle("entity.health.change", array("entity" => $this, "eid" => $this->eid, "health" => $health, "cause" => $cause)) !== false){
|
||||
if($this->server->api->dhandle("entity.health.change", array("entity" => $this, "eid" => $this->eid, "health" => $health, "cause" => $cause)) !== false or $force === true){
|
||||
$this->health = min(127, max(-127, $health));
|
||||
$this->server->query("UPDATE entities SET health = ".$this->health." WHERE EID = ".$this->eid.";");
|
||||
if($harm === true){
|
||||
|
Loading…
x
Reference in New Issue
Block a user