PhantomDungeons comes with 3 built-in damage indicator styles and exposes a simple registry that lets you drop in your own. Each mob chooses its style through a single YAML key.
Built-in Styles
Style key
Class
Description
modern
ModernDamageHologram
Text-display entity (1.19.4+). Pop-in → hold → shrink + fade. Spawns randomly around entity bounds.
phantom (default)
PhantomHologram
Pooled armor-stand holograms. Smart positional spread per player.
damage
DamageHologram
Legacy physics armor stand. Launches upward with gravity, falls back down.
Configuring a Style in a Mob File
Add the style key inside damage-indicator. The value must match a registered style name (case-insensitive).
any-mob.yml
visual-settings:damage-indicator:enabled:truedisplay:'&c-%damage% &4❤'style:"phantom" # modern | phantom | damage — or your own registered key
If the key is absent or unrecognised, phantom is used as the safe fallback.
Registering a Custom Style
Implement the DamageIndicatorFactory functional interface from DamageIndicatorRegistry and register it with a unique string key (MUST). Registration is permanent for the lifetime of the servers lifecycle, call it once during your plugin's onEnable().
Step 1 - Implement a factory
The simplest form is a single static method or lambda.
This works as long as MyCustomHologram.create matches the signature:
Step 2 - Set the style in the mob file
That's all, the registry routes every hit on that mob to your factory, and does caching of your class for optimal performance.
Extending the Abstracts
For full control over packet-level animation, extend one of the two abstract bases.
AbstractModernHologram - Text Displays (1.19.4+)
Use this for anything that needs smooth per-tick scale/opacity/scale animation via text-display entities. You must implement three methods.
AbstractLegacyHologram — Armor Stand (all versions)
Resolve and immediately spawn — convenience wrapper around get().spawn().
DamageIndicatorFactory
All parameters passed to spawn() are guaranteed non-null.
Make sure to depend, before any mob loads
Register your styles inside onEnable(), before PhantomDungeons loads mob configs. If your plugin depends on PhantomDungeons, declare it in plugin.yml:
FYI: Your factory receives the already-formatted display string (colours not yet parsed). Call Color.hex(text) inside your hologram constructor or before passing the string to LegacyComponentSerializer if you need colour codes resolved.
Or use your own utilities.