Updated:

The list

ItemJava /giveUsed for
Barrier/give @s minecraft:barrierInvisible walls
Light block/give @s minecraft:lightInvisible light source
Debug stick/give @s minecraft:debug_stickChange block states (Java only)
Command block/give @s minecraft:command_blockRun commands automatically
Structure block/give @s minecraft:structure_blockSave and load builds
Structure void/give @s minecraft:structure_voidKeep original blocks when loading a build

On Bedrock you can drop the prefix, as in /give @s barrier.

Barrier: invisible walls

/give @s minecraft:barrier 64

Players and mobs cannot pass through a barrier, but nobody can see it. Use it to keep players on a parkour course or inside the playable part of a map. Hold a barrier in creative mode to see where they are placed. They cannot be broken in survival.

Light block: light without torches

Added in Java 1.17, it lights an area with nothing visible. The level goes from 0 to 15 and defaults to 15.

VersionLight block at level 10
Java 1.20.5+/give @s minecraft:light[minecraft:block_state={level:"10"}]
Java 1.17–1.20.4/give @s minecraft:light{BlockStateTag:{level:"10"}}

Right-click a placed light block while holding one to change its level. Placed light blocks only show a bulb icon while you hold the item. Bedrock has light blocks too, but the ID differs between versions, so follow the in-game suggestions.

Debug stick: change block states

/give @s minecraft:debug_stick

Java only. Left-click a block to choose a property such as facing or shape, then right-click to cycle its value. It lets you set stair shapes, fence connections or crop age after placing, without neighboring blocks changing them back.

Command block

/give @s minecraft:command_block

It runs the command written inside it, usually on a redstone signal. You need creative mode to edit it, and servers need enable-command-block=true in server.properties. The command block guide explains impulse, chain and repeating blocks.

Structure block and structure void

A structure block saves the blocks in an area under a name and loads them elsewhere; the saved size has a limit. Place structure voids inside the saved area to mark spots where the original blocks should stay when the structure loads.

When it does not work

Common questions

Check your command

The Command Error Doctor checks common syntax mistakes in your browser.