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

Command block minecart data walker never runs due to comparing different types

XMLWordPrintable

    • Unconfirmed

      Command block minecarts have the following data walker:

      if ("minecraft:command_block".equals(new ResourceLocation(compound.getString("id"))))
      {
          compound.setString("id", "Control");
          fixer.process(FixTypes.BLOCK_ENTITY, compound, versionIn);
          compound.setString("id", "MinecartCommandBlock");
      }
      
      return compound;
      

      This will never run, because it is comparing a String constant with a resource location. (This issue was introduced in 18w01a). This is not an issue for spawner minecarts, which use if (Objects.equals("minecraft:spawner_minecart", (new ResourceLocation(s)).toString())).

      The code also seems to be using old (pre-1.11) IDs, which is incorrect; see MC-116928.

            fry [Mojang] Georgii Gavrichev
            pokechu22 [Mod] Pokechu22
            Votes:
            2 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: