diff --git a/src/entity/Living.php b/src/entity/Living.php index 96922f200..febc3f1c2 100644 --- a/src/entity/Living.php +++ b/src/entity/Living.php @@ -262,14 +262,13 @@ abstract class Living extends Entity{ }else{ $fallBlockPos = $this->location->floor(); $fallBlock = $this->getWorld()->getBlock($fallBlockPos); - for( - ; - $fallBlock->getId() === BlockLegacyIds::AIR; - $fallBlockPos = $fallBlockPos->subtract(0, 1, 0), $fallBlock = $this->getWorld()->getBlock($fallBlockPos) - ){ - //this allows the correct sound to be played when landing in snow + if($fallBlock->getId() === BlockLegacyIds::AIR){ + $fallBlockPos = $fallBlockPos->subtract(0, 1, 0); + $fallBlock = $this->getWorld()->getBlock($fallBlockPos); + } + if($fallBlock->getId() !== BlockLegacyIds::AIR){ + $this->getWorld()->addSound($this->location, new EntityLandSound($this, $fallBlock)); } - $this->getWorld()->addSound($this->location, new EntityLandSound($this, $fallBlock)); } }