Skip to content

Entity UI

Entity UI renders in world space, attached to entities. Used for health bars, damage numbers, and nameplates.

ComponentPurpose
EntityStatUIComponentHealth bars, stat displays
CombatTextUIComponentFloating damage/heal numbers

Health bars are configured through entity assets, not code. The EntityStatUIComponent displays stats based on entity configuration.

In your entity’s JSON asset:

{
"ui": {
"statBar": {
"stat": "health",
"visible": "damaged",
"offset": [0, 2.5, 0]
}
}
}

Options for visible:

  • "always" - Always show
  • "damaged" - Show when not at full health
  • "never" - Never show

Floating numbers that appear when entities take damage or heal. Combat text is triggered automatically by the damage system - there’s no direct API to spawn it.

TypeProperties
ScalestartScale, endScale
PositionpositionOffset (Vector2f)
OpacitystartOpacity, endOpacity

Animations use normalized time (0.0 to 1.0):

{
"startAt": 0.0,
"endAt": 0.5
}

Combat text is configured in damage system assets:

{
"combatText": {
"duration": 1.0,
"animations": [
{
"type": "Scale",
"startScale": 1.5,
"endScale": 1.0,
"startAt": 0.0,
"endAt": 0.3
},
{
"type": "Position",
"positionOffset": [0, 50],
"startAt": 0.0,
"endAt": 1.0
},
{
"type": "Opacity",
"startOpacity": 1.0,
"endOpacity": 0.0,
"startAt": 0.7,
"endAt": 1.0
}
]
}
}
SystemSpaceUse Case
Entity UIWorldHealth bars, damage numbers
HUDScreenPersistent player info
Custom PagesScreenMenus, dialogs

Entity UI follows the entity in 3D space and scales with distance.

Nameplates for NPCs and players:

{
"ui": {
"nameplate": {
"visible": "always",
"offset": [0, 2.2, 0],
"showHealth": true,
"showName": true
}
}
}

Control when entity UI appears:

ConditionBehavior
alwaysAlways visible
hoverVisible when looking at entity
damagedVisible when health < max
neverNever visible
targetedVisible when targeted