HomeJavaDatapacksMaze Wand: Wilson Maze Generator
DatapacksJava

Maze Wand: Wilson Maze Generator

Generate customizable, fully connected mazes with a magical wand and a simple Japanese chat menu. Powered by Wilson’s Algorithm and verified with BFS.

⬇ Download on Modrinth

Maze Wand: Wilson Maze Generator

Build mazes with a wand. Get lost, but never trapped.

Overview

Maze Wand is a vanilla data pack for Minecraft Java Edition that generates customizable mazes directly inside your world.

When the data pack detects a player for the first time, it automatically gives them a glowing Magic Wand. Right-clicking the wand opens a clickable Japanese chat menu for generating mazes, changing their dimensions, selecting materials, and managing the latest maze.

The entrance is created at the player’s position, and the maze extends toward the +X and +Z directions.

No mod or resource pack is required.

Features

How Maze Generation Works

Maze Wand uses Wilson’s Algorithm, a maze-generation method based on loop-erased random walks.

  1. The complete maze area is initially filled with the selected material.
  2. An unvisited cell begins a random walk.
  3. When the walk loops back into itself, the loop is erased.
  4. When the walk reaches the existing maze, the remaining path is carved.
  5. The process continues until every maze cell has been connected.

Because directions are selected randomly, the resulting maze has less directional bias and fewer repetitive road-grid patterns.

After carving is complete, the data pack performs a BFS reachability check. The maze is only marked as complete when the entrance and exit exist and the goal can be reached from the start.

How to Use

  1. Place MazeGenerator_26_1_2.zip in the world’s datapacks folder without extracting it.
  2. Re-enter the world or run /reload.
  3. Right-click the automatically provided Magic Wand.
  4. Open the settings menu and configure the maze.
  5. Stand where the entrance should be created.
  6. Select Generate Maze.

If the wand is lost, use:

/function maze:give_wand

Available Settings

Setting Description
X-axis path count Number of maze cells along the X axis
Z-axis path count Number of maze cells along the Z axis
Path width Width of each walkable passage
Wall thickness Thickness of the walls between passages
Wall height Vertical height of the maze walls

All values have a minimum of 1.

Maze Materials

There are two ways to select the wall and floor material:

Example:

/function maze:set_material {block:"minecraft:diamond_block"}

The selected material is used for both the walls and the automatically generated floor.

Advanced Commands

/function maze:help
/function maze:give_wand
/function maze:set_material {block:"minecraft:diamond_block"}
/function maze:generate {w:21,d:21,h:4,wall:1,path:2,block:"minecraft:stone_bricks"}
/function maze:cancel

In the direct generation command:

Special Sizes

Compatibility

Tested successfully on:

Important Notes

World modification warning: Maze generation overwrites blocks and clears passages inside the generated area. Back up important worlds before generating a maze.

Deletion warning: “Delete Latest Maze” clears the generated area. It is not a complete undo system and does not restore the original terrain.

Performance warning: Extremely large mazes may cause severe lag, freeze the world, or crash Minecraft. Huge maze generation is performed entirely at your own risk.

Only one maze can be generated at a time.

To prevent internal /trigger messages from appearing in chat, the data pack disables the world’s command-feedback gamerule while loaded.

Verified by MCModsHub

These come from our own check of the pack file, not from the source page.

Explore more