isBaby added to entities.yml, armor fix

This commit is contained in:
GameHerobrine 2022-06-02 01:33:18 +03:00
parent ca2bf73e06
commit 42fc07a888
3 changed files with 14 additions and 27 deletions

View file

@ -1056,11 +1056,15 @@ class Entity extends Position{
DIAMOND_LEGGINGS => 6,
DIAMOND_BOOTS => 3,
);
foreach($this->player->armor as $part){
foreach($this->player->armor as $slot=>$part){
if($part instanceof Item and isset($values[$part->getID()])){
$points += $values[$part->getID()];
if(is_numeric($cause)){ //check was entity damage by another entity
$this->player->damageArmorPart($slot, $part);
}
}
}
$this->player->sendArmor($this->player);
$dmg = (int) ($dmg - ($dmg * $points * 0.04));
$health = $this->health - $dmg;
}

View file

@ -163,6 +163,7 @@ class Level{
"id" => $entity->type,
"Color" => @$entity->data["Color"],
"Sheared" => @$entity->data["Sheared"],
"isBaby" => @$entity->data["isBaby"],
"Health" => $entity->health,
"Pos" => array(
0 => $entity->x,