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.

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.

About Barrier in Minecraft

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.

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.

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