Reticle pages

Maps

Reticle draws a map of the land around the player in two places: as a minimap on a HUD, which follows him while he walks, and as a world map in a menu, which he moves and zooms himself. Both read the world as Minecraft's own map item does, from the top block down, with deep water darker than shallow water and every slope shaded against the block north of it. An arrow marks the player and points where he looks. North is up, unless a round minimap turns with the player, see Heading up.

A map is an element of Type: map. This is the minimap HUD template, with comments added:

Anchor: top_right

# Below the potion effect icons, which Minecraft draws in the top right corner.
Offset: [6, 56]
# Wider than the map, so the line under it holds coordinates of five digits.
Size: [96, 76]
Theme: dark

# Reads {x} {y} {z} again every 5 ticks.
Refresh: 5
Elements:
  map:
    Type: map
    Position: [16, 0]
    Size: [64, 64]
    # square or round.
    Shape: round
    # Map pixels per block.
    Zoom: 2
    # The color of land the map knows nothing about yet.
    Background: "#1C1C1E"
    # A thin ring around the map.
    Frame: "#E5E5EA"
    # An N on the ring that marks north.
    Compass: true
  coordinates:
    # The block the player stands on, in one line under the map.
    Type: text
    Position: [0, 67]
    Size: [96, 9]
    Text: "{x} {y} {z}"
    Background: "#991C1C1E"

The coordinates line is an ordinary text, so you may restyle it, move it or delete it.

Map keys

KeyDefaultWhat it does
Shapesquaresquare, or round for a circle as wide as the map. On a map wider than it is high, the circle is cut at the top and bottom
Zoom1 in menus, 2 on HUDsMap pixels per block, see Zoom
Markersall fourThe markers the map shows: any of waypoints, pins, players and mobs, or [] for none, see Markers
Backgroundnone#RRGGBB, the color of land the map has no terrain for, see Where the map comes from. Without it, that land stays clear
Framenone#RRGGBB, a line one pixel wide along the edge of the map, around the square or the circle
Compassfalsetrue puts an N on the ring of a round map where north lies. Needs Shape: round
Rotatefalsetrue turns a round minimap with the player, so the way he faces is up. Needs Shape: round and works on HUDs only, see Heading up

Reticle draws Background and Frame in the nearest of the map's own colors.

A map takes the keys every element has, Type, Position and Size, and these rules:

  • Size goes in steps of 16 pixels both ways, such as [96, 96] or [160, 112]. On a HUD a map is 48 to 160 pixels each way.
  • A menu or a HUD holds one map.
  • Only panels may lie under a map. Put texts, buttons and items beside it.
  • The middle of the map must fall on a whole pixel. Keep the menu's Size even both ways. A HUD whose Anchor centers it from left to right needs an even width, and one centered from top to bottom an even height.
  • A HUD that holds a map draws no background of its own, so a round minimap stands free on the screen. Give its texts a Background instead. It holds at most 3 panels, one fewer than other HUDs, because the frame takes the room of one.

Zoom

Zoom is the number of map pixels one block takes. A higher number shows less land, larger. Below 1, one map pixel stands for several blocks: at 0.5 a pixel covers 2 by 2 blocks, at 0.125 8 by 8.

WhereSteps
HUD4, 3, 2, 1, 0.5, 0.25 and 0.125
Menu8, 6, 4, 2, 1 and 0.5

A map pixel is a pixel of the menu or the HUD, so a map covers its size divided by its zoom: the 64 pixel minimap of the template shows 32 blocks across at 2 and 512 blocks at 0.125. On a menu, one square of color is never smaller than 4 by 4 pixels, so at 1 each square of 4 by 4 pixels shows the color of 4 by 4 blocks.

Markers

MarkerWho sees itShape and color
WaypointsOnly the player who set them. Each player keeps up to Max_Waypoints of his own, 16 unless you change itA diamond, blue unless he picks another color
PinsEvery player. Staff with reticle.command.map.pin set them for the whole serverA square with a white middle, orange unless another color is picked
PlayersThe 16 nearest players in his world, except players he cannot see, such as vanished staff, and players in spectator mode or invisibleA white dot
MobsThe player they are near: the nearest Mob_Markers within Mob_Radius blocks, 16 within 32 unless you change itA small dot, red for hostile mobs, green for animals and water mobs, yellow for the rest, such as villagers and golems

A waypoint or pin takes one of eight colors: red, orange, yellow, green, aqua, blue, purple or white. Its name holds letters, digits, _ and -, at most 24 of them. A marker shows while it lies inside the map and disappears beyond the edge until the map reaches it again.

Player markers move five times a second; mob markers move every Mob_Refresh_Ticks, 4 unless you change it. Each update costs one small packet for every mob that moved, so a lower Mob_Markers or a longer refresh keeps a crowded farm cheap. Leave mobs out of Markers and the map looks for no mobs at all.

