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

Some passenger mobs don't count to the mob cap

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Resolution: Works As Intended
    • Affects Version/s: 20w19a
    • Fix Version/s: None
    • Confirmation Status:
      Confirmed
    • Category:
      (Unassigned)

      Description

      The bug

      Starting with 20w18a some mobs do not count to the mob cap anymore if they are a passenger (e.g. riding a minecart).

      The following mobs are not affected:

      • Mobs which can be part of a raid (e.g. witch)
      • Fish

      Reproduction steps

      1. Open the debug screen (F3)
        The following steps refer to the "M:" ("Monster") mob category shown in the line starting with "SC:" on the left below "Local difficulty:" and above "Sounds:".
      2. Spawn a husk
        The husk is counted for the "Monster" category
      3. Spawn a husk riding a minecart
        /summon minecart ~ ~ ~ {Passengers:[{id:husk}]}
        

        The husk is not counted

      4. Destroy the minecart
        Now the husk is counted

      Code analysis

      20w19a, Mojang names

      In 20w18a net.minecraft.world.entity.Mob.requiresCustomPersistence() was changed to return whether the mob is a passenger instead of always returning false. This might have been done to fix MC-178013, since this method is also used to determine whether a mob can despawn, but has the probably unintended side-effect described in this bug report.

      Additionally it is not consistent whether passenger mobs count to the mob cap, because the classes overriding requiresCustomPersistence() do not consider the parent result.

        Attachments

        1. 2020-05-07_09.46.10.png
          2020-05-07_09.46.10.png
          160 kB
        2. 2020-05-07_09.46.18.png
          2020-05-07_09.46.18.png
          174 kB
        3. 2020-05-07_09.46.27.png
          2020-05-07_09.46.27.png
          174 kB
        4. 2020-05-07_09.46.36.png
          2020-05-07_09.46.36.png
          170 kB

          Issue Links

            Activity

              People

              Assignee:
              Unassigned Unassigned
              Reporter:
              GoldenShooter23 Nick Gafurov
              Votes:
              11 Vote for this issue
              Watchers:
              11 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                CHK: