Configuration
All AstralMobs configuration lives in plugins/AstralMobs/config.yml, loaded at startup and reloadable via /mobs reload.
config.yml
The config.yml file maps to the MainConfiguration record and controls the health display rendering and the requirement-gated equipment/effect refresh loop.
Key | Type | Description |
|---|---|---|
| ComponentWrapper (MiniMessage) | Template rendered as overhead text on non-boss mobs only, updated per |
| int (ticks) | Interval (in server ticks, 1 tick = 50ms) at which the health display refreshes. If ≤ 0, the display loop is not started and the health bar updates only on damage events. Default: 0 (disabled) — the shipped production |
| int (ticks) | Interval at which requirement-gated equipment and effects are re-evaluated and applied. Clamped to a minimum of 1 (every tick) regardless of the configured value. Only blueprints flagged |
How Health Display Works
The health display is driven by the MobService tick loop:
Boss mobs (blueprints with
metadata.boss: true) display health via a boss bar (Minecraft boss bar UI, red, segmented). The title is hard-coded to<spoofed type name> - <health> / <max-health>— it does not use themob-healthtemplate.Normal mobs display health via overhead text (a packet-based text display entity, anchored above the mob and following it), rendered from the
mob-healthtemplate.Suppressed display: if
metadata.hide-health-bar: trueis set on the blueprint, no display is created or updated.
The mob-health template is resolved once per display update, for non-boss mobs only, with the following placeholder context:
%health%→ current health (1 decimal place)%max-health%→ maximum health (1 decimal place)%mob_*%→ any placeholder registered by AstralMobs or the mob's skill system (e.g.%mob_active-goal%,%mob_has-target%,%mob_target_distance%)
Loop Lifecycle
The MobService.start() method creates the repeating scheduler tasks:
Display task: created only if
force-update-interval > 0. CallsAstralEntity.updateHealthDisplay()on all alive mobs at the configured interval. If ≤ 0, this loop is skipped and the display updates only when damage occurs.Gear task: runs every
max(1, requirement-update-interval)ticks. Applies requirement-gated equipment and effects to blueprints with thedynamicflag.
Reload behavior: /mobs reload re-reads config.yml and calls loadConfiguration(), updating the mob-health template and interval values. However, the scheduler tasks are not recreated during a reload—they continue with the old interval until the server restarts. The new template takes effect immediately on the next display update.
Example Configurations
Minimal Health Bar with Images
Uses image placeholders (requires AstralImages or similar):
Debug Display with AI State
Shows the mob's AI state inline (for development):
Fast Health Updates
Forces the health display to update every tick (50ms server time):
Lazy Health Updates
Updates the health display every 20 ticks (~1 second):
Disabled Health Display Loop
Disables the repeating loop; the health bar updates only on damage events (does not suppress mobs with hide-health-bar):
Infrequent Equipment Refresh
Re-evaluates requirement-gated gear every 10 ticks: