Repository navigation
Custom Modes
Targeted extends vanilla Resource Packs with support for custom animated crosshairs.
A Mode defines the appearance and animation behavior of a crosshair. It consists of animations that display sprites and tracks that control their progress over time.
Each animation is associated with a track. A track produces a normalized
progress value ranging from 0 to 1, which determines which sprite the animation
displays.
A Rule defines when a particular crosshair mode should be displayed. It consists of a trigger, a set of conditions, a priority, and a reference to the mode to activate.
When the player's targeting state matches a rule's trigger and all its conditions are satisfied, the rule becomes eligible for activation. If multiple rules match, their priorities determine which one takes precedence.
A resource pack can define custom crosshair modes and rules using the following directory structure:
name/
βββ assets/
β βββ <namespace>
β βββ crosshair/
β β βββ mode/ # JSON files defining crosshair modes
β β βββ rule/ # JSON files defining rules
β βββ textures/gui/sprites/crosshair/ # Crosshair sprites, that can be referenced in animations
β βββ <...> # Other resource pack files
βββ <...> # Other Resource pack files Modes are defined as JSON files located in <pack_name>/assets/<namespace>/crosshair/mode/.
The filename (without the .json extension) serves as the mode identifier that can be used
in rules.
For example, my_cool_mode.json defines the mode namespace:my_cool_mode.
<The root tag>
βββ tracks # Track[]: List of track definitions (JSON objects)
β βββ id # String: Unique identifier of this track. Visible only within the current mode
β βββ duration # Int: Track duration in ticks
β βββ controller # Controller: Defines how the track's progress is controlled
βββ animations # Animation[]: List of animation definitions (JSON objects)
βββ track_id # String: ID of on of the tracks defined above
βββ limited_by? # String: ID of another track that limits this animation's progress
βββ sprites # Identifier[]: List of sprites used by this animation, selected according to the controlling track's progressA rule defines the conditions under which a particular crosshair mode should be activated.
<The root tag>
βββ priority # Int: Priority of this rule. Higher values take precedence over lower ones
βββ trigger # Trigger: Defines when this rule is evaluated
βββ conditions # Condition[]: List of conditions that must all be satisfied for the rule to match
βββ mode # Identifier: ID of the crosshair mode to activate when this rule matchesNote
This page is a work in progress.