#JSON-UI General
1 messages · Page 55 of 1
Ig just copy the entire file then and modify parts of it to see the change
Like for example that screen content trick you showed me was nowhere
So I won't be able to save on file space
Welp
I guess that's that
I know modifications can only affect controls iirc
It's just for you to get familiar with what's going on. You won't be able to build anything without familiarity with the system
Controls, Bindings, and Button Mappings
I have fragmented parts of everything
Just no complete picture
I don't like changing UI I don't have to as that's just as bad to me as texture packs that insert all vanilla textures only to change a few
compatibility and all that I guess
If I can just get an example of changing a vanilla screen I think I could learn a lot quicker
As I mentioned before you'll only do it to see what the properties do and to get familiar with the system. After that you can start from scratch
I know what most of the basics do
It's just applying them in context
I remember seeing something like this
But I need to browse the wiki again for the exact format
Then I just make that new control right?
@manic dragon
If you select the operation to be "replace" then you also need to specify which control to replace. So you specify that name in control_name
value will be the code you want to put in that place. Can be an object or array of objects
So I'm doing it right or wrong?
Can you tell I hate this?
Im too broke to commission anyone to make the pack for me so suffering it is
It should be like this
{
"array_name": "controls",
"operation": "replace",
"control_name": "<name of the control you want to replace>",
"value": [
{
"your_control": {}
}
]
}
I think my control name is right here?
Wait no nevermind
Cause this would replace just the panel
Which can't be modified position and anchor-wise
I swear to jebus Im gonna get myself put in the emergency ward for thinking so hard I lose consciousness
Why'd they have to use json
Any other medium would have been 10x better
I'll take assembly code atp
https://github.com/AsakiYuki/AsaJS
Try this ig. It uses js
Haven't tried myself but it has some pretty neat functionality
Isnt this the cheaty way?
wdym
I wont learn by taking shortcuts
As much as this makes me want to drop myself off a 2 story building I have to learn
Full ore UI implementation isn't coming from at least another half decade so
I don't have much choice
I need to stop having these ideas
Every time I want to do something like this. I end up quitting a couple days later because JsonUI is the single most difficult "programming" challenge I've ever tackled
I can write a hello world program in assembly code but not this
What is wrong with me?
Im just going to do it the lazy way and copy the entire file
it is not that hard
đ
Also why do we not have a reload resources button?
I have to take off and put back on the pack every time
if you're working in a world you can use the dev rp folder or something
uh oh sorry then no idea
most of my rp stuff is server and so
I tried the full file and nothing I do changes anything
I could delete every reference of the play button in the UI and it would SOMEHOW still be there
Maybe im just not built for development
I am sure there must be existing addons or ui online which you could check for examples or refs
I have
So many of them
They're all the doing the same thing and yet when I do it
NOTHING HAPPENS
I need to stop im just making myself look like a clown with all this venting
Last I checked that only works on worlds
Besides I've already deleted everything
What are you trying to change exactly
Move
the play button
to the left
of the screen
Turning the whole menu into a sidebar rather than front and center
But Nooooooo
Json UI has to just be special
Im leaving, Im making a fool of myself
{
"main_buttons_panel": {"ignored": true},
"start_screen_content": {
"modifications": [
{
"array_name": "controls",
"operation": "insert_front",
"value": [
{
"stacked_rows": {
"type": "stack_panel",
"size": [200, "100%c"],
"offset": ["1%", 0],
"anchor_from": "left_middle",
"anchor_to": "left_middle",
"controls": [
{
"play_button@common_buttons.light_text_button": {
"size": ["100%", 25],
"$pressed_button_name": "$play_button_target",
"$button_text": "menu.play",
"button_mappings": [
{
"from_button_id": "button.menu_select",
"to_button_id": "$pressed_button_name",
"mapping_type": "pressed"
},
{
"from_button_id": "button.menu_ok",
"to_button_id": "$pressed_button_name",
"mapping_type": "pressed"
},
{
"to_button_id": "play_button.is_hovered",
"mapping_type": "pressed"
}
]
}
},
{
"settings_button@common_buttons.light_text_button": {
"size": ["100%", 25],
"$pressed_button_name": "button.menu_settings",
"$button_text": "menu.settings"
}
},
{
"store_button@common_buttons.light_text_button": {
"size": ["100%", 25],
"$pressed_button_name": "button.menu_store",
"$button_text": "menu.store"
}
}
]
}
}
]
}
]
}
}
To me it looks that you arenât entirely trying to learn it
Have you thought about a place where you save all your encountered knowledge? Notes app or a book?
so true
and the search bar of this discord server is so helpful, found my 90% answers here hehe
is this what you're trying to achieve?
{
"namespace": "start",
"main_buttons_stack_panel": {
"type": "panel",
"size": [ "100%", "100%" ],
"controls": [
{
"[email protected]_button_stack": {
"size": [ 150, 32 ],
"anchor_from": "left_middle",
"anchor_to": "top_left",
"offset": [ 0, -100 ]
}
},
{
"[email protected]_buttons_panel": {
"$play_button_visible": false,
"anchor_from": "left_middle",
"anchor_to": "top_left",
"offset": [ 0, -64 ]
}
}
]
}
}
I guess but I won't be using it as I didn't learn anything from this
There's a command named /reload all
And why do these names seem to not exist in the base file?
I've never heard of "floating_play"
its a custom name
Your pack must be in the development_resource_packs directory for it to work
I thought you had to use modifications to edit existing elements?
you can give it so it doesnt collide with mojang's own play control
This is probably why I've been so confused
I thought that
"Hey so this is an already existing element so to modify it, I would need to use a modifications array targeting the controls of that element"
If you want to modify properties of an element, you don't use modifications. You just write:
element_name:{
"size":[100,100]
}```
I guess the name is partially misleading
This is an example. Let's say that element_name in vanilla is an image, with texture "textures/ui/element_texture" and size [20,20]. With this snippet you change only the size, while keeping the same texture path and element type
You use modifications mainly to remove or add elements, bindings or button mappings
Or even replace
This is exactly why I need a teacher cause the wiki doesn't mention this at all
It teaches you how to make custom elements
Not how to edit existing ones
If you're referring to Microsoft documentation, yeah that one is shit
I recommend the bedrock wiki, I learnt Json UI from there
So I'm not as much as a dumbah as I thought?
Don't worry, it took me a month just to understand modifications and about two to understand element references
Maybe there is hope for me still
Not that I dedicated a month just for Json ui
it does require a LOT of patience though
I'm still working on that lol, the only time I really snap is when I notice that nothing is happening at all
Like today
I tried so much
If that happens I recommend going in the main menu, go to settings, global resources (or the world's resource packs) and see if there's any error. If an error happens, EVERYTHING you've done in that file won't work until you fix the issue
And the game will treat the file as if it doesn't exist
Does anyone why the smithing table screen doesn't react to property modifications at all? I don't get any error either.
{
"namespace": "smithing_table_2_pocket",
//-------------------
// Right Panel
//-------------------
"right_panel":{
"visible": false,
"$cell_texture":"textures/ui/smithing/cell_smithing",
"$background_texture":"textures/ui/smithing/screen_background_smithing",
"$title_background_texture":"textures/ui/smithing/title_background_smithing",
"modifications":[
{
"array_name":"controls",
"operation":"remove",
"control_name": "right_navigation_tabs"
}
]
},
"upgrade_label":{
"color":[0.102,0.106,0.118]
},
"arrow_icon":{
"texture": "textures/ui/smithing/arrow_smithing"
},
//-----------------
// Left Panel
//-----------------
"left_panel/gamepad_helpers_and_tabs_holder":{
"modifications":[
{
"array_name":"controls",
"operation":"remove",
"control_name": "left_navigation_tabs"
}
]
}
}```
I even tried modifying smithing_table_screen_pocket.json, but still nothing
I remember someone suggesting me to interfere with the entry points smithing_table.json, but changing the conditions at which a screen renders doesn't change anything
oh that's why... I wrote smithing_table_screen_2.json instead of smithing_table_2_screen.json for the file's name... Well I guess a 2 week dilemma has been resolved
Does anyone know how to make the textField bigger?
innn what usecase?
can I not just make the textfield bigger?
well yeah but bigger how
in the y direction like you said
think its a variable in this case lemme take a quick look
Ok thanks
"namespace": "server_form",
"generated_contents": {
"factory":{
"name": "buttons",
"control_ids": {
"label": "@server_form.custom_label",
"toggle": "@server_form.custom_toggle",
"slider": "@server_form.custom_slider",
"step_slider": "@server_form.custom_step_slider",
"dropdown": "@server_form.custom_dropdown",
"input": "@server_form.multiline_input",
"header": "@server_form.custom_header",
"divider": "@settings_common.option_group_section_divider"
}
}
},
"[email protected]_panel": {
"size": ["100%", "100%c + 6px"],
"controls": [
{
"input_box@input_box": {}
}
]
},
"[email protected]_text_edit_box": {
"$option_label": "#custom_text",
"size": [ "100%", 60 ],
"$text_edit_box_placeholder_content_binding_name": "#custom_placeholder_text",
"$text_edit_box_placeholder_content_binding_type": "collection",
"$text_edit_box_grid_collection_name": "custom_form",
"max_length": 100,
"$text_edit_box_content_binding_type": "collection",
"$text_edit_box_content_binding_name": "#custom_input_text",
"$option_binding_name": "#custom_input_text",
"$text_box_enabled_binding_name": "#custom_input_enabled",
"$text_box_name": "custom_input"
}
}```
try that out
i believe this is what you were trying to achieve?
yes thanks
you can extend "max_length": 100, to whatever character length u want (not sure if theres a limit)
you mean UI?
How can I give it a scrollpanel? I tried to put it in multiline_input but it was always there but I want it it should apear when there is to much text
you can try using scrollable_multiline_text_edit_box instead
insteadof @common.empty_panel?
so like @common.scrollable_multiline_text_edit_box
in the bottom part, that empty panel is purely for padding, the + 6px can be altered if you want more space between that and other elements. you want to edit this part:
"[email protected]_multiline_text_edit_box": {
so like this ```{
"namespace": "server_form",
"generated_contents": {
"factory":{
"name": "buttons",
"control_ids": {
"label": "@server_form.custom_label",
"toggle": "@server_form.custom_toggle",
"slider": "@server_form.custom_slider",
"step_slider": "@server_form.custom_step_slider",
"dropdown": "@server_form.custom_dropdown",
"input": "@server_form.multiline_input",
"header": "@server_form.custom_header",
"divider": "@settings_common.option_group_section_divider"
}
}
},
"[email protected]_panel": {
"size": ["100%", "100%c + 6px"],
"controls": [
{
"input_box@input_box": {}
}
]
},
"[email protected]_multiline_text_edit_box": {
"$option_label": "#custom_text",
"size": [ "100%", 60 ],
"$text_edit_box_placeholder_content_binding_name": "#custom_placeholder_text",
"$text_edit_box_placeholder_content_binding_type": "collection",
"$text_edit_box_grid_collection_name": "custom_form",
"max_length": 500,
"$text_edit_box_content_binding_type": "collection",
"$text_edit_box_content_binding_name": "#custom_input_text",
"$option_binding_name": "#custom_input_text",
"$text_box_enabled_binding_name": "#custom_input_enabled",
"$text_box_name": "custom_input"
}
}
it doesnt actually have a scroll bar built in i dont think, but it does scroll
I cant click on the textfield anymore
weird it works for me
idk how fleshed out these components are for other platforms tho
not sure tbh, thats just the way it was setup in the common files
hmm Ok I removed it for now but thanks anyway
how bad does it look?
Wanna ask how do they make hud screen controllable and still showing even if form screen is active
Like you can still touch dpad/joystick/move camera while interacting to form ui
I reviewed it here but I still don't get it how some properties work:
"[email protected]_screen": {
"is_showing_menu": "(not ($touch and (not $is_pregame)))",
"absorbs_input": "(not ($touch and (not $is_pregame)))",
"render_only_when_topmost": "(not ($touch and (not $is_pregame)))",
"low_frequency_rendering": true,
"render_game_behind": true,
"$is_full_screen_layout": true,
"$screen_background_control": "common.empty_panel",
"$screen_bg_content": "common.empty_panel",
"$screen_animations": [],
"$background_animations": [],
"button_mappings": [
{
"from_button_id": "button.menu_cancel",
"to_button_id": "button.menu_exit",
"mapping_type": "global"
}
]
},
This is source code from custom buttons addon I saw
I'd suggest aligning it perfectly, and adjust some unnecessary paddings/whitespaces
Also adjust the icon size or font size, it's distracting and doesn't group with the text
I noticed that the text over the textfield is gone
Youâll need to look at how the placeholder text is applied, best to root around in the files where these come from, ui common, settings common etc
ok
@burnt osprey
I'm actually getting somewhere for once
Does anyone know what that realms button on the main menu is called?
I cant seem to find it
And am I able to change it to default panel color?
awesome
realms_button
I tried that
It's giving me that "realms server" thing
send code please
Also am I crazy or is the realms texture like a pixel larger?
I would prefer to change it to be like the others but no clue how yet
I moved them
The only "unique" 1 is play
Can you tell what im going for at least?
@burnt osprey
Would it just be easier to make my own non-templated buttons and figure out how to do bindings manually?
I wouldn't suggest that
I've just noticed that they seem to be varied in since so why not use the common library?
just put each button in your own panel
"eclipse_start@common_ui":{
"type":"button"
}
Can you give me an example?
Cause dont I need the vanilla refs?
nope
you don't need to copy vanilla definitions into your pack
I mean like the @vanilla_control_name
{
"namespace": "start",
"main_buttons_stack_panel": {
"type": "panel",
"size": [ "100%", "100%" ],
"controls": [
{
"play_holder": {
"type": "panel",
"size": [ 150, 30 ],
"anchor_from": "left_middle",
"anchor_to": "top_left",
"offset": [ 10, -50 ],
"controls": [
{ "[email protected]_button": {} }
]
}
}
]
}
}```
And this would fix the weird sizing issues?
you can modify the size
I meant like when I referenced the vanilla assets they were all like 1 pixel off
This is suppose to be uniform
I think they are not uniform by design
try size: ["100%", "100%"] on the holder
That's kinda stupid to me icl
{ "[email protected]_button": { "size": [ "100%", "100%" ] } }
So what does this nested controls method actually change about how the game reads these?
@manic dragon One question, regarding forms, what would be the problem if the buttons for controller players couldn't be pressed?
If focus isn't enabled
Basically "focus_enabled": true is not in the button
I'm so confused
When I changed eclipse_play
The size changed but for the others they stayed the same
First, it changes who owns the layout
Second, did you apply the size override to play only? because it has to go on every button.
I haven't applied the size parameters yet
Ohh
You sound like the gpt chat of the json when someone asks you something.
You know a lot
then is it back to its original template dimensions?
you need to show me whats happening, and the code
Just applied sizes and it's back to what it was before
Why did you anchor to and from differently again?
Its back to normal but the sizes are still wierd
it has been confirmed, echorif is officially AI
how do you feel @manic dragon
I'm gonna start selling subscriptions soon xD
lol
Except EchoRif is actually useful and very reliable and best of all, he doesn't allucinate
Hey, a question, to obtain the UUID of the entity, I know it can be done directly from a script, but isn't there a faster way to do it from json?
No
I learned a lot from the experts here
đ±
I think you should use EchoRif AI as your pronoun
thankfully the time where people here replies to questions with random GIFs is behind us
Bindings are what control where UI leads right?
it is mainly used for handling and manipulating data
I'm just trying to figure out why every single 1 of my panels are a slightly different size despite me using the same dimensions
I thought maybe I just remake the buttons from the ground up instead of using inheritance
Ignore the original menu (my new layout is on the left)
every single button seems to have its own size
Also ignore profile I just haven't moved it yet
I don't know what could be causing this as I've tried explicit size
Idk if this is thge case here but child elements can exceed the parent element size. For example, I can add a texture as a control that is 100% + 5px. It would exceed the parent elements size by 5px.
That's the thing tho I havent really done anything like that as far as I know
Depending on how it set up, the size can also be constrained by the child elements. Meaning that maybe its something with the text
Tbh this kinda confusion is the whole reason I gave up so quickly before
Makes a perfectly structured UI:
Minecraft: "no :)"
Well looks like they are regretting that decision as well
Let's hope ore UI will be better
What you're describing are button mappings
How to override the animation type of screen
Add your animations using $screen_animations array and $background_animations array
Thankss
How do I hide elements based on their collection index?
Get the #collection_index
And
source: (not (#collection_index = 0))
target: #visible
Do we can edit the panorama screen
no
thanks
Is it possible to swap the values in a array binding. Like if #equip_grid_dimensions gives me [x,y] can I manipulate it so that it gives me [y,x] instead?
you can't even get the values as seperate
I guess it's a no then, thanks
Is it possible to make horizontal scrollable panel
Thankss
I see, they just put the elements under scrollbar box to act like horizontal scroll
Had this issue for ages but just never bothered to ask, anyone that makes use of preserved title text, have you ever noticed that you can only run it once every 20 ticks or so? otherwise the game just never registers the change/update? I dont know if it might be due to me using it on such a large scale for my hud, but its super annoying for stuff you want to update fast
I use multiple preserved title texts, i just update each one in a different tick
gotcha, but the issue is somin youve also seen?
only when i was updating them in the same tick
it likes to pick and choose
I seee yea that sounds about right lol, ty
np
i use this system if it might help you
export function addUi(player, updateKey, content, delay = 0) {
const task = () => {
// Get existing data or start fresh
const rawData = player.getDynamicProperty("ui_queue") || "{}";
const queue = JSON.parse(rawData);
// Set the new content (overwrites same key, preserves others)
queue[updateKey] = `${updateKey}${content}`;
// Save back to the player
player.setDynamicProperty("ui_queue", JSON.stringify(queue));
};
if (delay > 0) {
system.runTimeout(task, delay);
} else {
task();
}
}
export function showUi(player) {
const playerData = getPlayerData(player);
const uiLines = [
`update:one: î«${convertText(`${formatWithCommas(playerData.gems)}`, "lightblue")}`, //Gems
`update:two:§a$§f${convertText(metricNumbers(playerData.balance), "white")}`, //Balance
`update:three: î·${convertText(`${formatWithCommas(playerData.minedust)}`, "purple")}`, //Minedust
`update:four: Quests to-do`, //Quests
`update:five:î${convertText(`${(playerData.sell_multiplier).toFixed(2)}x`, "grey")}`, //Multiplier
`update:six: î${convertText(`Backpack:`, "grey")} ${convertText(`${playerData.backpack}`, "white")}${convertText(`/`, "grey")}${convertText(`${playerData.backpack_max}`, "darkgrey")}`, //Backpack
];
const rawQueue = player.getDynamicProperty("ui_queue");
let extraLines = [];
if (rawQueue) {
try { extraLines = Object.values(JSON.parse(rawQueue)); } catch (e) { }
player.setDynamicProperty("ui_queue", undefined);
}
const finalQueue = [...uiLines, ...extraLines];
finalQueue.forEach((content, index) => {
system.runTimeout(() => {
player.onScreenDisplay.setTitle(content);
}, index);
});
}
basically the UiLines are garunteed to run, then addUi adds it to the uiQueue
so it will run in the next available tick
I see yeah that definitely simplifies the issue, ill take a look, thanks for the example :D
hello. is there a chance to make the glyph or custom font smaller?
You either have to make the textures smaller or have to manually split the text and downscale the glyph using font_scale_facror
okay, thank you
i will try
why do this wont work?
"centered_gui_elements_at_bottom_middle_touch": {
"controls": [
{
"hud_icon_touch_no_bar@hud_icon_touch": {
"offset": [ 0, 7 ],
"bindings": [
{
"binding_type": "view",
"source_property_name": "#no_bar",
"target_property_name": "#visible"
}
]
}
},
{
"hud_icon_touch@hud_icon_touch": {
"bindings": [
{
"binding_type": "view",
"source_property_name": "(not #no_bar)",
"target_property_name": "#visible"
}
]
}
},
{
"experience_bar_touch@experience_bar_touch": {
"bindings": [
{
"binding_type": "view",
"source_property_name": "(not #no_bar)",
"target_property_name": "#visible"
}
]
}
},
{ "hotbar@hotbar_only": {}}
],
"bindings": [
{ "binding_name": "#exp_progress" },
{ "binding_name": "#level_number" },
{
"binding_type": "view",
"source_property_name": "((#level_number = '0') and (#exp_progress = 1.0))",
"target_property_name": "#no_bar"
}
]
}
previously its like this and it works
"centered_gui_elements_at_bottom_middle": {
"controls": [
{
"1": {
"type": "panel",
"controls": [
{ "hud_icon_touch@hud_icon": { "offset": [ 0, 7 ] }}
],
"bindings": [
{ "binding_name": "#exp_progress" },
{ "binding_name": "#level_number" },
{
"binding_type": "view",
"source_property_name": "((#level_number = '0') and (#exp_progress = 1.00))",
"target_property_name": "#visible"
}
]
}
},
{
"2": {
"type": "panel",
"controls": [
{ "hud_icon_touch@hud_icon": {}},
{ "experience_bar_touch@experience_bar_touch": {}}
],
"bindings": [
{ "binding_name": "#exp_progress" },
{ "binding_name": "#level_number" },
{
"binding_type": "view",
"source_property_name": "(not ((#level_number = '0') and (#exp_progress = 1.00)))",
"target_property_name": "#visible"
}
]
}
},
{ "hotbar@hotbar_only": {}}
]
},
Is it possible to reduce the size of the glyph?
Without resizing the PNG image?
đ„Č
Well somewhat possible I'd say. You have to render it as a separate label and scale the label using font_scale_factor
That's new to me.
Can I make it so that a grid doesn't add padding between the controls, no matter the size it has? So instead of resizing the controls to include padding between them, it keeps them united and then it anchors them to wherever I want (in this case center)
Is anyone else having this problem? When I modify hud_screen, the effects render stops working completely until I restart the game
(I'm not modifying the render)
seem like a general bug
the effect just don't appear sometimes
OOh thanks
bindings are not inherited by child elements; you must do it this way ```json
{
"binding_type": "view",
"source_control_name": "centered_gui_elements_at_bottom_middle_touch",
"source_property_name": "(not #no_bar)",
"target_property_name": "#visible"
}
What do you mean by cancelling?
I mean, players cant open it by pressing "z".
it should be something like this? i tried and it doesnt work
what should i add? im thinking of adding the old mcpe loading bar
I believe that keybind is hardcoded. Can't remove it
Does anyone know how to add an image/loading screen on the players screen based on like action or title text
nvm figured it out:)
Oh thanks
you can remove the button mapping for it tho
or map it to an invalid button
"button_mappings": [ {
"from_button_id": "button.mobeffects",
"to_button_id": "button.no_data",
"mapping_type": "global"
}]
Thatâs sick
Do you mean the flashy green bar?
Pls help me doesnât work
"flag_hover_button": {
"type": "collection_panel",
"size": [ "100%", "100%" ],
"collection_name": "form_buttons",
"bindings": [
{
"binding_name": "#form_button_length",
"binding_name_override": "#collection_length"
}
],
"$id|default": "0",
"$flag|default": "§f§l§a§g§",
"controls": [
{
"[email protected]_text": {
"ignored": "$default_state",
"property_bag": {
"#hover_text": ""
},
"bindings": [
{
"binding_type": "collection_details",
"binding_collection_name": "form_buttons"
},
{
"binding_type": "collection",
"binding_collection_name": "form_buttons",
"binding_condition": "none",
"binding_name": "#form_button_text",
"binding_name_override": "#form_button_text"
},
{
"binding_type": "view",
"source_property_name": "(not(#form_button_text - ($flag + $id + '§r') = #form_button_text))",
"target_property_name": "#hover_text"
}
]
}
}
]
},
"hover_button@common_buttons.light_content_button": {
"size": [ "100%", "100%" ],
"$pressed_button_name|default": "button.menu_select",
"$default_button_texture": "textures/ui/empty",
"$hover_button_texture": "textures/ui/empty",
"$pressed_button_texture": "textures/ui/empty",
"$default_state_border_visible": false,
"$hover_state_border_visible": false,
"$pressed_state_border_visible": false,
"sound_volume": 0,
"sound_pitch": 0,
"controls": [
{
"hover@my_gui.flag_hover_button": {
"$id": "$hover_id"
}
}
]
}
Doesn't it still open the mob effects menu?
What is this
Un tooltip pour boutton
Qui utilise form boutton text
Et un flag pour différencier
- id
this
man, you just gave me an idea
I tried, but it happened:
- game crash
- It can still be opened
How the heck didn't anyone tell me that "default" and "100%" aren't the same thing for size? The wiki says otherwise
In the text, for example, default is responsible for adapting the size to the size of the text
I think it's "100%" that adapts to the size of the the text, whereas "default" adapts to the size of the textbox itself
Default is only useful for text
it's useful for grids as well, because I can create a grid without paddings regardless of the size it inherits
% is from the parent size
Ok*
Except %y and %x
EPIC RAP BATTLE OF HISTORY
#size_binding_x & #size_binding_y in server form
VS
MY GAME
Uh.. since when we have crosshair renderer got separated from hud file
why does this even such a thing ._.
["default", "default"] is ["100%", "100%"] for most of the types.
But for stack_panel it's actually ["100%", "100%c"] and for labels it's the size of the text
Thank you, that's flattering
It seems to be ["100%c", "100%c] for grids as sell
Probably. I forgot what it was :)
Hello everyone, I have a question, does creating your own hud require digging in JSON files or is there a simpler way such as a website where you can customise the arrangement of everything?
actually nevermind it is now my insanity instead of my game.
it just crashes my game the moment i accidentally put a invaild value smh
even having a property bag or a way to set the default value of it so it shouldn't crash, does in fact. not work.
You did define size property explicitly, right?
yeah.
It crashes if there isn't any size set. Even setting size: [0, 0] works. I'm using this in a lot of places and works properly
Hello I want a renderer custom block but I canât find.
Not related tho
But if you want to render custom blocks you need the item renderer, there's plenty of example codes in this channel. You should search for it, and you will need the aux id for that block
Okay
As far as I know, there is no such website.
I could be mistaken as there are people vibecoding such projects and never reaching it to the masses
I found a GitHub guide, but the steps are only for PC users, and I'm on mobile. :/
Thanks
Coding json ui is pure imagination
Pure pain*
for me, it crashes invaild value only.
Pure hopes and dreams
Turned out setting the size as a fixed px value seems to work, not really at percentage value though for some reason.
I set size to 0 for whichever binding I'm working with. e.g- If I modify #size_binding_x, the I set size x to 0 and y to some fixed value and vice versa. iirc 100% works too (I used it in Animated Bar)
I don't usually set any default sizing since i know it's going to be something i do not have to unless if necessary.
i like my code clean not spaghetti tbh
yeah I get that. But the size binding needs the size property defined explicitly
So I add that when I work with these bindings
Ok so remember when I said that using "default" in grids made it so that the grid inherits its child controls sizes? Well now, it displays the first item in the grid only
I LOVE JSON UI
I HATE Json ui
i was being sarcastic
Oh okay x)
it's better than ore ui performance wise atleast
The performance isn't that big of an issue for me. I just want it to be customizable. Just have to wait & see...
My other request is it to be client-sided
can multiple screens be rendered on top of one another with JSON UI? If yes, how would I go about making that work?
JSON ui
@manic dragon thanks again for the animation bar, smooth asl
Yooo thatâs so sick
One question, can you change the color of the scroll?
"exp_progress_bar_and_hotbar/resizing_hotbar_locator_bar/locator_bar":{
"anchor_from":"top_middle",
"anchor_to":"top_middle",
"offset": [0,-460]
},```
How do I place the locator bar in the top_middle area, at the very top of the screen? Because when I do it that way and adjust the game's GUI scale, it goes off-screen.
forget it, I already did it
Why he lookin kinda fried
ngl it's hard to build intuition at first
But it gets easier
JSON UI is bad. Good idea, bad execution.
it's better than what they are doing with OreUI imo
once you understand json ui then you're good to go
This is debatable.
JSON UI is not officially documented, doesn't support DDUI, has alot of vurnelabilities, bugs that you have no way to figure out using logs. And much more things that are wrong with it
While yes, JSON UI is "better" compared to current OreUI, it is still bad
The difficulty is not the only thing wrong with it.
yeah cuz you replied đ
fair
didn't they make official docs this year
Still incomplete...
Still ass, forever ass
y'all just haters fr

I'm talking about those docs

the docs are indeed ass
the descriptions for the properties are interesting but that's about it
Is it possible to pass a dynamic value to #ignored? For example, sending a title that says true or false, or any value that makes it work dynamically? Because from what I've seen, when ignored is active, it doesn't execute the code, while visible still executes it, but makes it invisible.
Nope
Is it possible to modify this UI?
Is there any way I can get the factory index? For example, I set up a factory to generate 10 apples and changed the position of the first and last apple. I'm trying to replicate the hearts from vanilla Minecraft, but I found that the textures are too close together, forming a double black pixel. So I thought about separating the initial and final parts, but I don't know how to get the factory index to do that.
just wrap your heart element in a panel of size [8,9]
I discovered this much later, but is there a way for me to get the factory index? It would be useful for creating automated systems.
ig you mean getting the collection index of each element?
{
"binding_type": "collection_details",
"binding_collection_name": "<your_collection_name>"
}
add that binding wherever you want to use #collection_index
[
{
"binding_type": "collection_details",
"binding_collection_name": "<your_collection_name>"
}
{
"binding_type": "view",
"source_property_name": "(#collection_index < 6)",
"target_property_name": "#visible"
}
]
Is "collection name" the name I use within the factory?
it's the "collection_name" property you set on the collection_panel or stack_panel
in your case you didnt set one
so just add "collection_name": "custom_collection" on your stack_panel/collection_panel element and use that collection name
I've never used that to be honest.
Ok
its not necessary unless you want to use #collection_index
Oh, ok
That's good to know.
How can we use a factory with custom data?
Meaning?
on the topic of factories, im trying to make indexable toggles, but idk what else im supposed to declare here lol. If i add a factory can that still even be indexed? as opposed to using a collection panel
"type": "stack_panel",
"collection_name": "custom_form",
"orientation": "horizontal",
"size": [ "100% - 94px", 12 ],
"offset": [ -20, 9.5 ],
"anchor_from": "top_right",
"anchor_to": "top_right",
"controls": [
{
"toggle_1@custom_toggles.category_toggle": { "collection_index": 0 }
},
{
"padding@category_padding": { }
},
{
"toggle_2@custom_toggles.category_toggle": { "collection_index": 1 }
}
]
},```
shouldve added more context but this is for server form modals
Factories automatically index the generated content if that's what you mean
well i need to create multiple factories for different scrolling stacks, but that obviously gets pretty heavy on load times, so im trying to make it better by hardcoding some of them into indexs. would you say then if i call the collection panel from inside the factory, would somin like that work?
"factory": {
"name": "buttons",
"control_ids": {
"toggle": "@form.category_toggles"
}
}
},```
It'll most probably work but is it really necessary to use a factory here if you intend to hardcode the toggles
I still need them to return data script api side tho
idk im so clueless in anything other than actionform lmao
theyre basically just button mapped to act like clickable buttons, and act as categories you can click to switch between menus, there wont be anymore than 10, hence why i was hoping to hardcode them and cut down load delays as modal forms seem to be pretty damn intensive
You don't need the factory for that. Hardcoding them will work fine as long as the collection is correct
oh youre completely right im an idiot i had the toggles parent scaling by the child that had 100% đ
yeah that works anyways awesome thanks for the help
What are the use cases of factories besides generating already existing collections like form buttons ?
It's not limited to already existing collections. Generally speaking, you use a factory when you need to generate content dynamically
A good example would be chat msgs
Is this correct? I wanted it to move up and down hearts.
"heart_bob_up": {
"anim_type": "offset",
"easing": "in_out_sine",
"from": [0, 0],
"to": [0, -20],
"duration": 10,
"next": "@dz_core_elements_image_factory.heart_bob_down"
},
"heart_bob_down": {
"anim_type": "offset",
"easing": "in_out_sine",
"from": [0, -20],
"to": [0, 0],
"duration": 10,
"next": "@dz_core_elements_image_factory.heart_bob_up"
}```
I tried calling it that way and it didn't work.
"core_elements_image_health": {
"type": "image",
"texture": "textures/ui/destinyz/player/hud/heart",
"offset": "@dz_core_elements_image_factory.heart_bob_up",
// "anims":["@dz_core_elements_image_factory.heart_bob_up"],
"size": [
8,
7
],
"layer": 999,
"controls": [
{
"health_empty": {
"type": "image",
"layer": -1,
"texture": "textures/ui/destinyz/player/hud/heart_background",
"size": [
9,
9
]
}
}
]
}
Is your image inside a stack_panel?
yes
Hmm, so it's not possible? Do you know of any way I could generate multiple hearts together and apply an animation similar to vanilla Minecraft?
Why would it not be possible. Keep your stack panel but instead of adding the images directly in the stack panel, create a panel for each image and add those to the stack panel. The images will be inside the panels
Then your animations will work
Okay, but how would I apply an animation that progressively increases in size? For example, when you have the regeneration effect, it applies one animation to each heart and increases it. Do you know how I could do that? That would help me a lot.
ok
Make different animations for each of the hearts and start them with increasing delay
But chat is already existing
\
How can I make a factory generate 5 items ?
Put it inside a collection panel or stack panel and then override the #collection_length binding with an integer value
Ohhhh
@limpid reef
its exemple
"core_elements_image_factory": {
"type": "stack_panel",
"orientation": "horizontal",
"size": [
"100%",
"100%"
],
"collection_name": "core_elements_controller",
"factory": {
"name": "label_factory",
"control_name": "@dz_core_elements_image_factory.core_elements_controller",
"max_children_size": 10
},
"property_bag": {
"#length": 10
},
"bindings": [
{
"binding_type": "view",
"source_property_name": "#length",
"target_property_name": "#collection_length"
}
]
},```
Thank you guys
I put it on a panel, but now the image isn't stacking.
https://discord.com/channels/523663022053392405/1509400118766338068
Since I've seen you have plenty of experience with JSON UI, may I ask you what's the best way to have a middle ground between speed of learning and solid foundations in terms of JSON UI knowledge? Is it exploring the wiki's docs or analysing vanilla files. I assume creating a personal project is the absolute best way, but before that even theory is quite important.
Lets make a JSON UI school đ« đ
Imo the best way to learn is to see example codes. At first, they didn't make much sense to me either. But I experimented with the codes, like tweaking the properties and seeing what's affected. And I also used them in my projects. After you understand what the properties actually do, you can easily understand the vanilla codes, and they have a lot of scenarios covered.
JSON UI Academy. Cambridge and Oxford are already shivering
Got it thanks. Is there a place where I can find many example snippets, beside reverse-engineering other people's files?
Yes, it's true, once you understand how things work, you end up getting the hang of it.
This forum has plenty. Just have to search and find it. You can also look for what you want in the old json ui channel
Did you see the dynamic interface I made? @manic dragon
Which one?
If you could look at my code and suggest how I could improve its performance, I've tried several ways but haven't been able to reach a satisfactory result.
I might've missed it somehow. I can probably do that when I have time. Currently a bit busy with some work
Okay, when you have time, if you could give it some attention, I'd appreciate it. Well, at least I think that would make life easier for many people.
Oh yeah, thanks for your help today.
how can I do my UIs not be modified by Gui Scale settings?
Use "fill": true or "keep_ratio": false
thank you 
Hello
Could someone help me add a cookbook to my UI? I really need this help. I would be very grateful to anyone who can provide it. đ
Crazy
Can we grab data with Json UI like charge time for a held item?
Curious if I can make a bow charge progress bar slightly above / below the crosshair
you could totally do it with a /title display and scripting
then use json ui to display texture based on the title
yea #1510435721553383574
like it appears it just doesnt
do the whole thing its supposed to specifically do
almost definitely an issue on my part
yea
@placid geode could you check your DM please?
I always use it, so its not possible :(
iâm new here, can you guys help me add hover text to this button?
{
"default_styled_button_text_label": {
"color": "$light_button_default_text_color",
"modifications": [
{
"array_name": "bindings",
"operation": "remove",
"where": {
"binding_name_override": "#color"
}
}
]
}
}
i have no idea how to do it
Apparently I've learned that using the "debug" property has a significant impact on performance
and also, why for most of the things are "pressed" and "hover" controls swapped?
I did not ever experience this.
Would you elaborate on that?
I mean sometimes, the controls that get used in the hover state are called "pressed_image" (or something similar) and viceversa
This applies to textures as well
In vanilla ui's made by mojang?
That is often intentional
The pressed texture is often unnecessary to change and the hover one would be enough.
yes?
yeah but sometimes the terms are enchanged completely
What terms?
This only applies to toggles mostly if you're using mojang UIs.
hover and pressed: the texture called "pressed" gets used when the control is hovered, and the texture called "hovered" gets used in the pressed state
I feel like I've experienced somewhere else, but most likely you're right. Still, it doesn't make sense
I done alot especially pre-game UIs so i know what those are.
Yeah i know it's pretty annoying.
In which i ended up making my own things (i.e buttons, toggles, sliders etc) anyways.
so i know which one i modify and can optimize it.
Hi everyone, I'm trying to hide a mark texture when the entity's health drops to a certain threshold. Does anyone know how to do that?
I think u must use /title command and mix it with #title_text @fossil prism
That's the only way to communicate with json UI for now
I think using a title would make the textures less noticeable.
Actually there is a way to hide textures with certain text in em like add prefix
I found something useful: dividing one string by another string returns the number of occurrences of string_divisor in string_dividend
"test_label": {
"type": "label",
"text": "#output",
"property_bag": {"#test": "hi hi :)"},
"bindings": [
{
"binding_type": "view",
"source_property_name": "('output: ' + (#test / 'hi'))", // output: 2
"target_property_name": "#output"
},
{
"binding_type": "view",
"source_property_name": "('output: ' + (#test / ':)'))", // output: 1
"target_property_name": "#out"
},
{
"binding_type": "view",
"source_property_name": "('output: ' + (#test / 'bao'))", // output: 0
"target_property_name": "#put"
}
]
}
}```
Hello ! Does anyone know hot to use an url to display an image in a chest screen for example ? I know it is possible in server form but I havenât succeeded to reproduct that in a chest screeen
Added a tutorial page for Factories and Grids
Thanks for bakedpotato4173's help with this
Thank you so much cuz I never understood factories
guys i have a question, how are the json uis triggered. like for eg cartography_table.json being triggered by the interaction of a player and a carto table. and i wanna see if there is a mechanic to trigger a custom json ui to a custom block
The UI you mentioned is triggered internally. But for a custom block, if I'm not wrong, you need to have an entity inside. And entities can open their inventory. So you can customize that
Or if you want to use server forms you can do that through an event listener and open the UI that way
ohhhh
if im not mistaken, we cant really store items inside data forms right?
Not as easily as chest UIs. And interaction is very limited too
yep
Hello ! Does anyone know how to use an url to display an image in a chest screen for example ? I know it is possible in server form but I havenât succeeded to reproduct that in a chest screeen
Afaik you can't
Sorry for bothering but, do you know some way to delete a factory generated element, so it get ignored by the max children property?
I want to hide chat messages with a certain prefix, but setting their visibility to false still effects the max children...
destroy them with an animation. That's the only way I know of. For chat messages, use an animation with "destroy_at_end": "chat_grid_item"
How do I trigger the animation conditionally?
tysm i'll try it latter
Through a factory
You'd generate an element conditionally that'll have the animation
Like adding a modification to the chat grid item, introducing the factory, and making that factory visible under a specific condition, so it creates the animation?
If I put it simply, your generated chat msg should contain a factory anywhere inside. That factory will generate a panel or something else that will have the destroy animation
For the use of factory, see the tutorial page
ok tysm
Does anyone knows how to use this: https://github.com/jfbedrock/jsonforge
does anyone know if its possible to pull every single texture from a typeid?
or is there some resource with every typeid that goes with every texture
i am trying to make an auction system where the player can list an item, but i did not want to have to save every texture from the game itself or make a system within javascript to convert.
i was thinking about aux id, but i am unsure how i would do it
i ended up just dumping ItemTypes into a log file, and then writing a bunch of nodejs.
lol classic by the way do you have any idea? How to do title hud because I have no freaking clue what I'm doing
https://wiki.bedrock.dev/json-ui/add-hud-elements
that and hud_screen.json
Tu peux pas
Can I bind the visibility of an element in enchanting_screen_pocket.json to whether the item that the player tries to enchant can be enchanted or not (whether it's because the item can't have enchantments or because it's already enchanted)?
I'm having issues with binding
I can have it appear on the screen easily
it is binding
apparently there's an #active_enchantment binding. I'll later test it
I don't think that could be possible
ask
is this true?
JSON UI is being deprecated in favor of Ore UI. Mojang has confirmed that any add-ons that use JSON UI will eventually stop working in the coming years. Unlike JSON UI, Ore UI is hardcoded and cannot be modified by resource packs.
???
In the future Ore UI will have support for custom addons, not for now, and the most likely thing, as you say, is that in the future the addons with json ui will stop working, but by then it is most likely that it will already be possible to use ore ui
uh
Take your time
yeah
I think the change is between 1 and 3 years
well, there I said in a few years, I hope it's not too soon
How do i create a conditional animation?
with a cup of coffee and a little time
"bindings": [
{
"binding_name": "#form_button_texture",
"binding_name_override": "#texture",
"binding_type": "collection",
"binding_collection_name": "form_buttons"
},
{
"binding_name": "#form_button_texture_file_system",
"binding_name_override": "#texture_file_system",
"binding_type": "collection",
"binding_collection_name": "form_buttons"
},
{
"binding_type": "view",
"source_property_name": "(not ((#texture = '') or (#texture = 'loading')))",
"target_property_name": "#visible"
}
]
with the button icon bindings of a server form, does anyone know if you can change the pink unknown texture to your own?
perhaps with {
"binding_type": "view",
"source_property_name": "(not ((#texture = '') or (#texture = 'loading')))",
"target_property_name": "#visible"
}
i could use a property bag to set the texture no?
is there any way i can make the hotbar bigger than it is? even after using the extra large ui option can i make it bigger and how
How do I add animations to elements created using the title preservation feature? The animation starts playing immediately when I join the game.
horizontal scroll, with scroll box track is Crazy
is it possible to make toggle have pressed_state visual?? i ask gemini, use button and change mapping "consume_event": false, for toggle??
Would it be possible to unlock the hotbar from the HUD screen so I can move it freely? (Each slot individually)
Yes
Not sure if this is already a standard, but I think it would be great if all JSON UI resource pack developers had a flag global variable so that other pack creators can make different property values depending on whether that global variable is true or not. Without the pack, it would be false, else true
I think this is what you want
I've thought of it before and It seems like a good idea on surface but it is really hard to enforce such a standard when you can't even get them in one place.
Not what I meant, but thanks regardless
The creator of a pack could choose to make changes depending on the value of that variable (Boolean) to improve compatibility with other packs without affecting the ones that dont use other packs
For example, some of my buttons overlap with the ones in déesse ui
Still you might have to make multiple variations of the same element (e.g button) to change its position. Overlaps like these can happen a lot and too many cases to hardcode imo
I'd consider giving the user option to change positions themselves. Even that has its own issues
anyone knows an addon that makes playername tag background transparent
can we add custom color codes §
Pretty sure we can't
We can use any character after § and it won't show in the rendered screen like color codes. But they won't display any colors
Thought as much, just seen some color codes in the global variables and i thought they were used for that
no but you can just make glyph chart and change the color of characters to whatever
Oh I just noticed Déesse UI already has something like this