mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-06-10 13:35:29 +00:00
Better /kill command, ensures death
This commit is contained in:
parent
c37c6da42d
commit
35c0c21c8d
@ -240,7 +240,8 @@ class PlayerAPI{
|
||||
$player = $this->get($params[0]);
|
||||
}
|
||||
if($player instanceof Player){
|
||||
$this->server->api->entity->harm($player->eid, 20, "console", true);
|
||||
$player->entity->harm(1000, "console", true);
|
||||
$player->sendChat("Ouch. That looks like it hurt.\n");
|
||||
}else{
|
||||
$output .= "Usage: /$cmd [player]\n";
|
||||
}
|
||||
|
@ -782,7 +782,7 @@ class Entity extends Position{
|
||||
}
|
||||
|
||||
public function harm($dmg, $cause = "generic", $force = false){
|
||||
return $this->setHealth($this->getHealth() - ((int) $dmg), $cause, $force);
|
||||
return $this->setHealth(max(-128, $this->getHealth() - ((int) $dmg)), $cause, $force);
|
||||
}
|
||||
|
||||
public function heal($health, $cause = "generic"){
|
||||
|
Loading…
x
Reference in New Issue
Block a user