Uploaded image for project: 'Minecraft: Java Edition'
  1. Minecraft: Java Edition
  2. MC-251934

Sculk sensors are not activated upon frogs laying frogspawn

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • 23w06a
    • 1.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
    • Confirmed
    • Game Events
    • Normal

      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 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.

        1. MC-251934.mp4
          3.76 MB
        2. MC-251934.png
          MC-251934.png
          1.10 MB

            kingbdogz [Mojang] Brandon Pearce
            Avoma [Mod] Avoma
            Votes:
            10 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated:
              Resolved:
              CHK: