Mojira Archive
MC-251934

Sculk sensors are not activated upon frogs laying frogspawn

The Bug:

Sculk sensors are not activated upon frogs laying frogspawn.

Steps to Reproduce:

  1. Summon two frogs near some water.
  2. Breed the frogs and place down a sculk sensor nearby.
  3. Wait until one of the frogs lays frogspawn.
  4. Take note as to whether or not sculk sensors are activated upon frogs laying frogspawn.

Observed Behavior:

Sculk sensors aren't activated.

Expected Behavior:

Sculk sensors would be activated.

Code Analysis:

Code analysis by [Mod] Avoma can be found below.

The following is based on a decompiled version of Minecraft 1.19 Pre-release 2 using Mojang mappings.

net.minecraft.world.entity.ai.behavior.TryLaySpawnOnWaterNearLand.java
public class TryLaySpawnOnWaterNearLand extends Behavior<Frog> {
   private final Block spawnBlock;
   private final MemoryModuleType<?> memoryModule;
   ...
   @Override
   protected void start(ServerLevel serverLevel, Frog frog, long l) {
      BlockPos blockPos = frog.blockPosition().below();
      for (Direction direction : Direction.Plane.HORIZONTAL) {
         BlockPos blockPos2;
         BlockPos blockPos3 = blockPos.relative(direction);
         if (!serverLevel.getBlockState(blockPos3).is(Blocks.WATER) || !serverLevel.getBlockState(blockPos2 = blockPos3.above()).isAir()) continue;
         serverLevel.setBlock(blockPos2, this.spawnBlock.defaultBlockState(), 3);
         serverLevel.playSound(null, frog, SoundEvents.FROG_LAY_SPAWN, SoundSource.BLOCKS, 1.0f, 1.0f);
         frog.getBrain().eraseMemory(this.memoryModule);
         return;
      }
   }
   ...

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

Fixed

[Mod] Avoma

[Mojang] Brandon Pearce

2022-05-19, 04:17 PM

2023-02-07, 08:32 AM

2023-02-07, 08:32 AM

10

6

Confirmed

Normal

Game Events

sculk_sensor

1.19 Pre-release 1 - 1.19.31.19 Pre-release 1, 1.19 Pre-release 2, 1.19 Pre-release 5, 1.19 Release Candidate 2, 1.19, 1.19.1 Pre-release 2, 1.19.1, 1.19.2, 1.19.3

23w06a