Do you know what a barrier block is? This post will tell you!
Barrier blocks can only be obtained in creative mode. To get one, use the command /give @s barrier. A barrier block should appear in your inventory. Barrier blocks are indestructable, invisible, and
you can’t walk through them. They are commonly used for adventure maps, and are great for for creating invisible walls to block mobs. Holding a barrier block allows you to see all the barrier blocks nearby.