Lethal Maze Solver: Real-Time AI Pathfinding

Build an automated cyber-maze where a relentless hunter uses glowing holographic nodes, sonar sweeps, and real-time pathfinding trails to catch its prey.

Java EditionMobs & PetsExpert24 commandsTested on a real 26.2 & 26.3 server
A glowing entity navigates a dark deepslate maze toward a targeted villager at the opposite corner. Download the GIF Video & GIF © www.9minecraft.net

Custom MobsTechnologyDarkBlackCyanRedLearningMini-gameAdventure MapBlock displaysSummoned mobsBlock building (fill/setblock/clone)SoundsRotation math21+ commands

Watch an apex cyber-hunter navigate a complex deep-slate obstacle course completely on its own. As the glowing seeker locks onto the villager target at the opposite corner of the arena, it projects a live holographic path of floating beacon nodes and laser vectors through every twist and turn of the labyrinth.

Each time the hunter reaches its prize, an explosion of energy resets the cycle and teleports it back to the entrance, giving you an infinite live display of Minecraft AI pathfinding turned into a visible sci-fi HUD.

1. Setup - type these once 10 commands

  1. /scoreboard objectives add c9_timer dummy
  2. /fill ~-9 ~-1 ~-9 ~9 ~-1 ~9 polished_blackstone_bricks
  3. /fill ~-9 ~ ~-9 ~9 ~1 ~9 polished_deepslate hollow
  4. /fill ~-8 ~1 ~-8 ~8 ~1 ~8 air
  5. /fill ~-5 ~ ~-8 ~-5 ~1 ~4 deepslate_tiles
  6. /fill ~-1 ~ ~-4 ~-1 ~1 ~8 deepslate_tiles
  7. /fill ~3 ~ ~-8 ~3 ~1 ~4 deepslate_tiles
  8. /fill ~7 ~ ~-4 ~7 ~1 ~8 deepslate_tiles
  9. /summon villager ~8 ~ ~8 {NoAI:1b,Invulnerable:1b,Glowing:1b,Silent:1b,CustomName:{"text":"TARGET","color":"aqua","bold":true},CustomNameVisible:1b,Tags:["c9_sim","c9_target"]}
  10. /summon vindicator ~-7 ~ ~-7 {Invulnerable:1b,Glowing:1b,Silent:1b,PersistenceRequired:1b,CustomName:{"text":"APEX SEEKER","color":"red","bold":true},CustomNameVisible:1b,Tags:["c9_sim","c9_seeker"],Johnny:1b,attributes:[{id:"minecraft:follow_range",base:64.0d},{id:"minecraft:movement_speed",base:0.36d}],equipment:{mainhand:{id:"minecraft:netherite_axe",count:1}}}

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

  1. /scoreboard players add #tick c9_timer 1
  2. /execute as @e[tag=c9_node] run scoreboard players add @s c9_timer 1
  3. /execute if score #tick c9_timer matches 4.. at @e[tag=c9_seeker] run summon block_display ~ ~0.15 ~ {Tags:["c9_sim","c9_node"],Glowing:1b,glow_color_override:65535,block_state:{Name:"minecraft:sea_lantern"},transformation:{left_rotation:[0f,0f,0f,1f],right_rotation:[0f,0f,0f,1f],scale:[0.25f,0.25f,0.25f],translation:[-0.125f,0f,-0.125f]}}
  4. /execute if score #tick c9_timer matches 4.. at @e[tag=c9_seeker] facing entity @e[tag=c9_target,limit=1] feet run particle end_rod ^ ^1.2 ^0.8 0 0 0 0.05 2 force
  5. /execute if score #tick c9_timer matches 4.. run scoreboard players set #tick c9_timer 0
  6. /execute at @e[tag=c9_seeker] run particle dust{color:[1.0,0.1,0.2],scale:1.4} ~ ~1.1 ~ 0.25 0.4 0.25 0 3 force
  7. /execute at @e[tag=c9_seeker] run particle sculk_charge_pop ~ ~2.3 ~ 0.15 0.1 0.15 0.02 2 force
  8. /execute at @e[tag=c9_target] run particle dust{color:[0.1,1.0,0.4],scale:1.5} ~ ~1.2 ~ 0.3 0.5 0.3 0 3 force
  9. /execute at @e[tag=c9_target] run particle electric_spark ~ ~2.4 ~ 0.2 0.2 0.2 0.05 2 force
  10. /execute as @e[tag=c9_node,scores={c9_timer=15}] run data merge entity @s {glow_color_override:16755200,block_state:{Name:"minecraft:shroomlight"}}
  11. /kill @e[tag=c9_node,scores={c9_timer=45..}]
  12. /execute at @e[tag=c9_seeker] if entity @e[tag=c9_target,distance=..2.6] run particle explosion_emitter ~ ~1 ~ 0 0 0 0 1 force
  13. /execute at @e[tag=c9_seeker] if entity @e[tag=c9_target,distance=..2.6] run playsound entity.elder_guardian.curse master @a ~ ~ ~ 0.7 1.6
  14. /execute at @e[tag=c9_seeker] if entity @e[tag=c9_target,distance=..2.6] run tp @e[tag=c9_seeker] ~-7 ~ ~-7

How it works

Frames from the test run

Lethal Maze Solver: Real-Time AI Pathfinding - frame 1Lethal Maze Solver: Real-Time AI Pathfinding - frame 2Lethal Maze Solver: Real-Time AI Pathfinding - frame 3

Recorded on our own test server: 59 frames at about 9.7 fps. Our image check saw: A glowing hunter navigates a dark deepslate maze toward a glowing villager at the bottom right, leaving a trail of particles and floating beacon nodes visible around the arena.

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 at the center of an open flat area where you want the 19x19 labyrinth to appear.
  2. Run the 10 setup commands in order to build the blackstone floor, deepslate maze corridors, target villager, and apex seeker.
  3. Place a line or chain of 14 repeating command blocks set to Always Active near the center of the arena.
  4. Paste one loop command into each repeating command block.
  5. Watch from above as the seeker scans the walls, leaves glowing pathfinding nodes behind it, and resets upon catching the target.

Use it with real players

To make the seeker hunt a real player instead of the demo villager, remove the target villager and replace @e[tag=c9_target] in the loop commands with @p[gamemode=survival]. Because the seeker has follow_range set to 64, it will immediately plot a path through the maze toward wherever you hide.

Remove it again 4 commands

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

FAQ

Why does the Vindicator never get stuck behind the maze walls?

Its minecraft:follow_range attribute is increased to 64 blocks in the summon command, which expands the node limit of Minecraft's internal A* pathfinding graph so it can look past all four alternating walls.

Will the glowing path nodes lag my world over time?

No. Every node has a personal scoreboard timer and is automatically removed after 45 ticks (2.25 seconds), so there are never more than 12 display entities alive at once.

Commands used

/data/execute/fill/kill/particle/playsound/scoreboard/summon/tp

Similar creations

Join 9Minecraft News & Guides