Waypoint style

This feature is exclusive to Java Edition.
 

Waypoint styles are JSON files located in resource packs that define styling used for changing waypoints' icon and specific distances they appear on the locator bar. They are used in /waypoint modify ... style command for specific entities.

JSON format

Waypoint styles are stored as JSON files on assets/<namespace>/waypoint_style directory.

  • [NBT Compound / JSON Object]: The root object.
    • [Int] near_distance: The distance in blocks at which the waypoint icon begins its visual transition between sprites. The first sprite in the [NBT List / JSON Array] sprites list is always used for any distance less than this value, and for the 0th sprite index. Default value is 128.
    • [Int] far_distance: The distance in blocks at which the waypoint icon completes its visual transition. It must be greater than [Int] near_distance. At this distance and beyond, the last sprite in the [NBT List / JSON Array] sprites list is used. Default value is 332.
    • [NBT List / JSON Array] sprites: A list of sprites which cycle between the [Int] near_distance and [Int] far_distance.
      • [String]: A sprite identifier, formatted as <namespace>:<sprite_id>, which refers to a unique texture located in assets/<namespace>/textures/gui/sprites/hud/locator_bar_dot/<sprite_id>.png. Specifying a nonexistent causes the missing texture to be used, rather than the default waypoint texture.

Sprite selection

To determine which sprite is used based on the distances, the game uses linear interpolation on the player's distance between the near and far distance values, getting the index of which sprite is supposed to be shown in the [NBT List / JSON Array] sprites list. This calculation in the game is roughly equivalent to:

Sprite index=(Player distanceNear distanceFar distanceNear distance)×Size of sprites list

Noticeably, the second sprite does not appear until the first index is calculated, which until then, the game uses the first sprite for the 0th index calculated, and for any distance less than the near distance. This is due to the zero-based numbering for indexing the sprites list.

The distance (in blocks) which a sprite appears between transition can be calculated from:

Sprite distance between transition=Far distanceNear distanceSize of sprites list

History

Java Edition
1.21.625w17aAdded waypoint style, alongside /waypoint modify ... style arguments.

Navigation