mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-07-01 23:59:53 +00:00
Force Entity health change on respawn
This commit is contained in:
parent
e619ebad61
commit
9cc624b74e
@ -1417,7 +1417,7 @@ class Player{
|
||||
if($this->spawned !== false){
|
||||
break;
|
||||
}
|
||||
$this->entity->setHealth($this->data->get("health"));
|
||||
$this->entity->setHealth($this->data->get("health"), "spawn", true);
|
||||
$this->spawned = true;
|
||||
$this->server->api->player->spawnAllPlayers($this);
|
||||
$this->server->api->player->spawnToAllPlayers($this);
|
||||
@ -1849,9 +1849,8 @@ class Player{
|
||||
if($this->entity instanceof Entity){
|
||||
$this->entity->fire = 0;
|
||||
$this->entity->air = 300;
|
||||
$this->entity->setHealth(20, "respawn");
|
||||
$this->entity->updateMetadata();
|
||||
$this->entity->dead = false;
|
||||
$this->entity->setHealth(20, "respawn", true);
|
||||
$this->entity->updateMetadata();
|
||||
}else{
|
||||
break;
|
||||
}
|
||||
|
@ -971,7 +971,7 @@ class Entity extends Position{
|
||||
}else{
|
||||
return false; //Entity inmunity
|
||||
}
|
||||
}elseif($health === $this->health){
|
||||
}elseif($health === $this->health and !$this->dead){
|
||||
return false;
|
||||
}
|
||||
if($this->server->api->dhandle("entity.health.change", array("entity" => $this, "eid" => $this->eid, "health" => $health, "cause" => $cause)) !== false or $force === true){
|
||||
|
Loading…
x
Reference in New Issue
Block a user