Popups are temporary HUD elements that appear in response to events and automatically disappear after a duration. They’re perfect for damage indicators, notifications, quest updates, and any information that should briefly grab the player’s attention.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/toxicity188/BetterHud/llms.txt
Use this file to discover all available pages before exploring further.
What is a Popup?
A Popup is aHudObject that:
- Appears temporarily when triggered by an event
- Automatically disappears after a configured duration
- Can be stacked (multiple popups showing simultaneously)
- Supports animations and movement effects
- Can be queued when too many appear at once
Unlike Huds, Popups are event-driven and temporary. They show up, animate, then fade away.
Basic Structure
Popups are defined in YAML files in thepopups/ directory:
Real Example: Entity Health Popup
Here’s the actual entity health popup from BetterHud’s source:Popup Layouts
The referenced layouts are defined inlayouts/entity-layout.yml:
Popups can combine images and texts in their layouts to create rich notifications.
Triggers
Triggers determine when a popup appears:Common Trigger Classes
| Trigger | When it Fires | Use Case |
|---|---|---|
entity_attack | Player attacks entity | Damage indicators |
player_death | Player dies | Death messages |
player_join | Player joins server | Welcome messages |
player_quit | Player leaves server | Goodbye messages |
command | Command executed | Command feedback |
custom | API call | Plugin integration |
Duration and Timing
Control how long popups display:Frame Types
Local Timing
frame-type: local - Each popup has its own animation timeline starting from 0Global Timing
frame-type: global - All popups share the global tick counterLocal timing is recommended for most popups as it ensures animations play consistently regardless of when the popup was triggered.
Movement and Animation
Popups can move and animate during their lifetime:Animation Variables
t- Time since popup appeared (0 to duration)- Mathematical functions -
sin,cos,exp,log, etc.
Movement Examples
- Float Up
- Bounce
- Fade In
- Spiral
Stacking Popups
Control how multiple popups interact:Push Behavior
Push Enabled
push: true - New popups stack above old ones. Old popups remain visible.Push Disabled
push: false - New popups replace old ones in the same group.Stack Sorting
Control the order of stacked popups:When
max-stack is reached, the oldest popup is removed to make room for the new one.Popup Groups
Organize related popups into groups:- Share the same stack limit
- Can be hidden/shown together
- Are positioned relative to each other
Key Mapping
Track popups per-entity or per-object:key-mapping: true:
- Attacking Entity A and Entity B shows two separate popups
- Each entity’s popup updates independently
- Perfect for per-target damage indicators
The “key” is typically the entity UUID or a unique identifier from the trigger event.
Showing Popups via API
Trigger popups programmatically:With Skript
Variables passed in the
UpdateEvent can be used as placeholders in the popup layout.Hiding Popups
Remove popups programmatically:Advanced: Conditions
Show popups only when conditions are met:Complete Example
A full-featured damage indicator popup:Best Practices
Performance
Performance
- Limit
max-stackto reasonable numbers (5-10) - Use appropriate
durationvalues (don’t make them too long) - Add
cooldownto frequently-triggered popups
User Experience
User Experience
- Don’t overwhelm players with too many popups
- Use movement to direct attention (up = good, down = bad)
- Keep popup text concise
- Use groups to organize related notifications
Design
Design
- Test animations at different frame rates
- Ensure popups don’t obscure important UI elements
- Use consistent styling across popup types
Next Steps
Triggers
Learn about all available trigger types
Layouts
Configure text and image layouts
API: Popups
Trigger popups programmatically
Huds
Learn about persistent HUD displays
