Design
States and Conditions
Show different elements depending on what is happening.
States
A HUD can have states such as Lobby, Combat or Victory. Each state has a priority and an optional condition. The state with the highest priority whose condition holds is the active one. A state without a condition always qualifies.
- An element that belongs to no state is always shown.
- An element that belongs to one or more states is shown only while one of them is active.
- Duration limits how long a state stays active. It can activate again after its condition has been false.
- Transition fades or slides the state's elements in when it activates.
Conditions
Conditions are used by states and by the Show only when field of any element.
%player_health% < 10
%player_world% == "lobby"
%server_online% > 50 && !%player_in_combat%
(%player_level% >= 30 || %player_gamemode% == "CREATIVE") && %player_food% > 6| Syntax | Meaning |
|---|---|
== != < <= > >= | Comparison. Numeric when both sides are numbers, otherwise text. Ordering needs numbers. |
&& || ! | And, or, not. && binds tighter than ||. |
( ) | Grouping, up to 16 levels. |
"text" or 'text', numbers, true, false | Literals |
%placeholder% | The current value. Used alone it is true for true, yes or a non-zero number. |
Conditions are parsed, never executed as code. There are no functions, no arithmetic and no access to the server. A condition is limited to 512 characters.