BetterHud 2.2-b04
  • BetterHud
  • OVERVIEW
    • Commands & Permissions
  • TUTORIALS
    • First install
    • Creating a new hud
    • Hud content
    • Placeholders
    • In-game editor
  • CONFIGURATIONS
    • config.yml
    • messages.yml
Powered by GitBook
On this page
  1. TUTORIALS

Hud content

PreviousCreating a new hudNextPlaceholders

Last updated 3 years ago

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

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!

First of all you have to define a type of the part, in this case it's TEXT Every type of part must have position-x, position-y and scale Because we want to display a text, we have to define an input for this part To avoid an overflow of the output, we have to specify a max-length.

You can use placeholders from PAPI instead of static text

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: TEXT
        position-x: 10
        position-y: 5
        scale: 10
        max-length: 32 #The maximum length of the displayed text is 32 characters
        input: "YOU ARE THE BEST"

position-y can't be greather than scale!

First of all you have to define a type of the part, in this case it's INTEGER Every type of part must have position-x, position-y and scale Because we want to display an integer, we have to define an input for this part To avoid an overflow of the output, we have to specify a max-length.

This type can show only numbers, so the input must be a number!

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: 5 #The maximum length of displayed number is 5 digits
        input: "%player_money%"

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.

here