{{about|the invisible block in current versions|the similar block used in old worlds in Bedrock Edition|Invisible Bedrock|the enchantment in ''Minecraft Dungeons''|Minecraft Dungeons:Barrier|barrier at the edge of the world|World border}}
{{Block
| image = <gallery>
Barrier (held).png | Block
Barrier (shown).png| "Shown"
Barrier (held shown).png | Held "Shown"
</gallery>
| transparent = Partial (lets light pass through)
| tntres = 3600000.8
| hardness = -1
| light = No
| tool = N/A
| renewable = No
| stackable = Yes (64)
| flammable = No
| lavasusceptible = No
| rarity = Epic
}}
'''Barrier''' is an [[invisible block]] used to create solid boundaries.

== Obtaining ==
Barriers can be obtained only using commands such as {{cmd|give}}, {{cmd|item}} on Java Edition, and {{cmd|replaceitem}} on Bedrock Edition and cannot be broken in survival mode.

{{IN|Java}}, barriers are available in the creative inventory when the "Operator Items Tab" is enabled in control settings.

=== Natural generation ===
In normal worlds, barriers don't generate naturally. They only generate in [[debug mode]] worlds, where barriers generate as the floor exclusively on Java Edition as the Debug mode world type is not on Bedrock Edition. However, due to a glitch, barrier blocks used to generate on Java Edition snapshot 20w16a in [[Bastion Remnant|Treasure Room Bastion Remnants]], specifically in Lava pools.

== Usage ==
Barrier blocks are mainly used to build an impenetrable barrier that cannot be broken in standard survival mode play but can be placed in survival. For example, they can be used to protect a reserved area from entry by players, mobs, and other entities. Unlike other kinds of unbreakable blocks that could be used for this purpose (such as [[bedrock]]), barrier blocks are unobtrusive because they are invisible. Barrier blocks cannot be destroyed by [[TNT]], [[creeper]] explosions, or any other explosions.

In the player's [[inventory]], the block is displayed as a red box with a slash through it, but when placed it is completely invisible.

Barriers are transparent to light and do not block a [[beacon]]. [[Fence]]s, [[iron bars]], [[glass pane]]s, and similar blocks do not visually connect with barriers. Barriers interact with blocks and mobs as a solid block. All dependent blocks can be placed on a barrier, such as [[torch]]es or [[redstone]], and it can suffocate mobs. Mobs cannot spawn on barriers. The red cross texture, however, is revealed as particle effects when falling or sprinting on them, regardless of what game mode the player is in.

In [[Creative]] mode, if a player is holding a barrier block in their hand, all placed barrier blocks display the barrier icon as a [[particle]]. This effect is client-side, and if a player holds a barrier block in survival, the particle does not appear. Barrier blocks are not shown if the particle setting is set to "minimal". Furthermore, they have a greater amount of blast resistance than any other unbreakable block.

<gallery>
Barrier Outline Box.png
Barrier Outline Box (held).png
</gallery>

Barrier blocks can be waterlogged by being placed into water source blocks on Bedrock Edition. See [[waterlogging]] for more details on what blocks can be waterlogged.

Barrier blocks are the most resistant blocks in Minecraft.

=== Piston interactivity ===
Barriers cannot be pushed by [[piston]]s. They also cannot be pushed nor pulled by [[sticky piston]]s.

== Sounds ==
{{Sound table/Block/Normal}}

== Data values ==
=== ID ===
{{edition|java}}:
{{ID table
|edition=java
|showblocktags=y
|showforms=y
|generatetranslationkeys=y
|displayname=Barrier
|spritetype=block
|nameid=barrier
|blocktags=dragon_immune, wither_immune
|foot=1}}

{{edition|bedrock}}:
{{ID table
|edition=bedrock
|shownumericids=y
|showforms=y
|generatetranslationkeys=y
|displayname=Barrier
|spritetype=block
|nameid=barrier
|id=416
|foot=1}}

<div style="text-align:center"></div>

