-
Bug
-
Resolution: Unresolved
-
None
-
20w51a, 21w03a, 21w05a, 21w05b, 21w06a, 21w07a, 21w08b, 21w10a, 21w14a, 21w17a, 21w19a, 21w20a, 1.17 Pre-release 1, 1.17 Release Candidate 1, 1.17, 1.17.1 Pre-release 1, 1.17.1, 21w38a, 1.18, 1.18.1, 1.18.2, 22w14a, 22w17a, 1.19, 1.19.2, 1.19.3, 1.19.4, 23w14a, 1.20.1, 1.20.4, 23w51b, 1.20.6, 1.21 Pre-Release 3, 1.21, 1.21.3
-
Confirmed
-
Game Events
-
Low
-
Gameplay
The Bug:
Sculk sensors are not activated upon pufferfish changing their puff state.
Steps to Reproduce:
- Build the setup as shown in the attachment below. setup.png
- Summon a pufferfish in the water and switch into survival mode.
- Slowly approach the pufferfish to make it puff, and watch the sculk sensor closely as you do this.
- Take note as to whether or not sculk sensors are activated upon pufferfish changing their puff state.
Observed Behavior:
Sculk sensors aren't activated.
Expected Behavior:
Sculk sensors would be activated.
Code Analysis:
Code analysis by Avoma can be found below.
The following is based on a decompiled version of Minecraft 1.18.2 using MCP-Reborn.
public class Pufferfish extends AbstractFish { ... public void tick() { if (!this.level.isClientSide && this.isAlive() && this.isEffectiveAi()) { if (this.inflateCounter > 0) { if (this.getPuffState() == 0) { this.playSound(SoundEvents.PUFFER_FISH_BLOW_UP, this.getSoundVolume(), this.getVoicePitch()); this.setPuffState(1); } else if (this.inflateCounter > 40 && this.getPuffState() == 1) { this.playSound(SoundEvents.PUFFER_FISH_BLOW_UP, this.getSoundVolume(), this.getVoicePitch()); this.setPuffState(2); } ++this.inflateCounter; } else if (this.getPuffState() != 0) { if (this.deflateTimer > 60 && this.getPuffState() == 2) { this.playSound(SoundEvents.PUFFER_FISH_BLOW_OUT, this.getSoundVolume(), this.getVoicePitch()); this.setPuffState(1); } else if (this.deflateTimer > 100 && this.getPuffState() == 1) { this.playSound(SoundEvents.PUFFER_FISH_BLOW_OUT, this.getSoundVolume(), this.getVoicePitch()); this.setPuffState(0); } ++this.deflateTimer; } } super.tick(); } ...
If we look at the above class, we can see that pufferfish changing their puff states 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.
- is duplicated by
-
MC-273032 Pufferfish Inflates/Deflates Sound isn't Detected by Sculk Sensor nor Calibrated Sculk Sensor
- Resolved