mojira.dev
MC-61864

/fill x1 y1 z1 x2 y2 z2 [tile entity] replace [block] gives parse error

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

MC-48114 /fill and /setblock replace not working correctly with underscores. MC-48285 "/fill ... replace ..." doesn't parse correctly for blocks that support data tags MC-50117 /fill with Flowerpots MC-50153 fill flowerpot 0 replace air not workin MC-50362 /fill cannot replace commandblocks,brewingstand, ect MC-50686 Command /fill xyz xyz minecraft:unpowered_comparator 0 replace minecraft:barrier Doesn't Work MC-50743 Minecraft /fill no block texture glitch (usually 50% of the time) MC-51035 "/fill x1 y1 z1 x2 y2 z2 end_portal 0 replace <BLOCK>" doesn't work ! MC-52370 - MC-55614 /fill with replace does not work with command blocks MC-61899 /fill with tile entities runs into failure when "replace" is added MC-63949 Problem with /fill and tile entities MC-68057 Can't replace any material with beaconblocks MC-72161 Fill replace with command block leads to error MC-73128 fill command! MC-74388 Cannot /fill replace with blocks that have tile entity data as the output MC-75528 Cannot /fill daylight_sensor replace block MC-77033 /clone /fill of tile entity (TE) over a TE renders the old TE MC-82342 fill command fails parsing MC-84454 Unable to /fill ... end_gateway 0 replace wool 11 MC-86595 Replace fill mode doesn't work with end_gateway MC-87022 Cannot use replace tag with /fill <tile entity> MC-90483 Fill bug MC-91632 Fill does not replace blocks that support data tags. MC-91885 fill command unable to fill blocks with long ids MC-94292 bug in the /fill command MC-97532 Replace air with command block error MC-99695 Fill command & chests MC-100009 cannot replace block with comparators MC-101906 Standing banner replacement bug MC-102925 /fill with command blocks doesn't work when you use replace MC-105134 Fill replace commands doesn't work with TileEntities MC-108056 Fill replace tag error MC-112237 /fill command does not work with replace subcommands and beacons as replacing block MC-114305 Problem with /fill [...] replace [...] and changing the data value of comparators MC-114434 /fill replace won't work MC-116467 Fill Bug MC-118525 fill replace mode broken MC-118680 /fill Command Doesn't Work When Using "replace" MC-120370 Can't use the /fill command to replace with blocks that have block entities MC-121206 /fill does not work with replace

Comments

Sebastian Grygiel

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.

kumasasa

That someone was me.
You're describing exactly the behaviour of MC-48114.

Sebastian Grygiel

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.

kumasasa

Sounds plausible. Reopened.

Anon Ymus

Confirmed.

Sebastian K

Still in 14w29b.

michael

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.

Sebastian K

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 🙂

KnightMiner

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.

Mikeware

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.

marcono1234

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>]]
TheMuffinPony

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 *.

11people5

Yeah, I'd have to agree that this is more of a "Won't Fix" rather than "Works as Intended".

Koa Neuva

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

Sebastian Grygiel

michael

Confirmed

Minecraft 14w28b, Minecraft 14w29a, Minecraft 14w29b, Minecraft 1.11.2

Retrieved