mojira.dev
MC-48114

/fill and /setblock replace not working correctly with underscores.

When you're using /fill and you're replacing a specific block, you can't place a block with a name containing an underscore (_). In my case I was using this command:

/fill 952 38 1021 894 43 1029 piston_extension 0 replace lapis_ore

I got the following output: Data tag parsing failed: Unable to locate name/value separator for string: lapis_ore.

The command did work after replacing "piston_extension" with something like glass or stone, but it also didn't work with blocks like gold_block.

Linked issues

Attachments

Comments

Neospector

Cannot reproduce. See screenshots.
Please force a crash by pressing and holding F3+C for 10 seconds.

GrmpfhcGames

After restarting the game, it does work with any block but piston_extension.

Neospector

Block 36, correct? The invisible block?
You don't need it any more anyways, use "barrier".

GrmpfhcGames

It's indeed block 36, but in my case I want to have a block which you can't interact with and can't see, so the barrier can't be used for that unfortunately...

kumasasa

Edit: Nevermind.

entereloaded

yeah, this can get pretty anoying, i'll have to use a plot of /setblocks, until this works, (8^3 😛) hopefully this will get fixed soon also i hope the underscores work for setblock, if not i will post it here

entereloaded

Ok, I tested the thing for /setblock and it also doesnt work, pls add to Description

entereloaded

wow, Kumasasa, that was fast 😃

kumasasa

6 hours is not fast 😉

onnowhere

Confirmed in 14w21a and b.
This is quite an annoying issue...hope it gets resolved soon.
NOTE!
This also does not work for /setblock.

Something odd is that this occurs with some blocks but not others.
The error always occurs on the second block specified
Here is a sample of non working commands:
/setblock ~ ~-1 ~ command_block 0 replace gold_block
/setblock ~ ~-1 ~ command_block 0 replace air
/setblock ~ ~-1 ~ command_block 0 replace piston_extension

Oddly, this command does work however:
/setblock ~ ~-1 ~ gold_block 0 replace command_block

Edit: Scratch that setblock isn't used for replacing blocks with other blocks.

entereloaded

Hey Alex (:,
Is it possible that you mixed up the function of setblockreplace and fillreplace ?
As far as Im concerned, setblock replace just says that the new new blocl will be placed, no matter what, or am I wrong?

onnowhere

I can't fill replace with any tile entities either, like hoppers or chests. The error tells me "Data tag parsing failed: Invalid tag encountered, expected '{' as first char." Is this related or am I doing something wrong?

/fill ~ ~ ~ ~ ~ ~ hopper 0 replace air

Edit: I'm trying the examples now and they tell me this error "expected '{' as first char" instead of the "unable to locate value" error.

Does this have anything to do with how the format says to use [dataTag] at the end rather than specifying a block to replace with?
"/fill <x> <y> <z> <TileName> [dataValue] [oldBlockHandling] [dataTag]"

I tried various things after receiving the error. I thought it meant maybe I need to specify the block using a data tag, but I don't know if that's what it's saying. I tried "/fill ~ ~ ~ ~ ~ ~ hopper 0 replace {id:minecraft:stone}" but that does nothing and is just a normal replace with no specified block.

Another Edit: I think your right Markus. It seems like using /setblock with replace doesn't work because the replace just means to replace all blocks at the coordinate with the block, rather than replacing a certain block, as you said.

onnowhere

I think I figured out why this isn't working. Those blocks {command blocks, comparators, hoppers} when used with fill are expecting a dataTag rather than a block to replace, such as /fill ~ ~ ~ ~ ~ ~ command_block 0 replace {Command:"/say hi"}. And that's overriding the block replacing.

onnowhere

Wait...scratch everything I said... Searge said in MC-61864 that "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."

Sooo nevermind then ._.

Piston extensions are tile entities and maybe this bug is not really the underscore causing the problem but still tile entities like in MC-61864. Or they fixed the underscore problem and I don't know...

[Mod] redstonehelper

I can't reproduce this in 1.8, might be fixed.

entereloaded

I'll see if it works in 1.8 later today :]

entereloaded

Even if this bug got partly fixed as far as I see,
please reopen, at least it is still a bug for me 😞

/fill ~ ~ ~ ~ ~ ~ flower_pot 0 replace air
/fill ~ ~ ~ ~ ~ ~ piston_extension 0 replace lapis_ore
kumasasa

Reopened (MC-74388)

marcono1234

Cannot reproduce, MC-74388 is a wrong duplicate link

kumasasa

Also fixed.

entereloaded

So, I don't know if this is... like a not consistant bug or sth. buut this still does not work for me in 1.8.1:

/fill ~ ~ ~ ~ ~ ~ flower_pot 0 replace air
/fill ~ ~ ~ ~ ~ ~ piston_extension 0 replace lapis_ore"

Error Message:
"Data tag parsing failed: Invalid tag encountered, expected '{' as first char."

Note: It does not matter which block is at the position. Also both Commands always output completely the same

dagwoodland

I've got the same problem as Markus R, on 1.8.1.

Lee

This issue still exists in 1.8.2-pre1.

kasamikona

The issue is that the piston_extension block expects a data tag in the command, but you haven't given it one.

Maxwell Souza Carvalho

this bug happens because some blocks like flower_pot, chest, etc have data tags like {items:[]}
if you try to fill with those blocks, after replace you should specify the data tag of the block, instead the block you want to replace.

still is a bug, and should be fixed

qmagnet

This has nothing to do with underscores, as lapis_ore, sea_lantern and redstone_block all work for example.
This is caused because tile entities or block entities are not support in the replace command.
Searge explains it at MC-61864

This report should linked to that one.

kumasasa

Thanks. Relinked all duplicates of this ticket to MC-61864

GrmpfhcGames

(Unassigned)

Confirmed

Minecraft 14w06b, Minecraft 14w08a, Minecraft 14w10c, Minecraft 14w11b, Minecraft 14w20b, ..., Minecraft 14w30c, Minecraft 1.8, Minecraft 1.8.1-pre4, Minecraft 1.8.1, Minecraft 1.8.2-pre1

Retrieved