Waypoints live in the player's own data, so they stay with his player file. Pins live in plugins/Reticle/data.yml.

Minimap on a HUD

The minimap moves with the player and fills in the land as he comes near it, the nearest land first. While he walks within the land already drawn, it sends nothing at all; new land goes out in tiles as he nears the edge.

Each player sets four things for his own minimaps, and Reticle remembers them across joins:

CommandWhat it changes
/reticle map zoom <in|out|step|reset>The zoom. in and out step through the HUD steps, 0.5 picks a step by its number
/reticle map shape <square|round|reset>The shape
/reticle map corner <top_left|top_right|bottom_left|bottom_right|reset>The corner of the screen. Every HUD of his that holds a map moves there and keeps its Offset from that corner, while his other HUDs stay put
/reticle map rotate <on|off|reset>Whether his minimaps turn with him, see Heading up

reset goes back to what each map or HUD says. Each command has its own permission, see Commands.

Heading up

With Rotate: true on a round minimap, or after /reticle map rotate on, the map turns with the player: the way he faces is always up, and his arrow points up. The land, the markers and the N of Compass turn around the middle of the map, and the circle keeps its edge clean while they turn. A square minimap turns round while a player has this on, since a turning square would swing its corners around the screen.

A menu map stays north up, because the player looks at it while he moves it.

World map in a menu

The worldmap template is a world map with buttons that zoom in, zoom out and center the map on the player. The map opens centered on the player, and he moves it four ways:

  • A click on the map centers it on that spot.
  • While he holds W, A, S or D, the map slides north, west, south or east.
  • The mouse wheel zooms: up comes closer, down shows more land.
  • A button with a map action moves it:
ActionWhat it does
map: zoom in and map: zoom outOne zoom step closer or further
map: pan north, map: pan south, map: pan east and map: pan westMoves the map by half its height or width
map: centerCenters the map on the player again

A menu map starts from its own Zoom each time the menu opens. A click on the map fires MenuClickEvent with the map's element name, as a button does, and plays the click sound.

Players without the resource pack

Maps draw in shader mode. A player without the pack, or on a game too old for it, gets these instead:

  • In a menu drawn in world mode, the map's place holds one gray line, "The map needs this server's resource pack", which the language file keeps as map-needs-pack.
  • A chest menu leaves the map out, together with every button whose actions all move the map.
  • A minimap HUD shows its Fallback boss bar, which may hold {x} {y} {z}.
  • On Minecraft 1.21.9 and newer, the minimap also lends him a vanilla map in his empty off hand, which Minecraft draws in the lower corner of his screen.

The vanilla map shows the same land in the same colors as the minimap. It has 128 by 128 dots, one block each while his minimap zooms to 1 pixel per block or closer, and 2, 4 or 8 blocks each at 0.5, 0.25 and 0.125, so it shows 128 to 1024 blocks across. It follows him in steps of 8 dots. His arrow points where he looks; other players are white dots with their names, waypoints and pins banners in their own colors with their names, and mobs arrows that point where they look, red for hostile mobs and green for the rest. Vanilla maps keep north up and stay square, so Rotate and Shape do not change them. While he stands still and nothing changes, the map sends nothing.

The map exists only on his own screen. His real inventory never holds it, and other players see his off hand as it is. An item of his own in the off hand takes its place, and the map comes back when he empties the hand. A menu hides it with his hands, and creative and spectator mode take it away, since a creative game may write any item it shows into his real inventory. When he sees several HUDs with a map, it follows the first of them by name. Its name, "Minimap", is the language key map-hand-name.

Pictures of built worlds

For a world that is built once and then left alone, such as a hub, a lobby or an arena, a picture can replace the live map. Players then see the land as it was when you baked it, the server reads no chunks of that world for their maps, and the picture may show land that is not loaded or was never saved.

  1. Type /reticle map bake <world> <radius> [x z]. Reticle reads every chunk that exists within radius blocks of x z each way, or of the world spawn without them, widened to whole squares of 128 blocks. It never generates land. The radius goes from 64 to 896.
  2. When it is done, Reticle has written plugins/Reticle/pictures/<world>.png, one pixel per block in the map's colors, and <world>.yml beside it with Origin: [x, z], the block the top left pixel shows.
  3. Run /reticle reload. The picture goes into the resource pack, and players who join after that see it. A player who is online keeps the live map until he joins again.

You may paint the picture or touch it up in any image editor, in any colors. Clear pixels stay clear on the map. Its width and height are multiples of 8 and at most 2048 each way, and both numbers of Origin are multiples of 8. Every player's game keeps the pictures in memory with their smaller levels, so all pictures together may take at most 16,777,216 pixels, 64 MB; a picture of 2048 by 2048 blocks takes 5,570,560 of them, so three fit. Reticle refuses a bake that would pass this, refuses more at startup and on reload, and it also refuses a resource pack that Minecraft would reject for its size. Delete both files and reload to go back to the live map.

