Uploaded April 2022 | Updated November 2026, 2 days ago
I was working on implementing a maze generator algorithm based on Kruskal's algorithm and had added some colors to help visualize what was happening. Watching the algorithm run turned into a game of guessing which color would take over the entire maze, so I thought I'd share a preview.
The basic algorithm is:
1. Choose a random wall we haven't visited yet.
2. If the cells on either side of the wall are already connected, solidify the wall (we won't visit it again)
3. If the cells aren't connected yet, remove the wall. The color of the section that had more cells to begin with takes over the cells on the other section.
4. Repeat 1-3 until there are no more unvisited walls.
Read more about Kruskal's algorithm here: en.wikipedia.org/wiki/Maze_generation_algorithm#Randomized_Kruskal's_algorithm
Be on the lookout for a more in-depth datapack video with a datapack download link in the next week or so!
I was working on implementing a maze generator algorithm based on Kruskal's algorithm and had added some colors to help visualize what was happening. Watching the algorithm run turned into a game of guessing which color would take over the entire maze, so I thought I'd share a preview.
The basic algorithm is:
1. Choose a random wall we haven't visited yet.
2. If the cells on either side of the wall are already connected, solidify the wall (we won't visit it again)
3. If the cells aren't connected yet, remove the wall. The color of the section that had more cells to begin with takes over the cells on the other section.
4. Repeat 1-3 until there are no more unvisited walls.
Read more about Kruskal's algorithm here: en.wikipedia.org/wiki/Maze_generation_algorithm#Randomized_Kruskal's_algorithm
Be on the lookout for a more in-depth datapack video with a datapack download link in the next week or so!


![Animating Minecraft Map Art with 5 Commands
This week, were animating map art in Minecraft using just 5 commands.
Here are the commands used in this episode:
Command 1 - Add frames to the end of the animation:
execute as @e[type=item_frame] at @s if data entity @s Item.tag.map if block ~ ~-1 ~ minecraft:cartography_table align xyz if entity @e[type=item,nbt={Item:{id:minecraft:filled_map},Age:1s},dx=1,dy=1,dz=1] run data modify entity @s Item.tag.frames append from entity @e[type=item,nbt={Item:{id:minecraft:filled_map},Age:1s},dx=1,dy=1,dz=1,limit=1] Item.tag.map
Command 2 - Update the current frame displayed:
execute as @e[type=glow_item_frame] if data entity @s Item.tag.frames run data modify entity @s Item.tag.map set from entity @s Item.tag.frames[0]
Command 3 - Remove current frame from the front of the queue:
execute as @e[type=glow_item_frame] if data entity @s Item.tag.frames run data remove entity @s Item.tag.frames[0]
Command 4 - Add current frame to the back of the queue:
execute as @e[type=glow_item_frame] if data entity @s Item.tag.frames run data modify entity @s Item.tag.frames append from entity @s Item.tag.map
Command 5 - Silence item frames that are playing an animation:
execute as @e[type=glow_item_frame] if data entity @s Item.tag.frames run data modify entity @s Silent set value 1b
Chapters:
0:00 - Teaser
0:23 - Intro
1:28 - Command 1
2:44 - Command 2
3:41 - Command 3
4:12 - Command 4
4:41 - Command 5
5:45 - Demo
8:37 - Outro Animating Minecraft Map Art with 5 Commands](https://i.ytimg.com/vi/AiT0kHIf6g0/mqdefault.jpg)




![Simple Midair Block Placement in Minecraft
Heres a simple 3 command block method for allowing block placement in midair, using the structure void block. Just set up the three command blocks, use the tag command to give yourself an air_placer tag, and youre good to go!
Command Block 1 (Repeating)
`execute as @p[tag=air_placer] at @s run fill ~-4 ~-4 ~-4 ~4 ~4 ~4 minecraft:air replace minecraft:structure_void`
Command Block 2 (Chain, Unconditional)
`execute as @p[tag=air_placer] at @s anchored eyes if block ^ ^ ^3 minecraft:air run setblock ^ ^ ^3 minecraft:structure_void`
Command Block 3 (Chain, Conditional) (Optional)
`execute as @p[tag=air_placer] at @s anchored eyes positioned ^ ^ ^3 align xyz positioned ~0.5 ~0.5 ~0.5 run particle minecraft:dust 0 0.9 0.6 1 ~ ~ ~` Simple Midair Block Placement in Minecraft](https://i.ytimg.com/vi/Ex9wro51_WQ/mqdefault.jpg)
![My Most Compact Maze Generator Yet
Questions about this episode or want help on your own Minecraft creations? Join the Command Block Cove on Discord: https://discord.gg/Vr9vfP6EqH
Thank you for making Season 1 of Five Block Fridays fantastic! Ill be taking a break for a bit to hopefully work on some larger projects.
Be on the lookout for a technical deep-dive on this creation sometime next week, as well as a world tour and download next Friday.
Commands:
Command 1 - Reset the Maze
execute if entity @e[type=snowball,nbt={Item:{tag:{display:{Name:{text:Reset}}}}}] at @e[name=maze_walker] unless entity @e[name=maze_tile,distance=0..0.5] run execute as @e[name=maze_tile] at @s store success entity @s NoBasePlate byte 0 run fill ~-1 ~2 ~-1 ~1 ~5 ~1 minecraft:birch_leaves[persistent=true] replace air
Command 2 - Rotate Unvisited Neighbors
execute as @e[name=maze_walker] at @s as @e[name=maze_tile,nbt={NoBasePlate:0b},distance=1.5..2.5] at @s facing entity @e[name=maze_walker,sort=nearest,limit=1] eyes run tp @s ~ ~ ~ ~ 0
Command 3 - Teleport to Random Neighbor
execute at @e[name=maze_walker] as @e[name=maze_tile,nbt={NoBasePlate:0b},distance=1.5..2.5,sort=random,limit=1] store success entity @s NoBasePlate byte 1 run tp @e[name=maze_walker,sort=nearest,limit=1] @s
Command 4 - Carve Out Walls
execute as @e[name=maze_walker] at @s rotated as @e[name=maze_tile,distance=0..0.5,sort=nearest,limit=1] rotated ~ 0 store success entity @s NoBasePlate byte 1 run fill ^ ^3 ^ ^ ^5 ^2 minecraft:air
Command 5 - Backtrack if Necessary
execute as @e[name=maze_walker,nbt={NoBasePlate:0b}] at @s rotated as @e[name=maze_tile,sort=nearest,distance=0..0.5,limit=1] run tp @s ^ ^ ^2
Chapters:
0:00 - Intro
0:56 - Depth First Search explained
3:10 - Demos
5:00 - Timelapse
8:15 - Outro My Most Compact Maze Generator Yet](https://i.ytimg.com/vi/GPdRnhVGasc/mqdefault.jpg)

