Skip to content

Custom Modes

Creray edited this page Nov 10, 2026 · 9 revisions

Creating Custom Modes

Targeted extends vanilla Resource Packs with support for custom animated crosshairs.

πŸ“ Directory Structure

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/  # Textures that can be referenced in `mode.animations.sprites`
β”‚       └── <...>                            # Other resource pack files
└── <...>                                    # Other Resource pack files   

🎯 Mode

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.

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 the track controlling this animation
    β”œβ”€β”€ 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 progress

πŸ“œ Rule

A rule defines the conditions under which a particular crosshair mode should be activated.

Rules are defined as JSON files located in <pack_name>/assets//crosshair/rule/. The filename (without the .json extension) serves as the rule's identifier.

<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 matches

Note

This page is a work in progress.

Clone this wiki locally