mojira.dev
MC-211165

Sculk sensors are not activated upon pandas sneezing

The Bug:

Sculk sensors are not activated upon pandas sneezing.

Steps to Reproduce:

  1. Summon multiple baby pandas that are likely to sneeze by using the command provided below multiple times.

    /summon minecraft:panda ~ ~ ~ {HiddenGene:"weak",MainGene:"weak",Age:-25000,attributes:[{id:"minecraft:movement_speed",base:0.0d}]}
  2. Place down a sculk sensor nearby and wait for one of the pandas to sneeze.

  3. Take note as to whether or not sculk sensors are activated upon pandas sneezing.

Observed Behavior:

Sculk sensors aren't activated.

Expected Behavior:

Sculk sensors would be activated.

Code Analysis:

Code analysis by @unknown can be found below.

The following is based on a decompiled version of Minecraft 1.18.2 using MCP-Reborn.

net.minecraft.world.entity.animal.Panda.java

public class Panda extends Animal {
   ...
   private void afterSneeze() {
      Vec3 vec3 = this.getDeltaMovement();
      this.level.addParticle(ParticleTypes.SNEEZE, this.getX() - (double)(this.getBbWidth() + 1.0F) * 0.5D * (double)Mth.sin(this.yBodyRot * ((float)Math.PI / 180F)), this.getEyeY() - (double)0.1F, this.getZ() + (double)(this.getBbWidth() + 1.0F) * 0.5D * (double)Mth.cos(this.yBodyRot * ((float)Math.PI / 180F)), vec3.x, 0.0D, vec3.z);
      this.playSound(SoundEvents.PANDA_SNEEZE, 1.0F, 1.0F);
      ...

If we look at the above class, we can see that pandas sneezing simply isn't registered as a game event as the gameEvent() method is never called, thus not detecting this action as a vibration.

Potential Fix:

Simply calling the gameEvent() method where appropriate within this piece of code should resolve this problem. I feel as if a new game event tag would be expected to be used here as none of the currently existing ones seem to fit this action accordingly.

Linked issues

Attachments

Comments 3

This is still an issue in 21w05a. I've updated this ticket accordingly.

Can confirm in 21w42a.

Avoma

(Unassigned)

Confirmed

Gameplay

Low

Game Events

panda, sculk_sensor

20w51a, 21w03a, 21w05a, 21w05b, 21w06a, , 1.19.4, 1.20.1, 1.21, 1.21.4, 1.21.7

Retrieved