Minecraft – My /fill command won’t work!

minecraft-commandsminecraft-java-edition

I'm building my house, and it uses petrified oak slabs on the upper part of the block. When I type in /fill 25 73 -355 -6 73 -324 petrified_oak_slab , it fills it a half of a block lower. When I tried /fill 25 73.5 -355 -6 73.5 -324 petrified_oak_slab, it tells me that the syntax is wrong. I don't have WorldEdit, or anything like that, and I don't want to fill it manually.

Can anyone help me with this issue?

Best Answer

Block placement commands don't accept decimals for numerical inputs, as blocks always use the full block for their position. They can have a smaller hitbox or visual size using data tags. In your example, slabs have the available tags of waterlogged (in 1.13+) and type. Waterlogged can be set to true or false, and type can be set to bottom or top, defaulting to bottom. In your example, to get the top half of the slab, you take the command

/fill 25 73 -355 -6 73 -324 petrified_oak_slab

And add the desired data tags to the end in square brackets ([])

/fill 25 73 -355 -6 73 -324 petrified_oak_slab[type:top]

If you wanted more data tags, they would be separated by commas

/fill 25 73 -355 -6 73 -324 petrified_oak_slab[type:top,waterlogged:true]

Data tags can be used to control many other blocks, such as stairs, anvils, chests, logs, vines, and just about everything else that isn't just a simple block. You probably don't want to waterlog your roof, though.