Skip to content
ssbaxys edited this page Oct 26, 2026 · 1 revision

Minimap and world map.

MiniMap map = new MiniMap()
        .source(MapSource.platform().or(new DemoMap(42)))  // the game map in a world, a demo without one
        .shape(MiniMap.Shape.ROUND)     // or SQUARE
        .rotate(true)                   // follows the player's view; false keeps north up
        .zoom(1.5f).zoomRange(0.5f, 6f) // pixels per block; the mouse wheel changes the zoom
        .showNorth(true).showCoordinates(true)
        .marker("home", 0, 0, 0xFFFFE08A, "Home");

The source is a MapSource: MapSample sample(int radius) with a grid of ARGB colors and the player's position and rotation. MapSource.platform() uses Platform.sampleMap(radius): the loader reads the top block's color (BlockState.getMapColor) through map.MapGridSampler; the grid is cached and shifts only when the player moves away, one update reads at most budget columns and no more often than interval; slopes are shaded like on the vanilla map. Your own source (a server, a base plan) is any MapSource implementation. The map texture is uploaded via createTexture no more often than uploadInterval(...) and only when the grid changed; without textures the map is drawn as cells. Markers beyond the edge stick to the edge and lose their label.

WorldMap(provider, centerX, centerZ, size) is a static map of an area from MapColorProvider.colorAt(x, z): colors are built once (refresh() rebuilds), dragging moves the view, the wheel zooms.


← HUD Overlay · English home · Effects →

Clone this wiki locally