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

Certain mobs cause log error spam in Mob Spawners

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Invalid
    • None
    • 1.16.1
    • None
    • Windows 10, Java 8
    • Unconfirmed
    • (Unassigned)

      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.

       

       

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

              Created:
              Updated:
              Resolved: