fixed mobs sending damage animation to player when they spawn

This commit is contained in:
GameHerobrine 2025-06-04 17:54:25 +03:00
parent f572605472
commit d28dad2a07
15 changed files with 15 additions and 15 deletions

View file

@ -8,7 +8,7 @@ class FallingSand extends Entity{
public function __construct($level, $eid, $class, $type = 0, $data = []){
parent::__construct($level, $eid, $class, $type, $data);
$this->setHealth(PHP_INT_MAX, "generic");
$this->setHealth(PHP_INT_MAX, "generic", allowHarm: false);
$this->height = 0.98;
$this->width = 0.98;
$this->yOffset = $this->height / 2;

View file

@ -22,7 +22,7 @@ class ItemEntity extends Entity{
$this->itemID = (int) $data["itemID"];
}
$this->hasGravity = true;
$this->setHealth(5, "generic");
$this->setHealth(5, "generic", allowHarm: false);
$this->gravity = 0.04;
$this->delayBeforePickup = 40; //in vanilla it is 0 by default
$this->stepHeight = 0;

View file

@ -62,7 +62,7 @@ class Minecart extends Vehicle{
$this->x = $this->data["TileX"] ?? $this->x;
$this->y = $this->data["TileY"] ?? $this->y;
$this->z = $this->data["TileZ"] ?? $this->z;
$this->setHealth(1, "generic"); //orig: 3
$this->setHealth(1, "generic", allowHarm: false); //orig: 3
$this->setSize(0.98, 0.7);
$this->yOffset = $this->height / 2;
$this->stepHeight = 0;

View file

@ -12,7 +12,7 @@ class PrimedTNT extends Entity{
$this->gravity = 0.04;
$this->setSize(0.98, 0.98);
$this->yOffset = $this->height / 2;
$this->setHealth(10000000, "generic");
$this->setHealth(10000000, "generic", allowHarm: false);
}
public function isPickable(){

View file

@ -5,7 +5,7 @@ class TripodCamera extends Entity{
function __construct(Level $level, $eid, $class, $type = 0, $data = []){
parent::__construct($level, $eid, $class, $type, $data);
$this->setHealth(PHP_INT_MAX, "generic");
$this->setHealth(PHP_INT_MAX, "generic", allowHarm: false);
}
public function isPickable(){