Hud content

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

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

1
configuration:
2
3
hud-refresh:
4
period: 1
5
6
huds:
7
example-hud: #This is the hud, we created in our previous tutorial
8
display: ACTIONBAR
9
permission: "hud.example"
10
toggle-command: "/examplehud"
11
12
hud-content:
13
example-hud: #There's the new section, I've just created
14
Copied!
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:

1
configuration:
2
3
hud-refresh:
4
period: 1
5
6
huds:
7
example-hud:
8
display: ACTIONBAR
9
permission: "hud.example"
10
toggle-command: "/examplehud"
11
12
hud-content:
13
example-hud:
14
new-part: #This is the new hud part
Copied!

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

Icon
Text
Integer
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/
1
configuration:
2
3
hud-refresh:
4
period: 1
5
6
huds:
7
example-hud:
8
display: ACTIONBAR
9
permission: "hud.example"
10
toggle-command: "/examplehud"
11
12
hud-content:
13
example-hud:
14
new-part: #This is the new part, we are configuring
15
type: ICON
16
position-x: 10
17
position-y: 5
18
scale: 10
19
texture-path: "hp.png"
Copied!
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
1
configuration:
2
3
hud-refresh:
4
period: 1
5
6
huds:
7
example-hud:
8
display: ACTIONBAR
9
permission: "hud.example"
10
toggle-command: "/examplehud"
11
12
hud-content:
13
example-hud:
14
new-part: #This is the new part, we are configuring
15
type: TEXT
16
position-x: 10
17
position-y: 5
18
scale: 10
19
max-length: 32 #The maximum length of the displayed text is 32 characters
20
input: "YOU ARE THE BEST"
Copied!
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!
1
configuration:
2
3
hud-refresh:
4
period: 1
5
6
huds:
7
example-hud:
8
display: ACTIONBAR
9
permission: "hud.example"
10
toggle-command: "/examplehud"
11
12
hud-content:
13
example-hud:
14
new-part: #This is the new part, we are configuring
15
type: INTEGER
16
position-x: 10
17
position-y: 5
18
scale: 10
19
max-length: 5 #The maximum length of displayed number is 5 digits
20
input: "%player_money%"
Copied!
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)
1
configuration:
2
3
hud-refresh:
4
period: 1
5
6
huds:
7
example-hud:
8
display: ACTIONBAR
9
permission: "hud.example"
10
toggle-command: "/examplehud"
11
12
hud-content:
13
example-hud:
14
new-part: #This is the new part, we are configuring
15
type: INTEGER
16
position-x: 10
17
position-y: 5
18
scale: 10
19
max-length: 4
20
input: "{health}"
21
fixed-position: true #We have fixed-position enabled, because input is dynamic
Copied!
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.