Skip to content

GitLab

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in
MythicHUD MythicHUD
  • Project overview
    • Project overview
    • Details
    • Activity
  • Issues 4
    • Issues 4
    • List
    • Boards
    • Labels
    • Service Desk
    • Milestones
  • Wiki
    • Wiki
  • Members
    • Members
  • Activity
  • Create a new issue
  • Issue Boards
Collapse sidebar
  • MythicCraft
  • MythicHUDMythicHUD
  • Wiki
  • Conditions

Conditions · Changes

Page history
Create Conditions authored Oct 03, 2024 by Brickgard's avatar Brickgard
Show whitespace changes
Inline Side-by-side
Showing with 66 additions and 0 deletions
+66 -0
  • Conditions.md Conditions.md +66 -0
  • No files found.
Conditions.md 0 → 100644
View page @ ed243527
Conditions can be used to modify HUD appearance based on logical checks against placeholders.
### Condition Formatting
```
conditions:
- <condition type>{<condition arguments>} <outcome> <action> <action variable>
```
#### Condition Type
This is the type of check you are making
| **Type** | **Description** |
| --------------- | ------------------------------------------ |
| [Effect](Conditions/Effect) | Check potion effects active on the user. |
| [gamemode](Conditions/Gamemode) | Check the user's gamemode. |
| [placeholder](Conditions/Placeholder) | Compare placeholders and inputs logically. |
| [progress](Conditions/Progress) | Compare the value output of a listener. |
#### Condition Arguments
Configuration for what the condition is calculating, such as what [Potion Effect](Conditions/Effect) to be checking for.
#### Outcome
This is the condition outcome required for actions to take place. This defaults to `true`.\
`false` may be used to run actions on a false condition outcome.
#### Action
This is what the Condition's Outcome will effect:
| Action | Description | Variable | Example |
| ------- | --------------------------------------------------------------------------- | ------------ | ------------------------------ |
| Hide | If the condition is resolves to false, the hud will be hidden. | N/A | N/A |
| Color | If the condition resolves to true, the hud will be recolored. Supports HEX. | Color | `green` or `#55ff55` |
| Texture | If the condition resolves to true, the hud will be retextured. | Texture Path | `assets/sword/fill_health.png` |
#### Example Conditions
This condition will turn the HUD asset's to the color green if the user has the "luck" effect.
```yaml
conditions: #Hide if the fill layer is empty.
- progress{l=fill;o=>;v=0} true hide
#Color the hud green if the user has the luck effect.
- effect{e=luck} true color green
```
The `default-layout` uses conditions to hide the oxygen bar until its value is in use:
```yaml
vanilla-air:
conditions: #Hide if the fill layer is empty.
- progress{l=fill;o=<;v=100%} true hide
layers:
icon:
texture:
path: assets/vanilla/air.png
offset:
x: -5
y: 2
fill:
texture:
path: assets/vanilla/exp_bar_short_fill.png
color: "#525aff"
offset:
x: 0
y: 0
function:
listener: air
increment: 13
orientation: horizontal
outline:
texture:
path: assets/vanilla/exp_bar_short_outline.png
```
\ No newline at end of file
Clone repository
  • Advanced Version Support
  • Changelog
  • Commands
  • Compatibility
  • Components
    • Asset Layers
    • Assets
  • Conditions
  • Conditions
    • Effect
    • Gamemode
    • Logical Operator
    • Placeholder
    • Progress
  • Fonts
  • Getting Started
  • HUD Components
View All Pages