image-polaroidHologram Integration

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: true
    display: '&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.

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)

Full Example - "Critical Hit" Style

Register it once:

Use it in any mob file:

API Reference

DamageIndicatorRegistry

Method
Description

getInstance()

Returns the singleton registry.

register(String style, DamageIndicatorFactory factory)

Register a new style. Overwrites if the key already exists.

isRegistered(String style)

Check whether a key is currently registered.

get(String style)

Retrieve a factory by key. Returns the modern factory as fallback if unknown.

spawn(String style, Plugin, Player, Location, String text)

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:

circle-check

Last updated