mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-06-07 20:28:31 +00:00
Fixed #128 player death
This commit is contained in:
parent
66169d63c4
commit
ecc2faffea
@ -621,7 +621,20 @@ class Entity extends stdClass{
|
|||||||
$this->fallStart = false;
|
$this->fallStart = false;
|
||||||
$this->updateMetadata();
|
$this->updateMetadata();
|
||||||
$this->dead = true;
|
$this->dead = true;
|
||||||
$this->server->api->dhandle("entity.event", array("entity" => $this, "event" => 3)); //Entity dead
|
if($this->player instanceof Player){
|
||||||
|
$x = $this->x;
|
||||||
|
$y = $this->y;
|
||||||
|
$z = $this->z;
|
||||||
|
$this->x = 0;
|
||||||
|
$this->y = -10;
|
||||||
|
$this->z = 0;
|
||||||
|
$this->server->api->dhandle("entity.move", $this);
|
||||||
|
$this->x = $x;
|
||||||
|
$this->y = $y;
|
||||||
|
$this->z = $z;
|
||||||
|
}else{
|
||||||
|
$this->server->api->dhandle("entity.event", array("entity" => $this, "event" => 3)); //Entity dead
|
||||||
|
}
|
||||||
if($this->player instanceof Player){
|
if($this->player instanceof Player){
|
||||||
$this->server->api->dhandle("player.death", array("name" => $this->name, "cause" => $cause));
|
$this->server->api->dhandle("player.death", array("name" => $this->name, "cause" => $cause));
|
||||||
}else{
|
}else{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user