mojira.dev
MCPE-20981

/fill replace doesn't work when metadata for replace isn't specified

In flat world, the command "/fill 0 6 0 20 6 20 glass 0 replace air" doesn't work, it just shows: Invalid syntax

Linked issues

Comments 5

Thank you for your report!
However, this issue has been closed as Working as Intended.

Remember not all differences between game versions/platforms of Minecraft are bugs.

You need to add a data value for the 'air', just as you did for the glass. This command should work then (replace the tildes for your chosen coordinates):
/fill ~ ~ ~ ~ ~ ~ glass 0 replace air 0

If you need help or have a suggestion you might like to follow the community support link below.

Quick Links:
📓 Issue Guidelines – 💬 Community Support – 📧 Feedback – 📖 Game Wiki

Reopening this issue, as the command should work without the data value at the end.

Revised title to be more descriptive.

Commenting on the part on why the data value is useful to not be included:

If someone, including custom map creators, wanted to replace all wool blocks in the affected with a different block (even air), they would have to do so currently by at least one command block per data value (16 if using all the colors) and then more logic if they need some execution to happen if any wool block was replaced (conditional part of a chained command block).

If you do keep it required, maybe have -1 be a wildcard for the data value of the block to replace?

@Katie Heart, Entering -1 data value for the air won't work. Example: /execute @e[type=arrow.skeleton] ~ ~ ~ detect ~ ~-1 ~ air -1 fill ~4 ~6 ~4 ~-4 ~ ~-4 air 0 destroy

this command won't work and when I enter this command in the command block and try to execute it, it says "invalid command". Before I update MCPE to 1.1.3 this command still work on my iPad Air 2. Fix it quick my world need commands!

John

(Unassigned)

63373

Confirmed

Tablet - Android - Lenovo A7

Android 5.1

/fill, command

1.1.0.0, 1.1.0.1, 1.1.0.9, 1.1.2.50, 1.1.3.1

1.2.0.11

Retrieved