0

I need help. I am trying to make a map, and I tried to place all command blocks with NBT data in them, but its taking too long. Is there a way to only /fill in certain blocks? I tried this:

/fill 607.5 12 981.5 589.5 12 939.5 minecraft:command_block 0 replace command_block {Command:"/summon Item ~ ~-8 ~ {Item:{id:iron_nugget,Count:1}}"}

But this doesn't work. It says that its wrong. Can someone help me?

1

The /fill command implicitly splits syntax depending on whether the block you're filling in is a tile entity (blocks that hold extra data like chests, furnaces, or beacons). If you're not filling in a tile entity, you have the option to replace only certain blocks, e.g. /fill ~ ~ ~ ~3 ~3 ~3 stone 0 replace grass will only remove grass.

You're filling in command blocks, which are tile entities. Because of this (note that it's working as intended), you can only specify NBT after the replace argument, and don't have the option to replace only certain blocks.

So essentially, you can fill in a bunch of command blocks containing that command, but you can't only replace certain blocks while you do so. To do this, simply remove the second command_block from your command like so:

/fill 607.5 12 981.5 589.5 12 939.5 command_block 0 replace {Command:"/summon Item ~ ~-8 ~ {Item:{id:iron_nugget,Count:1}}"}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.