== History ==
{{info needed section|Did sprinting on or punching (without breaking) barriers ever create particles in java?}}
{{History|java}}
{{History||1.8|snap=January 30, 2014|slink={{tweet|_grum|428874685418602496}}|[[Grum]] posted about an invisible block.}}
{{History|||snap=14w05a|[[File:Barrier JE1 BE1.png|32px]] Added barriers.}}
{{History|||snap=14w06a|Barriers now use [[block of redstone]] breaking [[particles]] instead of [[lava]].
|A barrier particle effect has been added to the particle [[commands|command]]. With this, the [[player]] can now see where there are barriers.}}
{{History|||snap=14w06b|Barriers are now visible when holding the [[item]] in [[creative]] mode.}}
{{History|||snap=14w20a|[[Wither]]s and [[ender dragon]]s can no longer [[breaking|break]] barriers.}}
{{History|||snap=14w25a|[[File:Missing Model (inventory) JE1.png|32px]] The barrier [[Missing model|no longer has an item model]].
|[[File:Missing Texture JE3.png|32px]] Barriers now display the [[missing texture]] as a particle when held.
|Barriers now also use the missing texture for usual block particles, for example when broken.}}
{{History|||snap=14w25b|The barrier has an item model again.<ref name="bug">{{bug|MC-57041}}</ref>
|Barriers now display the expected texture as a particle when held.<ref name="bug"/>}}
{{History|||snap=14w26a|Barriers now use the barrier item texture for particles, fixing the missing texture use.<ref>{{bug|MC-57883}}</ref>}}
{{History|||snap=release|Barriers can now be [[breaking|broken]] by [[wither]]s, once again.}}
{{History||1.8.1|snap=pre3|Withers no longer break barriers.}}
{{History||1.13|snap=17w47a|Prior to [[1.13/Flattening|''The Flattening'']], this block's numeral ID was 166.}}
{{History||1.14|snap=18w43a|[[File:Barrier JE2 BE2.png|32px]] The texture of barriers has been changed.}}
{{History||1.16|snap=20w16a|Barrier blocks now generate naturally within Treasure room [[Bastion Remnant|bastion remnants]].}}
{{History||1.16|snap=20w17a|Barrier blocks no longer generate naturally within Treasure room [[Bastion Remnant|bastion remnants]].}}
{{History||1.17|snap=21w20a|[[File:Barrier (shown) JE1.png|32px]][[File:Barrier Outline Box (shown) JE1.png|32px]] Barriers are now revealed by save-mode [[structure block]]s.<ref>{{bug|MC-102220}}</ref>}}
{{History||1.19.3|snap=22w42a|Barriers no longer emit block particles when broken.<ref>{{bug|MC-221568}}</ref>}}
{{History|||snap=22w44a|Barriers are now available in the creative inventory, but only if cheats are enabled.}}
{{History|||snap=22w45a|Moved barriers behind the Operator Utilities tab in the creative inventory. The tab is only available if cheats are enabled and the "Operator Items Tab" option in the controls menu is turned on.}}
{{History||1.20.2|snap=23w31a|Barriers can now be [[waterlogging|waterlogged]] by players in Creative mode.
|Barriers can no longer produce [[particles]] when fallen onto<ref>{{bug|MC-122547||Barriers can produce fall particles|Fixed}}</ref> or [[brush]]ed<ref>{{bug|MC-260085||Particles are created when using a brush on a barrier|Fixed}}</ref>.}}

{{History|bedrock}}
{{History||1.6.0|snap=beta 1.6.0.1|[[File:Barrier JE1 BE1.png|32px]] Added barriers.}}
{{History||1.10.0|snap=beta 1.10.0.3|[[File:Barrier JE2 BE2.png|32px]] The texture of barriers has been changed.}}

{{History|console}}
{{History||xbox=TU31|xbone=CU19|ps=1.22|wiiu=Patch 3|[[File:Barrier JE1 BE1.png|32px]] Added barriers.}}
{{History|PS4}}
{{History||1.90|[[File:Barrier JE2 BE2.png|32px]] The texture of barriers has been changed.}}
{{History|foot}}

== Issues ==

{{issue list}}

== Trivia ==
* The symbol used is not compliant with [[Wikipedia:ISO 3864-1|ISO 3864-1]], as the diagonal line is mirrored.<ref>{{bug|MC-64322|resolution=WAI}}</ref>
* [[Invisible bedrock]], a [[technical block]] {{in|be}}, shares many features with the barrier block.
* The barrier's vanilla block model defines only what texture to use for block breaking particles, and doesn't have a parent model or anything that would give the block a physical shape.
* Barriers are hardcoded to not render any block model.<ref>{{bug|MC-131775}}</ref>

== Gallery ==
<gallery>
Barrier Redstone.png|Barriers support any block, and can transmit a redstone signal.
Wizard pig.png|A pig standing on a barrier.
Indebugmode.png|Barriers in [[debug mode]].
1.8 Dev Barrier.png|Dev image of barriers.
Grum Barriers.png|Dev image of barriers.
</gallery>

== References ==

{{reflist}}

{{Blocks|command}}

[[cs:Bariéra]]
[[de:Barriere]]
[[es:Barrera]]
[[fr:Barrière invisible]]
[[ja:バリアブロック]]
[[ko:방벽]]
[[nl:Barrière]]
[[pl:Bariera]]
[[pt:Barreira]]
[[ru:Барьер]]
[[uk:Бар’єр]]
[[zh:屏障]]
