--- title: "Map API - Charted wiki" description: "Open the world map on a spot, add to its right-click menu, hide the minimap for a while, and ask what the map knows." url: https://voxelsprout.com/charted/wiki/map-api --- [Charted](https://voxelsprout.com/charted) [Wiki](https://voxelsprout.com/charted/wiki)Map API # Map API Open the world map on a spot, add to its right-click menu, hide the minimap for a while, and ask what the map knows. `ChartedMap` is the world map and the minimap from the outside. From Charted **0.1.0**. ## Open the world map ```java if (ChartedMap.isAvailable() && !ChartedMap.isOpen()) { ChartedMap.openAt("minecraft:overworld", 120, -300); // or open(), where it was } ``` ## Add to the right-click menu Your entry comes after Charted's own. The action is a `BiConsumer`: the dimension and `{x, y, z}` of the spot. ```java ChartedMap.addMenuEntry("mymod", "teleport", "Teleport here", (dimension, pos) -> sendTeleportRequest(dimension, pos[0], pos[1], pos[2])); // Take it away again. ChartedMap.removeMenuEntry("mymod", "teleport"); ``` ## Hide the minimap for a while While a `BooleanSupplier` is true. It is asked every frame, so keep it cheap. ```java ChartedMap.hideMinimapWhile("mymod", () -> MyCutscene.isPlaying()); // Stop hiding it. ChartedMap.showMinimap("mymod"); ``` ## What the map knows `column(dimension, x, z)` is null where the map has nothing, else a map with `block`, `biome`, `height`, `water` and `source` (`scanned`, `distant_horizons` or `imported`). ```java if (ChartedMap.isExplored("minecraft:overworld", x, z)) { Map column = ChartedMap.column("minecraft:overworld", x, z); } ``` ## Let go of everything `release(owner)` takes away all you added: menu entries, minimap hiding, your marks in [ChartedMarkers](https://voxelsprout.com/charted/wiki/markers-api) and your waypoint listener. ## Reference | ChartedMap | What it does | | ------------------------------------------------------- | ----------------------------------------------------------------------------------- | | isAvailable() / isOpen() | Charted is running in a world; the world map is open. | | open() / openAt(dimension, x, z) | Opens the world map, where it was or on a block. | | addMenuEntry(owner, id, label, action) | An entry in the world map's right-click menu, after Charted's. | | removeMenuEntry(owner, id) | Takes it away. | | hideMinimapWhile(owner, condition) / showMinimap(owner) | Hides the minimap while a BooleanSupplier is true. | | isExplored(dimension, x, z) | The map has that column in memory. | | column(dimension, x, z) | What it knows there, or null. | | release(owner) | Everything you added, here and in ChartedMarkers, and your waypoint listener, gone. | [Previous Markers API](https://voxelsprout.com/charted/wiki/markers-api) [Next Actions API](https://voxelsprout.com/charted/wiki/actions-api) Something missing or wrong on this page? Say so on [Discord](https://discord.gg/CvdkGbEW4y).