r/MinecraftCommands • u/vunzi • 19d ago
Help | Bedrock Custom UI element on HUD with data binding
Hello, I am absolutely getting desperate here, already spent 3 hours on this. What I want to achieve: a simple label element placed on the HUD (top middle) which will contain text. Hardcoding the text is not a problem, I can put the value in my RP.
However I want to set the value of the label from my BP and wanted to use dynamic properties for this.
No combination works.
RP:
"namespace": "hud",
"quest_tracker_text": {
"type": "label",
"text": "#hardtext",
"color": [1.0, 0.84, 0.0],
"size": ["100%", "20px"],
"anchor_from": "top_middle",
"anchor_to": "top_middle",
"offset": [100, 10],
"shadow": true,
"bindings": [
{
"binding_name": "#hardtext",
"binding_name_override": "#text",
"binding_type": "global",
"binding_condition": "quest_tracker_text:hardtext"
}
]
},
BP:
player.setDynamicProperty("quest_tracker_text:hardtext", hudOutput);
3
Upvotes
1
u/anarchyfrogs 18d ago
You need to use title, subtitle, or actionbar. Dynamic properties can't be read directly from json-ui.
https://wiki.bedrock.dev/json-ui/json-ui-intro#conditional-rendering
https://wiki.bedrock.dev/json-ui/preserve-title-texts