bow will consume durability, arrows will be deleted

This commit is contained in:
GameHerobrine 2024-03-24 03:18:07 +03:00
parent 0a1a4f33f3
commit 105b09e28f
3 changed files with 18 additions and 4 deletions

View file

@ -1318,7 +1318,11 @@ class Entity extends Position
}
$dmg = $this->applyArmor($dmg, $cause);
$ret = $this->setHealth(max(- 128, $this->getHealth() - ((int) $dmg)), $cause, $force);
if($this->isPlayer() && $this->player->gamemode & 0x01 == 0x01){
return false;
}
if ($ret != false && $this->hasKnockback && is_numeric($cause) && ($entity = $this->server->api->entity->get($cause)) != false) {
$d = $entity->x - $this->x;