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

Certain mobs cause log error spam in Mob Spawners

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Resolution: Invalid
    • Affects Version/s: 1.16.1
    • Fix Version/s: None
    • Labels:
      None
    • Environment:
      Windows 10, Java 8
    • Confirmation Status:
      Unconfirmed
    • Category:
      (Unassigned)

      Description

      The following code is using Yarn mappings.

      In 1.16.1, certain mobs cause log error spam in Mob Spawners. This includes any mob that implements the Angerable interface (Bee, Enderman, Iron Golem, Polar Bear, Wolf, Zombified Piglin).

      The full log can be found at https://pastebin.com/TjB4WNgz. This was taken over the course of about 2 seconds.

      The reason for this stems from the Angerable entity's readCustomDataFromTag method. Here's the Polar Bear's implementation, for example:

      public void readCustomDataFromTag(CompoundTag tag) {
         super.readCustomDataFromTag(tag);
         this.angerFromTag((ServerWorld)this.world, tag);
      }
      

      angerFromTag requires a ServerWorld, but the readCustomDataFromTag method is being called from client-context, leading to a casting exception.

      The full path rooting from the spawner is MobSpawnerLogic#getRenderedEntity -> EntityType#loadEntityWithPassengers -> EntityType#loadEntityFromTag -> EntityType#getEntityFromTag -> Entity#fromTag -> #Entity#readCustomDataFromTag.

       

       

        Attachments

          Activity

            People

            Assignee:
            Unassigned Unassigned
            Reporter:
            Draylar Draylar
            Votes:
            1 Vote for this issue
            Watchers:
            3 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: