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

Witches and illagers despawn faster than other monsters

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • None
    • 1.21.3
    • None
    • Confirmed
    • (Unassigned)

      Mobs are supposed to despawn in minimum 600 ticks in pitch black rooms. 
      If the room is lit, then they should despawn 3 times faster, so in 200 ticks.

      The issue I have here, is I have a Witch Hut farm, that is completely pitch black (lights levels of 0 everywhere) and witches are despawning after 200 GT.


      (carpet mod /lifetime tracker, just for illustration purposes. You can see the Randomly Despawns of witches is between 202 and 226 GT, which is ~10s, and not the expected 30s)

      I believe the issue is caused by  Raider#updateNoActionTime which always add +2 to the `noActionTime` variable, regardless of if the mob is in a raid or not. I believe it is missing a `if this.getCurrentRaid() != null` before incrementing the noActionTime and should default to `super` (which should hopefully delegate to Monster#updateNoActionTime, restoring the light level dependent behavior).

       

      This also means that other Illagers not spawned as part of a raid (but still inherit the Raider trait) will despawn faster than normal, so Pillager Tower Pillagers also despawn faster than they should.

       

      Steps to Reproduce :

      • make a pitch black room (lights level of 0). Use tinted glass so you can see through.
      • Disable natural mob spawning so natural spawns don't interfere with the experiment. /gamerule doMobSpawning false
      • Place the player at least 32 blocks from the dark room, but less than 128 blocks.
      • Spawn a Zombie inside the room and wait for it to despawn. The zombie will despawn after 30s mininmum. (/summon zombie ~ ~ ~32)
      • Try the same experiment but with a Witch. Or a Pillager. They can despawn after 10s only.

      Expected Behavior :

      All naturally spawned mobs have the same despawn timer.

      Actual Behavior :

      Mobs inheriting the `Raider` class are always despawning after 10s, regardless of if they are part of a raid or not, which seems to be unintended behavior.

       

      This affects Witch farms that where buffed in 1.21 as a response to patching Raid farms, but currently witches can despawn more easily that they should.

            Unassigned Unassigned
            Azyrod_ Azyrod_
            Votes:
            1 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              CHK: