Pixel art illustration of a barrier icon, a red prohibition sign
Minecraft Java Item ID

Barrier ID

The barrier is an invisible, indestructible block used by map makers to wall off areas without affecting the view. It is only obtainable through commands and visible when held in Creative.

✓ Verified for Java Edition 1.21.11
Namespaced item ID minecraft:barrier

Barrier Item Facts

Maximum stack64
Available inCreative
Historical numerical ID166

Historical numerical ID: Reviewed for Java Edition 1.12.2 and earlier.

Give Command for Barrier

Copy the current Java Edition command, or open the generator to change the player and quantity.

/give @p minecraft:barrier 1

Customize this command →

Historical command for Java 1.12.2 and earlier

Modern namespaced IDs are recommended. This numerical form is only for old Java releases.

/give @p 166 1

Give command syntax by version

Java 1.13+
/give @p minecraft:barrier 1
Namespaced ID (current format)
Java 1.8–1.12.2
/give @p 166 1 0
Numerical ID + data value

Rows appear only when the underlying value is verified: the Java 1.8–1.12.2 row requires a reviewed historical numerical ID, and the Bedrock row appears only when this exact namespaced ID exists in the Bedrock registry.

How to Get Barrier

Finding Barrier

Barrier cannot be crafted at a crafting table. It must be obtained through normal gameplay.

Prefer commands? Jump back to the give command matrix above to get Barrier instantly.

Barrier in Minecraft: The Invisible Wall Block

Quick answer: Use minecraft:barrier in modern Java commands — /give @p minecraft:barrier is the only way to get it. Barriers are completely invisible and unbreakable in survival, used by map makers to wall off areas without blocking the view.

An invisible block you cannot break

The barrier is a creative-and-commands block: it does not exist in the survival inventory, and in survival mode it cannot be mined, blown up, or moved by pistons. It is invisible in play, blocks movement like bedrock, and only shows itself as a red crossed-circle icon when you hold a barrier item in your hand.

That combination — invisible, solid, indestructible — makes it the standard tool for map boundaries, invisible floors under jumps, invisible rails for minecart tracks, and keeping players out of areas without ugly walls.

  • Get it with /give @p minecraft:barrier — creative or commands only.
  • Unbreakable and invisible in survival and adventure mode.
  • Hold a barrier to see all nearby barriers as red icons.

Map-making patterns

Adventure maps use barriers for invisible ceilings over parkour, force fields around lobbies, and invisible walls guiding players along a path without fences. Because light passes through them, they do not create shadows like glass does.

For placing large barrier walls, the /fill command is the practical route: /fill with minecraft:barrier across two corners builds an invisible wall in one command. Remove it the same way with minecraft:air.

Build With Barrier

minecraft:barrier is in the reviewed block catalog. Open a command tool with this ID already selected, then adjust the coordinates in the tool.

Need a different material? Browse Minecraft Block IDs or compare the related blocks below.

Barrier Command Examples

  • Give 1 to nearest player: /give @p minecraft:barrier 1
  • Give 1 to yourself: /give @s minecraft:barrier 1
  • Give to a specific player: /give PlayerName minecraft:barrier 1
  • Clear from inventory: /clear @p minecraft:barrier

Barrier FAQ

What is the item ID for Barrier?

The item ID for Barrier is minecraft:barrier. Java Edition commands such as /give, /clear, and /setblock use this namespaced ID.

What is the numerical ID for Barrier?

Barrier has the historical numerical ID 166, used in Java Edition 1.12.2 and earlier. Current versions use minecraft:barrier instead.

How do I give myself Barrier in Minecraft?

Open the chat window and run /give @p minecraft:barrier 1 to give the nearest player one Barrier. Replace @p with a player name to target someone else.

How many Barrier can stack in one slot?

Barrier stacks up to 64 per inventory slot.

How do you get a barrier block in Minecraft?

Only with commands: /give @p minecraft:barrier, or pick it in Creative mode. It never drops and cannot be crafted.

How do you see barrier blocks?

Hold a barrier item in your hand — every barrier within range shows a red crossed-circle particle icon. Let go and they vanish again.

Can TNT or the wither break barriers?

No. Barriers are unbreakable by explosions, the wither, and ender dragons. Only Creative mode breaking or commands like /setblock and /fill remove them.

Sources and Data Review

Item facts were reviewed for Java Edition 1.21.11 on .

Related Natural Blocks

Item ID: minecraft:obsidian
Item ID: minecraft:netherrack
Item ID: minecraft:grass_block
Item ID: minecraft:dirt
Item ID: minecraft:coarse_dirt
Item ID: minecraft:podzol
Item ID: minecraft:oak_sapling
Item ID: minecraft:spruce_sapling