mojira.dev
MC-197267

Guardians fail to make flopping sounds if they aren't centered on a solid block

If a guardian doesn't land centered on a solid block, it won't make a flopping noise. This most often happens when an elder guardian flops on a hill, or when guardians flop on top of stacked carpets.

Related issues

Attachments

Comments

migrated
[media][media][media]
[Mod] markderickson

Hi there!

I can confirm for 1.16.2pr3.

Avoma

Can confirm in 20w51a.

Avoma

Can confirm in 21w03a.

Avoma

Can confirm in 21w06a.

Avoma

Can confirm in 21w07a.

Avoma

Can confirm in 21w08b. Video attached.

Avoma

Can confirm in 21w11a.

Avoma

Can confirm in 21w14a.

Avoma

Can confirm in 1.17.

Avoma

Can confirm in 1.17.1.

Avoma

Can confirm in 1.18.1.

Avoma

Here's a code analysis of this issue. The following is based on a decompiled version of Minecraft 1.18.1 using MCP-Reborn.

Code Analysis:

net.minecraft.world.entity.monster.Guardian.java

public class Guardian extends Monster {
   ...
   public void aiStep() {
      if (this.isAlive()) {
         if (this.level.isClientSide) {
            this.clientSideTailAnimationO = this.clientSideTailAnimation;
            if (!this.isInWater()) {
               this.clientSideTailAnimationSpeed = 2.0F;
               Vec3 vec3 = this.getDeltaMovement();
               if (vec3.y > 0.0D && this.clientSideTouchedGround && !this.isSilent()) {
                  this.level.playLocalSound(this.getX(), this.getY(), this.getZ(), this.getFlopSound(), this.getSoundSource(), 1.0F, 1.0F, false);
               }

               this.clientSideTouchedGround = vec3.y < 0.0D && this.level.loadedAndEntityCanStandOn(this.blockPosition().below(), this);
            } ...

This issue stems from the above class. I'm not exactly sure what's causing it but I'm confident in saying that the problem exists within this particular piece of code.

Avoma

Can confirm in 1.18.2 and 22w12a.

Avoma

Can confirm in 1.19.

Avoma

Can confirm in 1.19.2.

gaspoweredpick

(Unassigned)

Confirmed

Gameplay

Low

Mob behaviour, Sound

1.16.1, 1.16.2 Pre-release 3, 1.16.2 Release Candidate 1, 1.16.2, 1.16.3, ..., 1.21, 1.21.1, 1.21.3, 1.21.4, 1.21.5 Release Candidate 1

Retrieved