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

Mob spawners do not test if the entity to spawn collides after calling onInitialSpawn

    XMLWordPrintable

    Details

    • Confirmation Status:
      Confirmed
    • Category:
      (Unassigned)

      Description

      Based on 1.11.2 decompiled using MCP 9.35 rc1

      The bug

      Mob spawners do not test if the entity to spawn collides after calling net.minecraft.entity.EntityLiving.onInitialSpawn(DifficultyInstance, IEntityLivingData) (respectively the methods overriding it). This could result in mobs suffocating if the method onInitialSpawn changed their position.

      Note: For naturally spawned mobs this is tested.

      How to reproduce

      Currently blocked by MC-111747

      1. Setup a repeating command block and a chain command block behind it
        /scoreboard players tag @e[type=zombie,r=20] add babyZombie {IsBaby:1b}
        
        /tp @e[type=zombie,r=20,tag=!babyZombie] ~ -256 ~
        
      2. Encase a chicken in a 1 high space near the command blocks
      3. Use the following command to place a mob spawner
        /setblock ~ ~ ~ mob_spawner default replace {MaxSpawnDelay:0s,MinSpawnDelay:0s,SpawnCount:255s,RequiredPlayerRange:16s,SpawnRadius:1s,MaxNearbyEntities:255s,SpawnData:{id:"zombie"}}
        

        → At some point a baby zombie starts riding the chicken even if there is not enough space above causing the zombie to suffocate

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              marcono1234 [Mod] Marcono1234
            • Votes:
              2 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                CHK: