fixed regeneration on difficulty 0

This commit is contained in:
GameHerobrine 2024-03-25 23:33:22 +03:00
parent 9f5386fd08
commit a10c6a1d57
2 changed files with 7 additions and 18 deletions

View file

@ -1398,6 +1398,13 @@ class Player{
}
public function entityTick(){
if($this->isSleeping) ++$this->sleepingTime;
if($this->server->difficulty == 0 && $this->entity->counter % (20 * 15) == 0){
if($this->entity->health < 20 && $this->entity->health > 0){
$this->entity->setHealth(min(20, $this->entity->health + 1), "regeneration");
}
}
}
public function handleDataPacket(RakNetDataPacket $packet){
if($this->connected === false){