89 protected const DEFAULT_BREATH_TICKS = 300;
102 private const TAG_LEGACY_HEALTH =
"HealF";
103 private const TAG_HEALTH =
"Health";
104 private const TAG_BREATH_TICKS =
"Air";
105 private const TAG_ACTIVE_EFFECTS =
"ActiveEffects";
106 private const TAG_EFFECT_ID =
"Id";
107 private const TAG_EFFECT_DURATION =
"Duration";
108 private const TAG_EFFECT_AMPLIFIER =
"Amplifier";
109 private const TAG_EFFECT_SHOW_PARTICLES =
"ShowParticles";
110 private const TAG_EFFECT_AMBIENT =
"Ambient";
112 protected int $attackTime = 0;
114 public int $deadTicks = 0;
115 protected int $maxDeadTicks = 25;
117 protected float $jumpVelocity = 0.42;
123 protected bool $breathing =
true;
124 protected int $breathTicks = self::DEFAULT_BREATH_TICKS;
125 protected int $maxBreathTicks = self::DEFAULT_BREATH_TICKS;
129 protected Attribute $knockbackResistanceAttr;
132 protected bool $sprinting =
false;
133 protected bool $sneaking =
false;
134 protected bool $gliding =
false;
135 protected bool $swimming =
false;
137 private ?
int $frostWalkerLevel =
null;
143 abstract public function getName() : string;
149 protected function initEntity(
CompoundTag $nbt) : void{
150 parent::initEntity($nbt);
153 $this->effectManager->getEffectAddHooks()->add(
function() :
void{ $this->networkPropertiesDirty =
true; });
154 $this->effectManager->getEffectRemoveHooks()->add(
function() :
void{ $this->networkPropertiesDirty =
true; });
156 $this->armorInventory =
new ArmorInventory();
158 $this->armorInventory->getListeners()->add(CallbackInventoryListener::onAnyChange(fn() => NetworkBroadcastUtils::broadcastEntityEvent(
160 fn(EntityEventBroadcaster $broadcaster, array $recipients) => $broadcaster->onMobArmorChange($recipients, $this)
162 $this->armorInventory->getListeners()->add(
new CallbackInventoryListener(
163 onSlotChange:
function(Inventory $inventory,
int $slot) :
void{
164 if($slot === ArmorInventory::SLOT_FEET){
165 $this->frostWalkerLevel =
null;
168 onContentChange:
function() :
void{ $this->frostWalkerLevel =
null; }
171 $health = $this->getMaxHealth();
173 if(($healFTag = $nbt->
getTag(self::TAG_LEGACY_HEALTH)) instanceof FloatTag){
174 $health = $healFTag->getValue();
175 }elseif(($healthTag = $nbt->
getTag(self::TAG_HEALTH)) instanceof ShortTag){
176 $health = $healthTag->getValue();
177 }elseif($healthTag instanceof FloatTag){
178 $health = $healthTag->getValue();
181 $this->setHealth($health);
183 $this->setAirSupplyTicks($nbt->getShort(self::TAG_BREATH_TICKS, self::DEFAULT_BREATH_TICKS));
185 $activeEffectsTag = $nbt->
getListTag(self::TAG_ACTIVE_EFFECTS, CompoundTag::class);
186 if($activeEffectsTag !==
null){
187 foreach($activeEffectsTag as $e){
188 $effect = EffectIdMap::getInstance()->fromId($e->getByte(self::TAG_EFFECT_ID));
189 if($effect ===
null){
193 $duration = $e->getInt(self::TAG_EFFECT_DURATION);
194 $this->effectManager->add(
new EffectInstance(
196 $duration === -1 ? Limits::INT32_MAX : $duration,
197 Binary::unsignByte($e->getByte(self::TAG_EFFECT_AMPLIFIER)),
198 $e->getByte(self::TAG_EFFECT_SHOW_PARTICLES, 1) !== 0,
199 $e->getByte(self::TAG_EFFECT_AMBIENT, 0) !== 0,
200 infinite: $duration === -1
206 protected function addAttributes() : void{
207 $this->attributeMap->add($this->healthAttr = AttributeFactory::getInstance()->mustGet(Attribute::HEALTH));
208 $this->attributeMap->add(AttributeFactory::getInstance()->mustGet(Attribute::FOLLOW_RANGE));
209 $this->attributeMap->add($this->knockbackResistanceAttr = AttributeFactory::getInstance()->mustGet(Attribute::KNOCKBACK_RESISTANCE));
210 $this->attributeMap->add($this->moveSpeedAttr = AttributeFactory::getInstance()->mustGet(Attribute::MOVEMENT_SPEED));
211 $this->attributeMap->add(AttributeFactory::getInstance()->mustGet(Attribute::ATTACK_DAMAGE));
212 $this->attributeMap->add($this->absorptionAttr = AttributeFactory::getInstance()->mustGet(Attribute::ABSORPTION));
219 return $this->nameTag !==
"" ? $this->nameTag : $this->getName();
223 $wasAlive = $this->isAlive();
224 parent::setHealth($amount);
225 $this->healthAttr->setValue(ceil($this->getHealth()),
true);
226 if($this->isAlive() && !$wasAlive){
231 public function getMaxHealth() : int{
232 return (int) $this->healthAttr->getMaxValue();
235 public function setMaxHealth(
int $amount) : void{
236 $this->healthAttr->setMaxValue($amount)->setDefaultValue($amount);
239 public function getAbsorption() : float{
240 return $this->absorptionAttr->getValue();
243 public function setAbsorption(
float $absorption) : void{
244 $this->absorptionAttr->setValue($absorption);
247 public function getSneakOffset() : float{
251 public function isSneaking() : bool{
252 return $this->sneaking;
255 public function setSneaking(
bool $value =
true) : void{
256 $this->sneaking = $value;
257 $this->networkPropertiesDirty =
true;
258 $this->recalculateSize();
261 public function isSprinting() : bool{
262 return $this->sprinting;
265 public function setSprinting(
bool $value =
true) : void{
266 if($value !== $this->isSprinting()){
267 $this->sprinting = $value;
268 $this->networkPropertiesDirty =
true;
269 $moveSpeed = $this->getMovementSpeed();
270 $this->setMovementSpeed($value ? ($moveSpeed * 1.3) : ($moveSpeed / 1.3));
271 $this->moveSpeedAttr->markSynchronized(
false);
275 public function isGliding() : bool{
276 return $this->gliding;
279 public function setGliding(
bool $value =
true) : void{
280 $this->gliding = $value;
281 $this->networkPropertiesDirty =
true;
282 $this->recalculateSize();
285 public function isSwimming() : bool{
286 return $this->swimming;
289 public function setSwimming(
bool $value =
true) : void{
290 $this->swimming = $value;
291 $this->networkPropertiesDirty =
true;
292 $this->recalculateSize();
295 private function recalculateSize() : void{
296 $size = $this->getInitialSizeInfo();
297 if($this->isSwimming() || $this->isGliding()){
298 $width = $size->getWidth();
299 $this->setSize((
new EntitySizeInfo($width, $width, $width * 0.9))->scale($this->getScale()));
300 }elseif($this->isSneaking()){
301 $this->setSize((
new EntitySizeInfo($size->getHeight() - $this->getSneakOffset(), $size->getWidth(), $size->getEyeHeight() - $this->getSneakOffset()))->scale($this->getScale()));
303 $this->setSize($size->scale($this->getScale()));
307 public function getMovementSpeed() : float{
308 return $this->moveSpeedAttr->getValue();
311 public function setMovementSpeed(
float $v,
bool $fit =
false) : void{
312 $this->moveSpeedAttr->setValue($v, $fit);
315 public function saveNBT() : CompoundTag{
316 $nbt = parent::saveNBT();
317 $nbt->
setFloat(self::TAG_HEALTH, $this->getHealth());
319 $nbt->
setShort(self::TAG_BREATH_TICKS, $this->getAirSupplyTicks());
321 if(count($this->effectManager->all()) > 0){
323 foreach($this->effectManager->all() as $effect){
324 $effects[] = CompoundTag::create()
325 ->setByte(self::TAG_EFFECT_ID, EffectIdMap::getInstance()->toId($effect->getType()))
326 ->setByte(self::TAG_EFFECT_AMPLIFIER, Binary::signByte($effect->getAmplifier()))
327 ->setInt(self::TAG_EFFECT_DURATION, $effect->isInfinite() ? -1 : $effect->getDuration())
328 ->setByte(self::TAG_EFFECT_AMBIENT, $effect->isAmbient() ? 1 : 0)
329 ->setByte(self::TAG_EFFECT_SHOW_PARTICLES, $effect->isVisible() ? 1 : 0);
332 $nbt->
setTag(self::TAG_ACTIVE_EFFECTS,
new ListTag($effects));
339 return $this->effectManager;
347 $this->applyConsumptionResults($consumable);
356 foreach($consumable->getAdditionalEffects() as $effect){
357 $this->effectManager->add($effect);
363 $consumable->onConsume($this);
370 return $this->jumpVelocity + ((($jumpBoost = $this->effectManager->get(
VanillaEffects::JUMP_BOOST())) !== null ? $jumpBoost->getEffectLevel() : 0) / 10);
378 $this->motion = $this->motion->withComponents(
null, $this->getJumpVelocity(),
null);
382 protected function calculateFallDamage(
float $fallDistance) : float{
383 return ceil($fallDistance - 3 - (($jumpBoost = $this->effectManager->get(VanillaEffects::JUMP_BOOST())) !== null ? $jumpBoost->getEffectLevel() : 0));
387 $fallBlockPos = $this->location->floor();
388 $fallBlock = $this->getWorld()->getBlock($fallBlockPos);
389 if(count($fallBlock->getCollisionBoxes()) === 0){
390 $fallBlockPos = $fallBlockPos->down();
391 $fallBlock = $this->getWorld()->getBlock($fallBlockPos);
393 $newVerticalVelocity = $fallBlock->onEntityLand($this);
395 $damage = $this->calculateFallDamage($this->fallDistance);
400 $this->broadcastSound($damage > 4 ?
404 }elseif($fallBlock->getTypeId() !== BlockTypeIds::AIR){
405 $this->broadcastSound(
new EntityLandSound($this, $fallBlock));
407 return $newVerticalVelocity;
417 foreach($this->armorInventory->getContents() as $item){
418 $total += $item->getDefensePoints();
429 foreach($this->armorInventory->getContents() as $item){
430 $result = max($result, $item->getEnchantmentLevel($enchantment));
436 public function getArmorInventory() : ArmorInventory{
437 return $this->armorInventory;
440 public function setOnFire(
int $seconds) : void{
441 parent::setOnFire($seconds - (int) min($seconds, $seconds * $this->getHighestArmorEnchantmentLevel(VanillaEnchantments::FIRE_PROTECTION()) * 0.15));
449 if($this->lastDamageCause !== null && $this->attackTime > 0){
450 if($this->lastDamageCause->getBaseDamage() >= $source->
getBaseDamage()){
453 $source->setModifier(-$this->lastDamageCause->getBaseDamage(), EntityDamageEvent::MODIFIER_PREVIOUS_DAMAGE_COOLDOWN);
455 if($source->canBeReducedByArmor()){
457 $source->setModifier(-$source->getFinalDamage() * $this->getArmorPoints() * 0.04, EntityDamageEvent::MODIFIER_ARMOR);
460 $cause = $source->getCause();
461 if(($resistance = $this->effectManager->get(VanillaEffects::RESISTANCE())) !==
null && $cause !== EntityDamageEvent::CAUSE_VOID && $cause !== EntityDamageEvent::CAUSE_SUICIDE){
462 $source->setModifier(-$source->getFinalDamage() * min(1, 0.2 * $resistance->getEffectLevel()), EntityDamageEvent::MODIFIER_RESISTANCE);
466 foreach($this->armorInventory->getContents() as $item){
467 if($item instanceof Armor){
468 $totalEpf += $item->getEnchantmentProtectionFactor($source);
471 $source->setModifier(-$source->getFinalDamage() * min(ceil(min($totalEpf, 25) * (mt_rand(50, 100) / 100)), 20) * 0.04, EntityDamageEvent::MODIFIER_ARMOR_ENCHANTMENTS);
473 $source->setModifier(-min($this->getAbsorption(), $source->getFinalDamage()), EntityDamageEvent::MODIFIER_ABSORPTION);
475 if($cause === EntityDamageEvent::CAUSE_FALLING_BLOCK && $this->armorInventory->getHelmet() instanceof Armor){
476 $source->setModifier(-($source->getFinalDamage() / 4), EntityDamageEvent::MODIFIER_ARMOR_HELMET);
486 $this->setAbsorption(max(0, $this->getAbsorption() + $source->getModifier(
EntityDamageEvent::MODIFIER_ABSORPTION)));
488 $this->damageArmor($source->getBaseDamage());
493 foreach($this->armorInventory->getContents() as $k => $item){
494 if($item instanceof Armor && ($thornsLevel = $item->getEnchantmentLevel(VanillaEnchantments::THORNS())) > 0){
495 if(mt_rand(0, 99) < $thornsLevel * 15){
496 $this->damageItem($item, 3);
497 $damage += ($thornsLevel > 10 ? $thornsLevel - 10 : 1 + mt_rand(0, 3));
499 $this->damageItem($item, 1);
502 $this->armorInventory->setItem($k, $item);
507 $attacker->attack(new EntityDamageByEntityEvent($this, $attacker, EntityDamageEvent::CAUSE_MAGIC, $damage));
510 if($source->getModifier(EntityDamageEvent::MODIFIER_ARMOR_HELMET) < 0){
511 $helmet = $this->armorInventory->getHelmet();
512 if($helmet instanceof Armor){
513 $finalDamage = $source->getFinalDamage();
514 $this->damageItem($helmet, (int) round($finalDamage * 4 + Utils::getRandomFloat() * $finalDamage * 2));
515 $this->armorInventory->setHelmet($helmet);
526 $durabilityRemoved = (int) max(floor($damage / 4), 1);
528 $armor = $this->armorInventory->getContents();
529 foreach($armor as $slotId => $item){
530 if($item instanceof
Armor){
531 $oldItem = clone $item;
532 $this->damageItem($item, $durabilityRemoved);
533 if(!$item->equalsExact($oldItem)){
534 $this->armorInventory->setItem($slotId, $item);
540 private function damageItem(Durable $item,
int $durabilityRemoved) : void{
541 $item->applyDamage($durabilityRemoved);
542 if($item->isBroken()){
543 $this->broadcastSound(new ItemBreakSound());
547 public function attack(EntityDamageEvent $source) : void{
548 if($this->noDamageTicks > 0 && $source->getCause() !== EntityDamageEvent::CAUSE_SUICIDE){
552 if($this->effectManager->has(VanillaEffects::FIRE_RESISTANCE()) && (
553 $source->getCause() === EntityDamageEvent::CAUSE_FIRE
554 || $source->getCause() === EntityDamageEvent::CAUSE_FIRE_TICK
555 || $source->getCause() === EntityDamageEvent::CAUSE_LAVA
561 if($source->getCause() !== EntityDamageEvent::CAUSE_SUICIDE){
562 $this->applyDamageModifiers($source);
565 if($source instanceof EntityDamageByEntityEvent && (
566 $source->getCause() === EntityDamageEvent::CAUSE_BLOCK_EXPLOSION ||
567 $source->getCause() === EntityDamageEvent::CAUSE_ENTITY_EXPLOSION)
571 $base = $source->getKnockBack();
572 $source->setKnockBack($base - min($base, $base * $this->getHighestArmorEnchantmentLevel(VanillaEnchantments::BLAST_PROTECTION()) * 0.15));
575 parent::attack($source);
577 if($source->isCancelled()){
581 if($this->attackTime <= 0){
584 $this->attackTime = $source->getAttackCooldown();
586 if($source instanceof EntityDamageByChildEntityEvent){
587 $e = $source->getChild();
589 $motion = $e->getMotion();
590 $this->knockBack($motion->x, $motion->z, $source->getKnockBack(), $source->getVerticalKnockBackLimit());
592 }elseif($source instanceof EntityDamageByEntityEvent){
593 $e = $source->getDamager();
595 $deltaX = $this->location->x - $e->location->x;
596 $deltaZ = $this->location->z - $e->location->z;
597 $this->knockBack($deltaX, $deltaZ, $source->getKnockBack(), $source->getVerticalKnockBackLimit());
601 if($this->isAlive()){
602 $this->doHitAnimation();
606 if($this->isAlive()){
607 $this->applyPostDamageEffects($source);
611 protected function doHitAnimation() : void{
612 $this->broadcastAnimation(new HurtAnimation($this));
615 public function knockBack(
float $x,
float $z,
float $force = self::DEFAULT_KNOCKBACK_FORCE, ?
float $verticalLimit = self::DEFAULT_KNOCKBACK_VERTICAL_LIMIT) : void{
616 $f = sqrt($x * $x + $z * $z);
620 if(mt_rand() / mt_getrandmax() > $this->knockbackResistanceAttr->getValue()){
623 $motionX = $this->motion->x / 2;
624 $motionY = $this->motion->y / 2;
625 $motionZ = $this->motion->z / 2;
626 $motionX += $x * $f * $force;
628 $motionZ += $z * $f * $force;
630 $verticalLimit ??= $force;
631 if($motionY > $verticalLimit){
632 $motionY = $verticalLimit;
635 $this->setMotion(
new Vector3($motionX, $motionY, $motionZ));
640 $ev = new
EntityDeathEvent($this, $this->getDrops(), $this->getXpDropAmount());
642 foreach($ev->getDrops() as $item){
643 $this->getWorld()->dropItem($this->location, $item);
647 $this->getWorld()->dropExperience($this->location, $ev->getXpDropAmount());
649 $this->startDeathAnimation();
653 if($this->deadTicks < $this->maxDeadTicks){
654 $this->deadTicks += $tickDiff;
655 if($this->deadTicks >= $this->maxDeadTicks){
656 $this->endDeathAnimation();
660 return $this->deadTicks >= $this->maxDeadTicks;
663 protected function startDeathAnimation() : void{
664 $this->broadcastAnimation(new DeathAnimation($this));
667 protected function endDeathAnimation() : void{
668 $this->despawnFromAll();
671 protected function entityBaseTick(
int $tickDiff = 1) : bool{
672 Timings::$livingEntityBaseTick->startTiming();
674 $hasUpdate = parent::entityBaseTick($tickDiff);
676 if($this->isAlive()){
677 if($this->effectManager->tick($tickDiff)){
681 if($this->isInsideOfSolid()){
683 $ev =
new EntityDamageEvent($this, EntityDamageEvent::CAUSE_SUFFOCATION, 1);
687 if($this->doAirSupplyTick($tickDiff)){
691 foreach($this->armorInventory->getContents() as $index => $item){
692 $oldItem = clone $item;
693 if($item->onTickWorn($this)){
695 if(!$item->equalsExact($oldItem)){
696 $this->armorInventory->setItem($index, $item);
702 if($this->attackTime > 0){
703 $this->attackTime -= $tickDiff;
706 Timings::$livingEntityBaseTick->stopTiming();
711 protected function move(
float $dx,
float $dy,
float $dz) : void{
712 $oldX = $this->location->x;
713 $oldZ = $this->location->z;
715 parent::move($dx, $dy, $dz);
717 $frostWalkerLevel = $this->getFrostWalkerLevel();
718 if($frostWalkerLevel > 0 && (abs($this->location->x - $oldX) > self::MOTION_THRESHOLD || abs($this->location->z - $oldZ) > self::MOTION_THRESHOLD)){
719 $this->applyFrostWalker($frostWalkerLevel);
723 protected function applyFrostWalker(
int $level) : void{
724 $radius = $level + 2;
725 $world = $this->getWorld();
727 $baseX = $this->location->getFloorX();
728 $y = $this->location->getFloorY() - 1;
729 $baseZ = $this->location->getFloorZ();
731 $liquid = VanillaBlocks::WATER();
732 $targetBlock = VanillaBlocks::FROSTED_ICE();
733 if(EntityFrostWalkerEvent::hasHandlers()){
734 $ev =
new EntityFrostWalkerEvent($this, $radius, $liquid, $targetBlock);
736 if($ev->isCancelled()){
739 $radius = $ev->getRadius();
740 $liquid = $ev->getLiquid();
741 $targetBlock = $ev->getTargetBlock();
744 for($x = $baseX - $radius; $x <= $baseX + $radius; $x++){
745 for($z = $baseZ - $radius; $z <= $baseZ + $radius; $z++){
746 $block = $world->getBlockAt($x, $y, $z);
748 !$block->isSameState($liquid) ||
749 $world->getBlockAt($x, $y + 1, $z)->getTypeId() !== BlockTypeIds::AIR ||
750 count($world->getNearbyEntities(AxisAlignedBB::one()->offsetCopy($x, $y, $z))) !== 0
754 $world->setBlockAt($x, $y, $z, $targetBlock);
759 public function getFrostWalkerLevel() : int{
760 return $this->frostWalkerLevel ??= $this->armorInventory->getBoots()->
getEnchantmentLevel(VanillaEnchantments::FROST_WALKER());
767 $ticks = $this->getAirSupplyTicks();
769 if(!$this->canBreathe()){
770 $this->setBreathing(
false);
772 if(($respirationLevel = $this->armorInventory->getHelmet()->getEnchantmentLevel(VanillaEnchantments::RESPIRATION())) <= 0 ||
773 Utils::getRandomFloat() <= (1 / ($respirationLevel + 1))
778 $this->onAirExpired();
781 }elseif(!$this->isBreathing()){
782 if($ticks < ($max = $this->getMaxAirSupplyTicks())){
783 $ticks += $tickDiff * 5;
787 $this->setBreathing(
true);
791 if($ticks !== $oldTicks){
792 $this->setAirSupplyTicks($ticks);
795 return $ticks !== $oldTicks;
802 return $this->effectManager->has(
VanillaEffects::WATER_BREATHING()) || $this->effectManager->has(
VanillaEffects::CONDUIT_POWER()) || !$this->isUnderwater();
809 return $this->breathing;
817 $this->breathing = $value;
818 $this->networkPropertiesDirty =
true;
826 return $this->breathTicks;
833 $this->breathTicks = $ticks;
834 $this->networkPropertiesDirty =
true;
841 return $this->maxBreathTicks;
848 $this->maxBreathTicks = $ticks;
849 $this->networkPropertiesDirty =
true;
881 public function getLineOfSight(
int $maxDistance,
int $maxLength = 0, array $transparent = []) : array{
882 if($maxDistance > 120){
886 if(count($transparent) === 0){
893 foreach(VoxelRayTrace::inDirection($this->location->add(0, $this->size->getEyeHeight(), 0), $this->getDirectionVector(), $maxDistance) as $vector3){
894 $block = $this->getWorld()->getBlockAt($vector3->x, $vector3->y, $vector3->z);
895 $blocks[$nextIndex++] = $block;
897 if($maxLength !== 0 && count($blocks) > $maxLength){
898 array_shift($blocks);
902 $id = $block->getTypeId();
904 if($transparent ===
null){
905 if($id !== BlockTypeIds::AIR){
909 if(!isset($transparent[$id])){
923 $line = $this->getLineOfSight($maxDistance, 1, $transparent);
924 if(count($line) > 0){
925 return array_shift($line);
936 $xDist = $target->x - $this->location->x;
937 $zDist = $target->z - $this->location->z;
939 $horizontal = sqrt($xDist ** 2 + $zDist ** 2);
940 $vertical = $target->y - ($this->location->y + $this->getEyeHeight());
941 $pitch = -atan2($vertical, $horizontal) / M_PI * 180;
943 $yaw = atan2($zDist, $xDist) / M_PI * 180 - 90;
948 $this->setRotation($yaw, $pitch);
952 parent::sendSpawnPacket($player);
954 $networkSession = $player->getNetworkSession();
955 $networkSession->getEntityEventBroadcaster()->onMobArmorChange([$networkSession], $this);
959 parent::syncNetworkData($properties);
961 $visibleEffects = [];
962 foreach ($this->effectManager->all() as $effect) {
963 if (!$effect->isVisible() || !$effect->getType()->hasBubbles()) {
966 $visibleEffects[EffectIdMap::getInstance()->toId($effect->getType())] = $effect->isAmbient();
970 ksort($visibleEffects, SORT_NUMERIC);
973 $packedEffectsCount = 0;
974 foreach ($visibleEffects as $effectId => $isAmbient) {
975 $effectsData = ($effectsData << 7) |
976 (($effectId & 0x3f) << 1) |
977 ($isAmbient ? 1 : 0);
979 if (++$packedEffectsCount >= 8) {
983 $properties->setLong(EntityMetadataProperties::VISIBLE_MOB_EFFECTS, $effectsData);
985 $properties->setShort(EntityMetadataProperties::AIR, $this->breathTicks);
986 $properties->setShort(EntityMetadataProperties::MAX_AIR, $this->maxBreathTicks);
988 $properties->setGenericFlag(EntityMetadataFlags::BREATHING, $this->breathing);
989 $properties->setGenericFlag(EntityMetadataFlags::SNEAKING, $this->sneaking);
990 $properties->setGenericFlag(EntityMetadataFlags::SPRINTING, $this->sprinting);
991 $properties->setGenericFlag(EntityMetadataFlags::GLIDING, $this->gliding);
992 $properties->setGenericFlag(EntityMetadataFlags::SWIMMING, $this->swimming);
996 $this->armorInventory->removeAllWindows();
997 $this->effectManager->getEffectAddHooks()->clear();
998 $this->effectManager->getEffectRemoveHooks()->clear();
1004 $this->effectManager
1006 parent::destroyCycles();