The problem occurs if running via command block and normally via chat.
Steps to reproduce the problem:
1. Place a command block with fill ~ ~1 ~ ~ ~1 ~ minecraft:unpowered_comparator 3 replace minecraft:diamond_block
2. Place a diamond block on top
3. Activate the command block
Expected behaviour:
The diamond block gets turned into comparator
Actual behaviour:
Error message
Data tag parsing failed: Invalid tag encountered, expected '{' as first char.
Additional information:
The command fill ~ ~1 ~ ~ ~1 ~ minecraft:unpowered_comparator 3
works.
It also works with block other than unpowered_comparator.
According to the wiki the command expects fill <x1> <y1> <z1> <x2> <y2> <z2> <TileName> <dataValue> replace [replaceTileName] [replaceDataValue]
.
Related issues
is duplicated by
Comments

That someone was me.
You're describing exactly the behaviour of MC-48114.
MC-48114 clearly states that the command doesn't work for any block with an underscore within its name. It points out in an example that it doesn't work for lapis_ore
. The error message clearly says that it began to parse lapis_ore
as json and cannot find key-value separator (:
).
This is different issue. I can confirm that this command works with lapis_ore
or several other blocks with an underscore within its name. The issue occurs only with unpowered_comparator
(out of tested blocks). The error message also says something different - it expects a json string but it doesn't start parsing it. It says that it expects { which is nowhere to be found.
Please, point me to a part that makes the issues similar apart from the command used and the fact that unpowered_comparator
actually contains an underscore and this has nothing to do with it as, at least in 14w28b, the command fill ~ ~1 ~ ~ ~1 ~ minecraft:unpowered_repeater 3 replace minecraft:diamond_block
works - the problem only occurs with unpowered_comparator
.

Sounds plausible. Reopened.
Confirmed.
Still in 14w29b.

Replacing blocks with tile entities is not supported, this is due to a limitation in the parsing of commands. It may be changed in the future, but not until after 1.8. This issue should be considered a feature request, not a bug.
ah ok... good to know. Maybe add an "tile entities are not allowed" text instead of "Data tag parsing failed: Invalid tag encountered, expected '{' as first char." to make it more clear until it may get added. But thanks anyway for the information. Now i have to find a workaround to this 🙂

Wouldn't a resolution of "Won't Fix" be more accurate? as this does prevent usage of a feature in the game in certain circumstances. Otherwise a clear indication in game of it not being supported would be necessary.
I was bashing my head around for a while trying to figure out why it wasn't working right. Certainly would be nice to see in the future at some point.

The suggested syntax is at least wrong:
/fill <x1> <y1> <z1> <x2> <y2> <z2> <name> [<data>] [replace [<FilterblockName> [<FilterblockMetadata>]]|destroy|keep|hollow|outline] [<NBT-Data>]
It should be:
/fill <x1> <y1> <z1> <x2> <y2> <z2> <name> [<data>] [replace [<FilterblockName> [<FilterblockMetadata>]]|replace|destroy|keep|hollow|outline [<NBT-Data>]]
Question: Can you revamp the command so that it is /fill <coordinates> <name> [dataValue|state] replace [<blockToReplace> [dataValue|-1|state|*]] [fillBlockDataTag]
?
(It is easy to detect a <code>{</code> vs a different character for starting an item technical name in my opinion)
So, if you wanted to replace wood planks with chests (with a bow inside) between 0, 0, 0 and 1, 1, 1, you would do {{/fill 0 0 0 1 1 1 chest 0 replace planks * {Items:[0:{Slot:0,Item:"minecraft:bow",Count:1b,Damage:0s}]} }}.
However, if you wanted to fill chests regardless of planks, you would remove the planks *
.

Yeah, I'd have to agree that this is more of a "Won't Fix" rather than "Works as Intended".
I found a way around it, but only if you want to target a specific block, not a group of blocks. You could probably make it target different things though to have the same effect as an "AOE."
/execute ~ ~ ~ detect ~ ~1 ~ minecraft:diamond_block /fill ~ ~1 ~ ~ ~1 ~ minecraft:unpowered_comparator 3 replace
Somebody attached a duplicate link to a different issue. I don't know how to remove the link.
The issue described there is affecting all blocks with underscore and it simply cannot find them.
This issue affects unpowered_comparator and not, for example, unpowered_repeater. The error message is completely different.