Autonomous Obstacle Navigator

Watch a glowing autonomous navigator weave through shifting neon barrier walls toward a moving beacon target using vanilla mob pathfinding AI.

Java EditionMobs & PetsHard24 commandsTested on a real 26.2 & 26.3 server
A glowing iron golem navigates an arena with shifting iron bar walls toward a teleporting beacon. Download the GIF Video & GIF © www.9minecraft.net

Custom MobsTechnologyCyanWhiteLearningMini-gameMap MakingBlock displaysArmor standsSummoned mobsBlock building (fill/setblock/clone)21+ commands

Building a pathfinding system from scratch in vanilla Minecraft usually takes hundreds of command blocks, unless you let the game's own AI do the math for you. This creation drops a custom glowing navigator onto a neon arena where iron barrier walls shift positions every few seconds and the target beacon teleports around the room.

By placing an invisible lure at the goal and letting an iron golem's built-in obstacle avoidance take the wheel, the navigator smoothly calculates real-time routes around the shifting walls while leaving a bright cyan trail behind it.

1. Setup - type these once 10 commands

  1. /scoreboard objectives add c9_timer dummy
  2. /fill ~-9 ~-1 ~-9 ~9 ~-1 ~9 minecraft:polished_deepslate
  3. /fill ~-9 ~ ~-9 ~9 ~1 ~9 minecraft:sea_lantern hollow
  4. /fill ~-8 ~ ~-8 ~8 ~1 ~8 minecraft:air
  5. /fill ~-3 ~ ~-8 ~-3 ~1 ~2 minecraft:iron_bars
  6. /fill ~3 ~ ~-2 ~3 ~1 ~8 minecraft:iron_bars
  7. /summon minecraft:armor_stand ~6 ~ ~6 {Tags:["c9_entity","c9_goal"],Invisible:1b,NoGravity:1b,Marker:1b}
  8. /summon minecraft:block_display ~6 ~ ~6 {Tags:["c9_entity","c9_goal_vis"],Glowing:1b,glow_color_override:65535,block_state:{Name:"minecraft:beacon"},transformation:{translation:[-0.4f,0.1f,-0.4f],scale:[0.8f,0.8f,0.8f],left_rotation:[0f,0f,0f,1f],right_rotation:[0f,0f,0f,1f]}}
  9. /summon minecraft:iron_golem ~-6 ~ ~-6 {Tags:["c9_entity","c9_nav"],CustomName:{"text":"Navigator","color":"aqua"},CustomNameVisible:1b,Glowing:1b,Invulnerable:1b,Silent:1b,attributes:[{id:"minecraft:movement_speed",base:0.38d},{id:"minecraft:scale",base:0.55d},{id:"minecraft:follow_range",base:48.0d}]}
  10. /summon minecraft:zombie ~6 ~ ~6 {Tags:["c9_entity","c9_lure"],Silent:1b,Invulnerable:1b,NoAI:1b,NoGravity:1b,active_effects:[{id:"minecraft:invisibility",amplifier:0,duration:-1,show_particles:0b}],attributes:[{id:"minecraft:scale",base:0.2d}]}

2. Loop - one repeating command block each (Always Active) 14 commands

  1. /scoreboard players add #tick c9_timer 1
  2. /execute if score #tick c9_timer matches 160.. run scoreboard players set #tick c9_timer 0
  3. /execute if score #tick c9_timer matches 1 run fill ~-8 ~ ~-8 ~8 ~1 ~8 minecraft:air replace minecraft:iron_bars
  4. /execute if score #tick c9_timer matches 1 run fill ~-3 ~ ~-8 ~-3 ~1 ~2 minecraft:iron_bars keep
  5. /execute if score #tick c9_timer matches 1 run fill ~3 ~ ~-2 ~3 ~1 ~8 minecraft:iron_bars keep
  6. /execute if score #tick c9_timer matches 1 run tp @e[tag=c9_goal,limit=1] ~6 ~ ~6
  7. /execute if score #tick c9_timer matches 81 run fill ~-8 ~ ~-8 ~8 ~1 ~8 minecraft:air replace minecraft:iron_bars
  8. /execute if score #tick c9_timer matches 81 run fill ~-8 ~ ~-2 ~2 ~1 ~-2 minecraft:iron_bars keep
  9. /execute if score #tick c9_timer matches 81 run fill ~-2 ~ ~3 ~8 ~1 ~3 minecraft:iron_bars keep
  10. /execute if score #tick c9_timer matches 81 run tp @e[tag=c9_goal,limit=1] ~-6 ~ ~6
  11. /execute at @e[tag=c9_goal,limit=1] run tp @e[tag=c9_goal_vis,limit=1] ~ ~ ~
  12. /execute at @e[tag=c9_goal,limit=1] run tp @e[tag=c9_lure,limit=1] ~ ~ ~
  13. /execute at @e[tag=c9_goal,limit=1] run particle minecraft:end_rod ~ ~1 ~ 0.25 0.6 0.25 0.02 3
  14. /execute at @e[tag=c9_nav,limit=1] run particle minecraft:dust{color:[0.0,1.0,1.0],scale:1.5} ~ ~0.4 ~ 0.15 0.1 0.15 0 4

How it works

Frames from the test run

Autonomous Obstacle Navigator - frame 1Autonomous Obstacle Navigator - frame 2Autonomous Obstacle Navigator - frame 3

Recorded on our own test server: 58 frames at about 9.6 fps. Our image check saw: A glowing iron golem stands inside a sea lantern arena where iron bar walls change orientation and a beacon teleports from one corner to another.

Commands, video and screenshots: tested and recorded by www.9minecraft.net © 9Minecraft. Sharing a video or screenshot? Please credit www.9minecraft.net.

Build it in your world

  1. Stand in the center of a flat open area with at least 10 blocks of space in every direction.
  2. Run all 10 setup commands once in chat or from impulse command blocks to construct the deepslate arena, initial barrier walls, beacon target, and navigator.
  3. Place 14 repeating command blocks (or 1 repeating block chained into 13 chain command blocks), all set to Always Active.
  4. Paste the 14 loop commands in order into those blocks.
  5. Watch the miniature glowing navigator weave around the iron bar walls and draw a cyan particle trail as the walls shift every 4 seconds.

Use it with real players

To make the navigator pathfind toward a real player instead of the automated beacon, replace @e[tag=c9_goal,limit=1] in the loop teleport commands with @p. The invisible lure will follow you wherever you walk, and the navigator will steer around walls and obstacles to reach your position.

Remove it again 4 commands

  1. /kill @e[tag=c9_entity]
  2. /scoreboard objectives remove c9_timer
  3. /fill ~-9 ~ ~-9 ~9 ~2 ~9 minecraft:air
  4. /fill ~-9 ~-1 ~-9 ~9 ~-1 ~9 minecraft:grass_block

FAQ

Why use an Iron Golem and an invisible Zombie instead of a Villager?

Villagers flee from nearby zombies in a straight line and can get stuck in corners, whereas an Iron Golem actively calculates a full A* path around walls across long distances to reach its target.

Why doesn't the navigator attack and launch the invisible zombie?

Both the zombie and the golem are set to Invulnerable, and the zombie is shrunk down to 0.2 scale while the goal teleports to a new corner every 4 seconds as the navigator approaches.

Commands used

/execute/fill/particle/scoreboard/summon/tp

Similar creations

Join 9Minecraft News & Guides