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
  • MythicHUD API

MythicHUD API · Changes

Page history
add some api info authored Jun 09, 2025 by Boy0000's avatar Boy0000
Hide whitespace changes
Inline Side-by-side
Showing with 44 additions and 2 deletions
+44 -2
  • MythicHUD-API.md MythicHUD-API.md +44 -2
  • No files found.
MythicHUD-API.md
View page @ 2e61f18d
MythicHUD features a rich API for enhanced integration and customization. MythicHUD features a rich API for enhanced integration and customization.
## GradleKts # Dependency Information
### GradleKts
```kt ```kt
repositories { repositories {
maven("https://mvn.lumine.io/repository/maven-releases/") maven("https://mvn.lumine.io/repository/maven-releases/")
...@@ -13,7 +14,7 @@ dependencies { ...@@ -13,7 +14,7 @@ dependencies {
} }
``` ```
## Maven ### Maven
```html ```html
<dependency> <dependency>
<groupId>io.lumine.mythichud</groupId> <groupId>io.lumine.mythichud</groupId>
...@@ -21,4 +22,45 @@ dependencies { ...@@ -21,4 +22,45 @@ dependencies {
<version>$VERSION</version> <version>$VERSION</version>
<scope>provided</scope> <scope>provided</scope>
</dependency> </dependency>
```
# Events
MythicHUD contains a few events you can listen for.
### HUDLayoutAddEvent
Fires whenever a layout is added to be shown to a player.
Can be cancelled to make it not show to a player.
### HUDLayoutRemoveEvent
Fires whenever a layout is removed from a player.
Can be cancelled to make it still show to a player.
### PlayerUpdateAttributeEvent
Fires whenever a player's attributes change
### PlayerUpdateExperienceEvent
Fires whenever a player's experience points change
### PlayerUpdateConsumableEvent
Fires whenever a player's health changes
# HudHolder
A HudHolder is a class wrapped around a Player that handles updating, adding and removing various HudElements, amongst other things. You can get the HudHolder of a player by
```java
MythicHUD.getInstance().holders().getPlayer(Player)
HudHolder.get(Player);
```
The HudHolder is primarily for modifying the HudLayouts for a Player.
```java
public static void test(Player player) {
HudHolder holder = MythicHUD.getInstance().holders().getPlayer(player);
if (holder == null) return;
holder.addLayout(hudLayout);
holder.removeLayout(hudLayout);
Optional<ActiveLayout> activeLayout = holder.getActiveLayout("hudlayout");
if (activeLayout.isPresent()) {
}
``` ```
\ No newline at end of file
Clone repository
Home

Getting Started
What's New in MythicHUD?
Commands and Permissions
Configuration Reference

Layouts
Pop-Ups
HUD Components
  • Asset Layers
  • Assets
  • Listeners
  • Conditions
    • Effect
    • Gamemode
    • Placeholder
    • Progress
    • Logical Operators
Fonts

MythicHUD API
Compatibility
  • Migrating from v1 to v2
  • Supporting Multiple Client Versions
  • Crucible
  • Nexo
  • ItemsAdder
  • Modded Clients