Hud content

1. Firstly, make sure you have already created hud (Tutorial here)

2. Now, create a new section for your existing hud:

configuration:

  hud-refresh:
    period: 1
    
  huds:
    example-hud: #This is the hud, we created in our previous tutorial
      display: ACTIONBAR
      permission: "hud.example"
      toggle-command: "/examplehud"
  
  hud-content:
    example-hud: #There's the new section, I've just created
     

The name of the section must be equal to the hud's name!

3. Create a new "Hud part" inside the section we've just created:

configuration:

  hud-refresh:
    period: 1
    
  huds:
    example-hud: 
      display: ACTIONBAR
      permission: "hud.example"
      toggle-command: "/examplehud"
  
  hud-content:
    example-hud: 
      new-part: #This is the new hud part

4. We have to configure this hud part, firstly choose what you want to display:

First of all you have to define a type of the part, in this case it's ICON Every type of part must have position-x, position-y and scale Because we want to display an icon, we have to define a path to the texture, I've used a default BetterHud icon "hp.png"

Every icon you want to display must be located inside this folder:ItemsAdder/data/resource_packs/assets/betterhud/textures/font/icons/

configuration:

  hud-refresh:
    period: 1
    
  huds:
    example-hud: 
      display: ACTIONBAR
      permission: "hud.example"
      toggle-command: "/examplehud"
  
  hud-content:
    example-hud: 
      new-part: #This is the new part, we are configuring
        type: ICON
        position-x: 10
        position-y: 5
        scale: 10
        texture-path: "hp.png"

position-y can't be greather than scale!

5. Fixed position (optional)

This option sticks the part to the certain position (It's higly recommended to enable this, when placeholders are used)

configuration:

  hud-refresh:
    period: 1
    
  huds:
    example-hud: 
      display: ACTIONBAR
      permission: "hud.example"
      toggle-command: "/examplehud"
  
  hud-content:
    example-hud: 
      new-part: #This is the new part, we are configuring
        type: INTEGER
        position-x: 10
        position-y: 5
        scale: 10
        max-length: 4
        input: "{health}"
        fixed-position: true #We have fixed-position enabled, because input is dynamic

Example:

Frequently asked questions

Q: Whats the difference between text and integer?

A: Text can show every character from the alphabet, some special characters and numbers, beside Integer can show only numbers. I've chosen this solution, because text type creates a lot of font-characters and its a waste of characters, when you want for example display only player's health level.

Last updated