The editor's preview keeps showing the live land, and players without the pack keep the vanilla map of the live land.

Where the map comes from

Reticle reads each chunk as the map item would and keeps the result in memory: 768 bytes per chunk, up to Cache_Chunks chunks for all worlds together, about 15 MB at the default of 20000, plus every chunk that an open map shows, which always stays. When the cache is full, the chunks seen longest ago make room. After a restart the map reads the chunks again as players come near them. A read costs the thread that owns the chunk about 3 microseconds, and Reticle's own worker thread does the rest.

It reads only chunks that the server has loaded or saved, and never generates land. Land no player has visited stays clear, or shows the Background color. In the Nether the map shows the ground below the bedrock roof.

Changes reach the map by themselves. Blocks that players place and break, water and lava that flow, fire, explosions, pistons, growing trees and crops, falling sand and other changes that Paper reports with an event update the map as they happen. Changes no event reports, such as /fill, WorldEdit and blocks that other plugins set, show after the next check of the chunks on players' maps, every Rescan_Seconds.

Commands

CommandWhat it doesPermission
/reticle map zoom <in|out|reset|step>Zooms his own minimapsreticle.command.map
/reticle map shape <square|round|reset>Picks the shape of his own minimapsreticle.command.map.shape
/reticle map corner <corner|reset>Moves his own minimaps to a corner of the screenreticle.command.map.corner
/reticle map rotate <on|off|reset>Turns his own minimaps with him, or keeps north upreticle.command.map.rotate
/reticle map waypoint add <name> [color]Sets a waypoint where he stands, or moves his waypoint of that name therereticle.command.map.waypoint
/reticle map waypoint remove <name>Removes one of his waypointsreticle.command.map.waypoint
/reticle map waypoint listLists his waypointsreticle.command.map.waypoint
/reticle map waypoint clearRemoves all his waypointsreticle.command.map.waypoint
/reticle map pin add <name> [color]Sets a pin where he stands, for every playerreticle.command.map.pin
/reticle map pin remove <name>Removes a pinreticle.command.map.pin
/reticle map pin listLists the pinsreticle.command.map.pin
/reticle map bake <world> <radius> [x z]Bakes a picture of a world, see Pictures of built worldsreticle.command.map.bake

Every player has the permissions for zoom, shape, corner, rotate and waypoints; pins and bake are for operators unless you grant them. The console may bake, list and remove pins; everything else needs a player.

Settings

The Map section of settings.yml holds Cache_Chunks, Scans_Per_Tick, Rescan_Seconds, Max_Waypoints, Mob_Radius, Mob_Markers and Mob_Refresh_Ticks, see Configuration.

When a map does not load

A map with a mistake keeps its menu or HUD from loading, as any other mistake does, see When a menu does not load. The messages for maps read like these:

MessageFix
Size of element 'map' of menu 'atlas' must be a multiple of 16 both ways, such as [96, 96] or [160, 112], got 100x96. A map is drawn in steps of 16 pixels.Use a size in steps of 16
Size of element 'map' of HUD 'radar' must be from 48 to 160 both ways on a HUD, got 32x32.Make the minimap 48 to 160 pixels each way
'Zoom' in element 'map' of menu 'atlas' is the number of map pixels per block, one of 8, 6, 4, 2, 1, 0.5, got '3'.Use one of the listed steps. HUDs list theirs
'Compass' in element 'map' of HUD 'radar' needs 'Shape: round': the N rides the round frame.Add Shape: round, or remove Compass
'Rotate' in element 'map' of menu 'atlas' works on a HUD only: a menu map stays north up while the player looks at it.Remove Rotate from the menu
'Elements' in menu 'atlas' holds the maps 'map' and 'other', a menu holds at most one map.Remove one map
'Elements' in HUD 'radar' holds 4 panels, a HUD with a map holds at most 3: the map needs the room of one for its frame. Give a text a Background instead of a panel behind it.Remove a panel
Element 'note' in menu 'atlas' overlaps the map 'map': only panels may lie under a map. Move it beside the map.Move the element off the map
The map 'map' in menu 'atlas' must have its centre on a whole pixel, it sits at -0.5, 0 from the middle of the menu. Make the menu's Size even both ways.Make the Size of the menu even
Element 'zoom_in' in menu 'atlas' runs 'map: zoom in', but the menu has no map. Add a map element or remove the action.Add a map, or remove the action

A broken picture keeps Reticle from starting, with a message that names the file and the fix, for example pictures/hub.png has no hub.yml beside it with 'Origin: [x, z]', the block its top left pixel shows. /reticle map bake writes both.

The API lets plugins zoom minimaps, change their shape, corner and heading, set waypoints and pins, and build maps in code.