Uploaded image for project: 'Minecraft'
  1. Minecraft
  2. MC-109038

Spawner with missing "minecraft:" in entity id (or with not lowercased entity id) spawns this entity until you reload the world

    Details

    • Type: Bug
    • Status: Resolved
    • Resolution: Fixed
    • Affects Version/s: Minecraft 16w42a, Minecraft 16w43a, Minecraft 16w44a, Minecraft 1.11 Pre-Release 1, Minecraft 1.11
    • Fix Version/s: Minecraft 16w50a
    • Confirmation Status:
      Confirmed

      Description

      If you use the following commands (same happens if you change id:creeper to be id:minecraft:Creeper)

      /setblock ~ ~ ~ minecraft:mob_spawner 0 replace {SpawnData:{id:creeper}}
      /setblock ~ ~ ~ minecraft:mob_spawner 0 replace {SpawnPotentials:[{Entity:{id:creeper},Weight:1}]}

      you get 2 spawners, each of which has a pig inside and has default NBT data, but it works like the command has "minecraft:creeper" instead of "creeper" (the first spawner spawns creepers right away and the second one will do that after pigs spawn from it one time) This behavior fixes itself when you reload the world (spawners will spawn only pigs).

      Expected behavior

      1. Capitalization should not matter, for example minecraft:CreEper should be valid as well
      2. The restriction for the id should apply to reading and saving NBT, not only saving

      Code analysis

      The following is based on a decompiled version of Minecraft 16w43a using JD-GUI 1.4.0

      The method ajd.g() which does this check is only called when the NBT of a spawner is written and prevents writing any other tags as well, even if they are valid. In previous versions it tested if the id was empty or null. In general it might be better to replace the entry with the default (pig) instead of just skipping all other tags.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                grum [Mojang] Grum (Erik Broes)
                Reporter:
                SunCat [Mod] SunCat
              • Votes:
                5 Vote for this issue
                Watchers:
                6 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  CHK: