Astral Realms Documentation Help

Skill Files

A skill file defines a single skill: its identity, execution behavior, parameters, and effects. Skill files are YAML documents stored in plugins/AstralSkill/skills/ (subfolders are scanned recursively) and deserialized into a WrappedSkill record at load time.

Each skill file declares a top-level id field that is the map key — skills are indexed by id, not by filename. Duplicate ids overwrite silently.

Minimal example

id: "explosive-touch" skill-root: cast type: impact params: damage: 4.0 knockback-velocity: 1.5 cast-effects: - type: fire params: duration: 5s target-effects: - type: fire params: duration: 5s

Top-level fields

Field

Type

Required

Description

id

String

Yes

Unique skill identifier (the id field, not the filename). Duplicates overwrite silently.

skill-root

Root enum

Yes

Skill category: cast, toggle, passive, or misc — categorization metadata for consumers (not gameplay-enforced).

type

Type enum

Yes

Skill implementation: one of six hardcoded types that select runtime behavior (see Cast Types).

tags

Set[String]

No

Free-form tags for categorization (e.g., fire, magic, melee) — used for grouping and filtering by consumers.

requirement-list

RequirementList

No

Conditions that must pass before the skill can be cast (e.g., [compare] %tower_room_mobs% > 0). Only enforced for Player casters; failure aborts the cast.

params

YAML Object

Yes

Type-specific parameters (projectile velocity, impact radius, dummy payload, etc.) — full key sets live in Cast Types.

cast-effects

Effect[]

No

List of effects applied to the caster when the skill is cast (see Effects).

target-effects

Effect[]

No

List of effects applied to each entity hit/affected by the skill (see Effects).

skill-root

The skill-root enum is a categorization flag for consumers (e.g., AstralClasses, AstralMobs). It does not affect runtime behavior; instead, it signals intent to systems that subscribe to or trigger skills:

Value

Meaning

cast

Skill is cast once on player/entity activation

toggle

Skill is activated and deactivated by the player (or on timed schedule for mobs)

passive

Skill is always active and not directly cast

misc

Skill does not fit into any of the other categories

Example:

skill-root: cast

type

The type enum selects the concrete Skill implementation and is hardcoded — it determines the runtime behavior and the expected params structure:

Type

Behavior

See

dummy

Inert skill; applies cast/target effects but does not interact with the world

Dummy

impact

Instant area-of-effect applied at a location; hits all entities within a radius

Impact

projectile

Launches moving projectile(s) with collision detection, drag, gravity, and visual display

Projectile

laser

Fires continuous beam with line-of-sight targeting and hit detection (drag and gravity fixed to 0)

Laser

n_cast

Rotates through a sequence of skills, stepping to the next skill on each cast

N_Cast

auto_cast

Periodically self-triggers on a timed schedule (no player cast required per element)

Auto_Cast

Example:

type: projectile

id

The id field is the unique skill identifier and is the map key — not the filename. Consumers (AstralClasses, AstralMobs) reference skills by id. Best practice: align filenames with ids for readability (e.g., knight-attack-1-cast.yml for id: "knight-attack-1-cast").

id: "fire-spark"

tags

Tags are free-form strings used for categorization and filtering. They have no effect on skill execution; consumers may use them for organizing skills in menus or filtering by category:

tags: - fire - magic

Placeholder expressions in params and effects

Most fields inside params and effect params are typed as PlaceholderWrapper<T>, so they accept either a literal value or a placeholder expression string resolved against the PlaceholderContainer supplied at cast time:

params: velocity: "%level% * 0.5"

The container is built by the caller: if the caster is a Player and no container is passed, AstralCore auto-builds one with player-scoped placeholders (e.g. %player_name%); consumers like AstralClasses or AstralMobs can register additional custom placeholders (e.g. %level%) before casting.

Some example skill files carry a top-level placeholders: map (e.g. level: 1). This key has no corresponding field on WrappedSkill, so it is not parsed or resolved — it currently has no effect on skill behavior.

requirement-list

The requirement-list is an AstralCore PaperRequirementList that gates skill execution. Requirements are evaluated before the skill is cast. If any requirement fails, the cast is aborted and no effects are applied.

Requirements are only enforced for Player casters. Non-player casters (mobs, projectiles) are unaffected.

requirement-list: - "[compare] %tower_room_mobs% > 0" - "permission:player.skills.basic"

See AstralCore's requirement system documentation for the full syntax and operators.

params

The params block is a type-specific configuration parsed into the concrete Skill implementation matching the type field. The full key set and shape for each type is documented in Cast Types.

Example (projectile):

type: projectile params: targets: enemy display-params: - display-type: particle type: flame count: 5 velocity: 1.0 max-range: 20.0 cast-skill-on-entity: explosive-touch

Example (impact):

type: impact params: damage: 4.0 knockback-velocity: 1.5

cast-effects and target-effects

cast-effects — list of Effect instances applied to the caster when the skill is cast.

target-effects — list of Effect instances applied to each affected entity (on hit for projectile/laser, on deactivate for impact, etc.).

Both are optional lists of objects with a type and params:

cast-effects: - type: fire params: duration: 5s - type: potion-effect params: effect: "minecraft:nausea" duration: 5s amplifier: 1 hide-particles: true target-effects: - type: fire params: duration: 5s

See Effects for the full catalogue of effect types and their parameters.

Skill chaining

Skills can trigger other skills through chaining fields inside params. These fields accept a skill id (string) or list of skill ids:

Type

Field

Behavior

Projectile

cast-skill-on-entity

Triggered when projectile hits an entity

Projectile

cast-skill-on-block

Triggered when projectile hits a block

Projectile

cast-skill-on-miss

Triggered when projectile reaches max-range without hitting

Laser

cast-skill-on-entity

Triggered when laser hits an entity

Laser

cast-skill-on-block

Triggered when laser hits a block

Impact

cast-skill-on-hit

Triggered when impact hits an entity

Impact

cast-skill-on-miss

Triggered when impact reaches max-range or other miss condition

The chained skills are cast at the location of the trigger event (entity hit, block hit, etc.) and inherit the original caster's context.

Chain example

A projectile (mage-attack-1-laser) fires when cast and triggers an impact (mage-attack-1-impact) when it hits an entity:

mage-attack-1-laser.yml:

id: mage-attack-1-laser skill-root: cast type: laser params: targets: enemy velocity: 0.3 max-range: 256.0 cast-skill-on-entity: - mage-attack-1-impact

mage-attack-1-impact.yml:

id: mage-attack-1-impact skill-root: cast type: impact params: damage: 10.0 knockback-velocity: 1.0 target-effects: - type: potion-effect params: effect: "minecraft:slowness" duration: 3s amplifier: 1

Composition types

Two skill types exist to compose/sequence other skills:

n_cast — Rotation

The n_cast type rotates through a sequence of skills, stepping to the next one on each cast. It exposes a %n-cast-index% placeholder to track the current position:

id: knight-attack-1-cast skill-root: cast type: n_cast requirement-list: - "[compare] %tower_room_mobs% > 0" params: skills: - knight-attack-1-1 - knight-attack-1-2 - knight-attack-1-3 max-delay-between-iterations: 4000 # Reset to first skill if 4s passes without a cast

Fields:

  • skills — list of skill ids to rotate through

  • max-delay-between-iterations — time (milliseconds) after which the rotation resets to the first skill if no cast occurs

auto_cast — Scheduled sequence

The auto_cast type schedules a timed sequence of skills to fire automatically, repeating at a configured interval:

id: priest-auto-cast skill-root: passive type: auto_cast params: repeat: 3 # Repeat the sequence 3 times elements: - skill: priest-spell-1 delay: 0 # Fire immediately - skill: priest-spell-2 delay: 500 # Fire 500ms after the previous - skill: priest-spell-3 delay: 1000 # Fire 1000ms after the previous

Fields:

  • repeat — number of times to repeat the entire sequence (0 = fire once; 1 = fire twice, etc.)

  • elements — list of {skill, delay} pairs, where delay is milliseconds from the start of the sequence

Full skeleton

A complete skill file with every top-level key in order:

id: "example-skill" skill-root: cast tags: - fire - magic type: projectile requirement-list: - "[compare] %tower_room_mobs% > 0" params: targets: enemy velocity: "%level% * 5" max-range: 20.0 cast-skill-on-entity: impact-skill cast-effects: - type: fire params: duration: 5s target-effects: - type: potion-effect params: effect: "minecraft:slowness" duration: 3s amplifier: 1

Validation

The skill loader rejects entries that fail any of these checks:

  • Missing or empty id.

  • Missing or invalid skill-root (must be one of cast, toggle, passive, misc).

  • Missing or invalid type (must be one of dummy, impact, projectile, laser, n_cast, auto_cast).

  • params is empty or cannot be parsed for the selected type.

  • A params field references an effect type not registered with EffectFactory — loading fails for that skill.

  • A chaining field (e.g., cast-skill-on-entity) references a skill id that does not exist — logged as a warning at runtime; the chained skill simply does not fire.

  • A requirement-list uses invalid syntax or references placeholders that cannot be resolved.

Errors are logged per skill with the skill id and exception message. A bad skill does not prevent the rest from loading.

Hot reload

/skill reload (permission skill.reload) re-reads all .yml files from the skills/ folder and re-initializes every skill:

  1. All running skill instances are deactivated gracefully.

  2. The skill registry is cleared.

  3. All files are re-parsed and re-initialized.

  4. The shard update loops restart.

Configuration changes take effect immediately. The shard thread count is never changed by reload (requires a server restart).

Last modified: 25 July 2026