mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-07-14 22:01:59 +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){
|
}elseif($health === $this->health){
|
||||||
return false;
|
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->health = min(127, max(-127, $health));
|
||||||
$this->server->query("UPDATE entities SET health = ".$this->health." WHERE EID = ".$this->eid.";");
|
$this->server->query("UPDATE entities SET health = ".$this->health." WHERE EID = ".$this->eid.";");
|
||||||
if($harm === true){
|
if($harm === true){
|
||||||
|
Loading…
x
Reference in New Issue
Block a user