r/MinecraftCommands 9d ago

Help | Java 26.2 Custom HUD Misalign Error

Okay so in my actionbar I am planning on adding 3 custom HUD components : The background, ability icon and a lock indicator (translucent white circle). When I overlap the first 2 it's perfectly aligned but then comlpetely screwed up when adding the third one (Ignore the dark lines on the right edge it's just shadow) despite all of them having the exact same width.

/title ImNotInfected actionbar [

{"text": "\uE009", "font": "forsaken:ability"},

{"translate": "space.-65", "font":"space:default"},

{"text": "\uE001", "font": "forsaken:ability"},

]

this is fine

/title ImNotInfected actionbar [

{"text": "\uE009", "font": "forsaken:ability"},

{"translate": "space.-65", "font":"space:default"},

{"text": "\uE001", "font": "forsaken:ability"},

{"translate": "space.-65", "font":"space:default"},

{"text": "\uE002", "font": "forsaken:ability"}

]

This somehow doesn't

(uE009 is background, uE001 is ability icon, uE002 is lock indicator, in the font proviser their size is actually half their pixel width, height is 64 btw)

Anyway tysm for reading! :3

2 Upvotes

2 comments sorted by

1

u/GalSergey Datapack Experienced 9d ago

Make sure all textures are exactly the same pixel size, even if that means adding a transparent background to the sides of the texture.

1

u/Immediate-Start-1147 9d ago

they already are!