#JSON-UI General

1 messages · Page 54 of 1

merry spade
manic dragon
merry spade
manic dragon
#

Okay, so first you have to add a preserved title panel from the wiki for each slot
so 9 in total. you have to add them to the root panel in hud_screen
basically this code

"data_control": { // make sure to use different name for all
    "type": "panel",
    "size": [0, 0],
    "$update_string": "<prefix for your title>", // probably something like technique_slot_0:
    "bindings": [
        {
            "binding_name": "#hud_title_text_string"
        },
        {
            "binding_name": "#hud_title_text_string",
            "binding_name_override": "#preserved_text",
            "binding_condition": "visibility_changed"
        },
        {
            "binding_type": "view",
            "source_property_name": "(not (#hud_title_text_string = #preserved_text) and not ((#hud_title_text_string - $update_string) = #hud_title_text_string))",
            "target_property_name": "#visible"
        }
    ]
}
merry spade
#

Okay

manic dragon
#

then you need to use this #preserved_text binding from here in your code instead of #hud_title_text_string
e.g-

"technique_image": {
    "type": "image",
    "texture": "$icon_texture",
    "$condition": "($slot_condition + $technique_id)",
    "bindings": [
        {
            "binding_type": "view",
            "source_control_name": "data_control", // or whatever name you chose for the preserved panel for this slot
            "source_property_name": "(not((#preserved_text - $condition) = #preserved_text))",
            "target_property_name": "#visible"
        }
    ]
}
merry spade
manic dragon
#

you added these stuff in the hud_screen, right?
that would be enough

merry spade
#

this my hudscreen

manic dragon
#

should be enough

merry spade
#

okay \

merry spade
manic dragon
#

wdym

merry spade
#

{
"binding_name": "#hud_title_text_string"
},
{
"binding_type": "view",
"source_property_name": "(not((#preserved_text - $condition) = #preserved_text))",
"target_property_name": "#visible"
}

#

this

#

do i need 9 of those too but

manic dragon
#

you just need to provide the correct name in the source_control_name

#

maybe through variables

merry spade
#

so i should make it like "$slot": "('technique_slot_' - $technique_slot - ':' )", this

manic dragon
#

yes

merry spade
#

okay do you want me to send the update thing for you can look at it

manic dragon
#

sure

merry spade
#

but now when i load in it just

#

and some errors

manic dragon
#

you have to add them using modifications
just like the side panel

#

also your bindings are wrong

#

I told you to keep them like this

{
    "binding_type": "view",
    "source_control_name": "data_control", // or whatever name you chose for the preserved panel for this slot
    "source_property_name": "(not((#preserved_text - $condition) = #preserved_text))",
    "target_property_name": "#visible"
}
merry spade
#

sorry one sec

merry spade
manic dragon
#

just a sec

merry spade
#

okay

manic dragon
#

this should be your hud_screen code

{
  "root_panel": {
    "modifications": [
      {
        "array_name": "controls",
        "operation": "insert_front",
        "value": [
          { "Cursedtechniques_sidebar@Cursedtechniques_sidebar.Cursedtechniques_sidebar_panel": {} },
          { "data_control0@data_control_template": { "$update_string": "technique_slot_0" } },
          { "data_control1@data_control_template": { "$update_string": "technique_slot_1" } },
          { "data_control2@data_control_template": { "$update_string": "technique_slot_2" } },
          { "data_control3@data_control_template": { "$update_string": "technique_slot_3" } },
          { "data_control4@data_control_template": { "$update_string": "technique_slot_4" } },
          { "data_control5@data_control_template": { "$update_string": "technique_slot_5" } },
          { "data_control6@data_control_template": { "$update_string": "technique_slot_6" } },
          { "data_control7@data_control_template": { "$update_string": "technique_slot_7" } },
          { "data_control0@data_control_template": { "$update_string": "technique_slot_8" } }
        ]
      }
    ]
  },

  "data_control_template": { 
    "type": "panel",
    "size": [0, 0],
    "bindings": [
      {
        "binding_name": "#hud_title_text_string"
      },
      {
        "binding_name": "#hud_title_text_string",
        "binding_name_override": "#preserved_text",
        "binding_condition": "visibility_changed"
      },
      {
        "binding_type": "view",
        "source_property_name": "(not (#hud_title_text_string = #preserved_text) and not ((#hud_title_text_string - $update_string) = #hud_title_text_string))",
        "target_property_name": "#visible"
      }
    ]
  }
}
merry spade
#

okay let me try it

manic dragon
#

this will be your bindings

{
    "$scn": "('data_control' + $technique_slot)",
    "binding_type": "view",
    "source_control_name": "$scn",
    "source_property_name": "(not((#preserved_text - $condition) = #preserved_text))",
    "target_property_name": "#visible"
}
merry spade
#

okay i change the binding but it still dose the images on top of each other {
"technique_image": {
"type": "image",
"texture": "$icon_texture",
"$condition": "($slot_condition + $technique_id)",
"bindings": [
{
"binding_type": "view",
"source_control_name": "data_control+$slot",
"source_property_name": "(not((#preserved_text - $condition) = #preserved_text))",
"target_property_name": "#visible"
}
]
}
}
]
}
}

#

okay one sec

manic dragon
#

if you get any errors
paste them here

merry spade
#

okay it work it just didnt get the last slot

#

also how do i make the title not apper

#

oh and do i need to do something with script api for i can make them keep there slot data and reput it when they leave and rejoin

manic dragon
#

to store slot data you can use dynamic properties
and to send title when player joins and leaves, subscribe to the playerJoin and playerLeave events

manic dragon
manic dragon
merry spade
manic dragon
merry spade
#

and how do i do them

merry spade
# manic dragon hotbar slots?

yeah and how can i make this work where i send muitable things to it then it gose though them and make it go to the hot bar or is that impossablefunction setTechnique(player, slot, techniqueId) {
player.onScreenDisplay.setTitle(technique_slot_${slot}:${techniqueId},
{
stayDuration: 0,
fadeInDuration: 0,
fadeOutDuration: 0
});
}

manic dragon
#

it's possible ig, you should read the documentation for more info

merry spade
merry spade
buoyant niche
#

"text": "#gamertag_label",
"bindings": [
{
"binding_name": "#gamertag_label"
}
]
prueba con esto

jolly rock
#

It's the scoreboard list i think

buoyant niche
#

ahh I already saw what he really wants haha

manic dragon
#

you need a grid to get the username

"playername_grid": {
  "type": "grid",
  "size": ["100%c", "100%c"],
  "grid_dimensions": [1, 1],
  "grid_item_template": "hud.player_name",
  "collection_name": "players_collection"
},

"player_name": {
  "type": "label",
  "text": "#gamertag",
  "bindings": [
    {
      "binding_name": "#gamertag",
      "binding_type": "collection",
      "binding_collection_name": "players_collection"
    }
  ]
}
tranquil void
#

heyall im gonna start making stuff again
hypothetical question

#

nvm i just realised it's probably not going to work

#

was going to ask
i have a custom ui for a chest because i'll use it for a machine
I have one of those placeholder items used to simulate a flame progress thing
Would it be possible to do take the flame texture from the furnace, but replace the clip_ratio binding based off of the item's name

#

so have a flame image as a control inside a container_iitem, and replace it's #clip_ratio conditionally based off of the set name of the item

#

e.j. I have an item called example:flame_progress_bar which has no texture, i set the name to "1", and then i use that to determine the clip ratio

#

that way i don't need one item per frame of the animation

buoyant niche
#

hi

valid swan
#

pinkguy

hollow needle
#

How can I modify a number in a text box/label with a button?

#

I'm trying to add 2 buttons to add and reduce to a number

leaden kayak
#

Im trying to use live_horse_renderer in a chest_boat container and I'm passing the entity id through #hover_text but the paper doll refuses to appear. I added a label to test if the entity_id was being passed correctly and it was. Here is my code. Any help is appreciated.

{
                    "npc_renderer": {
                      "type": "custom",
                      "renderer": "live_horse_renderer",
                      "size": ["100%", "100%"],
                      "property_bag": {
                        "#look_at_cursor": true
                      },
                      "bindings": [
                        {
                          "binding_name": "#hover_text",
                          "binding_name_override": "#entity_id",
                          "binding_type": "collection",
                          "binding_collection_name": "container_items"
                        }
                      ]
                    }
                  }```
mint charm
#

Hey, I have a question. I put an image in the hud_screen as an animation with the title, but if I change the screen safe zone, the image's borders are visible. Is there any way to prevent that?

rocky canyon
#

Is there some errors? I tried to modify info_control in order to read the #all_text in the user_interface panel.but it didn't show anything

mint charm
placid geode
mint charm
unreal ravine
#

Yo guys, Quick question.
theres an alternative way to make this without looping in flip-book???

tranquil void
#

wish me luck

unreal ravine
manic dragon
hasty hamlet
#

hi there, can I stripe characters from variables like we do with bindings? trying this but it just prints the literal formula: "$custom_title": "($container_title - ('%.14s' * $container_title))", "$new_container_title": "$custom_title",

unreal ravine
manic dragon
unreal ravine
#

i mean, thats what I did..?

"animation_example":{
    "anim_type":"size",
    "from":[0, "100%"],
    "to":["100%","100%"],
    "duration": 1.1
}

this is something that I did but height didnt looked good tho

tranquil void
#

hi im having some issues with my custom ui

#

im trying to add a sprite with a clip ratio inside a chest screen

#

but it doesn't work

#

the part that concerns me is this one

#
{

        "hidden_slot": {
          "type": "collection_panel",
          "collection_name": "container_items",
          "controls": [
            {
              "bar@apm_generic.energy_bar_full": {
                "offset": [
                  12,
                  11
                ],
                "collection_index": 24,
                "bindings": [
                  {
                    "binding_name": "#hover_text",
                    "binding_type": "collection",
                    "binding_collection_name": "container_items"
                  },
                  {
                    "binding_type": "view",
                    // I mean we're just converting the name which is going to be a number from 1 to 100 to mark how full it is
                    "source_property_name": "((#hover_text * 1 ) / 100)",
                    "target_property_name": "#clip_ratio"
                  }
                ]
              }
            }
          ]
        }
      }
#

what im doing is set the name of an item to a number 1-100

jovial hemlock
#

anyone knows how to make the focus magnet work with console controllers?

#

its only selecting, north, south, west and east but not the corners

signal roost
#

How do i add item slots to the inventory? (If that doesnt work then how do i make a chest-like interface with only 4 slots appear when i use an item?)

tranquil void
#

hi i need help again

#

im trying to add a bar to the ui this is just for testing

#

im using clip_ratio to change the progress of the bar

#

and it's supposed to use that fake item render to do that

#

i tried naming the item 20 but the bar stays full

#

this is what i have

#

this is the part that im concerned about

#
"bar@apm_generic.energy_bar_full": {
                "collection_index": 24,
                "clip_ratio": "#clip_ratio",
                "bindings": [
                  {
                    "binding_name": "#hover_text",
                    "binding_type": "collection",
                    "binding_collection_name": "container_items"
                  },
                  {
                    "binding_type": "view",
                    "source_property_name": "((#hover_text - ('%.6s' * #hover_text) ) * 1 / 50)",
                    "target_property_name": "#clip_ratio"
                  }
                ]
              }
#

and also whenever the text becomes a number (without setting the number) the text dissapears

#
{
                    
                    "label": {
                      "type": "label",
                      "anchor_from": "top_left",
                      "anchor_to": "top_left",
                      "size": [
                        100,
                        16
                      ],
                      "text": "#text",
                      "bindings": [
                        {
                          "binding_name": "#hover_text",
                          "binding_type": "collection",
                          "binding_collection_name": "container_items"
                        },
                        {
                            "binding_type": "view",
                            "source_property_name": "(#hover_text - ('%.6s' * #hover_text) )",
                            "target_property_name": "#text"
                        }
                      ]
                    }
                  }
#

i have this inside the bar itself

#

if the text is a number it shows nothing

#

else it shows text

torpid remnant
#

may need clip_direction

tranquil void
#

yeah

#

now the issue is the game is crashing

#
"bindings": [
                  {
                    "binding_name": "#hover_text",
                    "binding_type": "collection",
                    "binding_collection_name": "container_items"
                  },
                  {
                    "binding_type": "view",
                    "source_property_name": "((#hover_text - ('%.6s' * #hover_text) ) * 1)",
                    "target_property_name": "#pre_value"
                  },
                  {
                    "binding_type": "view",
                    "source_property_name": "(#pre_value / $total_progress)",
                    "target_property_name": "#clip_ratio"
                  }
                ]
#

this causes the game to crash the moment an item goes into the slot

#

$total_progress = 50.0

#

lesson learnt

#

floats are dangerous

manic dragon
#

Division is dangerous
If you try division with a string it'll crash your game

#

So do multiplication instead

#

Instead of dividing by 50.0, multiply by 0.02

tranquil void
#

I have this as the bindings atm ```json
"bindings": [
{
"binding_name": "#hover_text",
"binding_type": "collection",
"binding_collection_name": "container_items"
},
{
"binding_type": "view",
"source_property_name": "((#hover_text - ('%.6s' * #hover_text) ) * 1)",
"target_property_name": "#pre"
},
{
"binding_type": "view",
"source_property_name": "(#pre * $fifty)",
"target_property_name": "#clip_ratio"
}
],

#

fifty set as 0.02

manic dragon
#

What's your hover text?

tranquil void
#

whatever the first 6 bytes are

#

then the item name

#

which is set to a number 1-100

#

setting the item name to 10

#

it's supposed to be 1/5th of the way there

manic dragon
#

There's a §o at the beginning
Remove that too

tranquil void
#

the label has a §z for the sake of making it render

#

if i leave it as a number it doesn't render

manic dragon
#

Why is it italic then?

tranquil void
#

because of the §z

manic dragon
#

§z has no affect on string

tranquil void
#

the progress bar that i apply #clip_ratio to has this as a binding

#

((#hover_text - ('%.6s' * #hover_text) ) * 1)",

#

which removes the first 6 bytes which are whatever gives style to the text

tranquil void
#

changed it to %.8s

#

same thing

manic dragon
#

What are the bindings for the text

torpid remnant
#

try removeing § from the hover text and see what it outputs as text

tranquil void
#

and #text to ('§z' + (#pre_value_2)

manic dragon
#

Try removing that * 1

tranquil void
#

removed the *1, set it to %.6s and removed the §z

#

wait typo

manic dragon
#

Didn't have to remove §z

tranquil void
#

yea even without the typo

#

no text renders

manic dragon
#

Does the first 6 characters represent progress?

tranquil void
#

the first 6 characters are whatever odd things the game does with text

#

so basically

manic dragon
#

Remove first 3 characters

tranquil void
#

if i put in an item with it's default name then it gives me the right text

#

and if i remove the first 6 characters it removes the first 3 for some reason

#

so if i add a dirt block it'll give me "t"

#

but if i rename the dirt block to "my dirt" it gives me "my dirt"

#

if i remove the %.6s then i get "my dirt"

#

anyways readding the §z i get the name of the item

manic dragon
#

Easy way to see what's in front is to remove § character
By - '§'

tranquil void
#

and like i said if i leave in an item w it's default name it removes the first 3 characters

#

so it says rry Planks instead of Cherry Planks

tranquil void
#

yea doing that just gives me back the z

torpid remnant
#

there may be something after the number

manic dragon
#

Set it to a higher layer value

tranquil void
#

so somehing odd happened

#

with integers it works fine

#

i tried multiplying by 0.01

#

and now i get zo and more text that i cant see

#

so indeed there's a clause thing

#

that's for this im too lazy to copy the code

manic dragon
#

Yeah those are from how you're renaming the item

tranquil void
#

odd

#

increasing it to %.10s doesn't do anything even if it's an integer

#

note what im trying to do is take an item named something like "100" and use that to get the clip ratio

manic dragon
#

Are you renaming using scripts? This shouldn't really happen. Minecraft adds §o in the beginning but nothing else iirc

tranquil void
#

im renaming in an anvil

#

but i'll use scripts later on

#

removing the *1 and leaving the text raw with %.10s gives me zrrr

#

odd stuff

#

im still experimenting

manic dragon
#

Remove first 12 bytes
That should give you the integer
Then multiply it in another binding and set it to #clip_ratio

tranquil void
#

changing $hundred to 1 gives me z10

#

im gonna try stuff and ill be back

#

yea for some reason floats just refuse to be strings

torpid remnant
#

(((#hover_text - '§' - 'r' - 'o' - 'f') * 1) / $max_value) should work

tranquil void
#

i figured it out

#

it was very messy

#

ty guys

#

in the end the solution was this

#
{
                    "binding_name": "#hover_text",
                    "binding_type": "collection",
                    "binding_collection_name": "container_items"
                  },
                  {
                    "binding_type": "view",
                    "source_property_name": "((#hover_text - ('%.6s' * #hover_text) ) )",
                    "target_property_name": "#pre_value"
                  },
                  {
                    "binding_type": "view",
                    "source_property_name": "(#pre_value * 1 * $hundred)",
                    "target_property_name": "#clip_ratio"
                  }
#

multiply by a decimal instead of divide

manic dragon
#

I just tested and Minecraft actually adds §o§f at the front and §r§r§r at the end

tranquil void
#

yeah that's what happens when you save an int as a string for some reason

#

really really odd stuff

manic dragon
#

§f (based on rarity) and §r§r§r is present for all item names but §o is added when renamed

tranquil void
#

at least now i can make progress bars without using five million progress items

balmy crow
#

Is It normal with the New ui whe need to wait 13 tick for opening e new one ?

limpid reef
#

Et ça dépend de ce que tu as dedans

mental bronze
#

what can i do about this error?

clever maple
candid shadow
#
"boss_health_panel": {
    "size":[182,"100%c"]
    "debug":"green",
    "type":"stack_panel",
    "orientation":"vertical",
    "modifications":[
      {
        "array_name":"controls",
        "operation":"replace",
        "control_name":"progress_bar_for_collections",
        "value":{"bossbar_wrapper@quartz_bossbar_template.bossbar_wrapper":{}}
      }
    ]
  }```

I just want boss_health_panel to have as its vertical size the sum of height of bossbar_wrapper and boss_name_panel. Since bossbar_wrapper is 10 pixels tall, and so is boss_name_panel, the size would have to be 20. However, I only want to show boss_name_panel in specific circumstances, so the height of bossbar_wrapper is 10. How can I do this? Setting "100%c" doesn't seem to work
#

Also, is it possible to make a button open a non-vanilla screen, like for example a custom settings menu?

mental bronze
mental bronze
clever maple
#

oh bruh you need to add a tick delay bc its a beforeEvent

#

system.run(() => {
//here the Form
})

mental bronze
#

alright thank you

amber elm
#

Heey, is it possible to update the layer index of an preserved title element(s)??

mint charm
#

The buttons look weird, but oh well.

sharp zinc
#

anyone know how i could set a binding to a variable value?

#

trying this but it doesn't want to work

#

i also tried source and target but that didn't work either

#

basically i'm just trying to use actionbar as a replacement for rendering things with title

manic dragon
#

You can use this #name in bindings

sharp zinc
#

Oh

#

tyyy

sharp zinc
#

like this

#

it's just showing nothing when i try to use it

manic dragon
#

You can't make it globally accessible

sharp zinc
#

Aww what

#

rip

manic dragon
#

You could use it with source control name. But you also can't access factory generated elements like this

sharp zinc
#

is there documentation on all kinds of math that can be done in bindings?

#

cause i'm not sure if < > <= >= can be done

#

oh i think <= and >= don't work

#

that's okey

gaunt apex
#

twst

rich abyss
#

is it possible to test for third person perspective?

jovial hemlock
#

anyone has an example of an scrollable label?

undone marsh
jovial hemlock
#

with xbox controller i cant select it

#

how do i fix that

slow matrix
#

Fake oreui

limpid reef
jovial hemlock
#

i dont want it to be just selection

#

it needs to be scrolleable

limpid reef
#

Maybe this will allow controllers to focus the text to scroll

jovial hemlock
#

i didnt know that was a thing

limpid reef
hexed briar
#

I don't know if this is well known yet, but it appears that resolve_ancestor_scope was completely removed. changed.

#

i don't know exactly which versions they were removed changed, but upon removing resolve_ancestor_scope in the code because, well it doesn't do anything but screams content log error that it doesn't exist, my stuff works fine.

manic dragon
#

Huh? Why???

hexed briar
#

honestly idk, but it works fine without it now.

manic dragon
#

Technically it was never necessary

#

But I used it in some of my projects

#

And now I have to change the code again

hexed briar
#

i was wondering what in the hell why resolve_ancestor_scope is screaming content log errors but didnt care to look into it back then and now i had to look around why

#

turned out removing it entirely just idk works?

#

it doesn't work anymore so i assume they removed it entirely.

manic dragon
#

It still works on the stable version that I can confirm. I didn't try it on preview

hexed briar
#

but yeah, this thing is gone now.

#

I don't have preview installed, so im not sure if it still works or not

manic dragon
#

resolve_ancestor_scope was a solid option for controls generated using factory. Because they have the same name. So targeting a control would always get the first one. Now the fix would be to chain multiple resolve_sibling_scope for the same behavior

hexed briar
#

ill need to see if that slbling scope works

manic dragon
#

I mean there's no reason to remove that because it's used in a lot of places in vanilla codes

hexed briar
#

Also for the record: Vanilla UI ignores their UI errors by default. so they won't show up in the log regardless if there's issue or not.

manic dragon
#

You sure you're doing everything correctly?
I don't get why they'd remove these

hexed briar
#

honestly yeah. it used to work before and doesn't throw any error until recently.

#

honestly it could also be my end but is this looks correct?

      { "binding_name": "#hud_title_text_string",
        "binding_name_override": "#preserved_text",
        "binding_condition": "visibility_changed",
        "resolve_ancestor_scope": true
      },```
manic dragon
#

I believe you can't use resolve_ancestor_scope without view binding

#

Or resolve_sibling_scope

hexed briar
#

yeah nope i can't get that to work.

#

but resolve_sibling_scope does work.

#

it probably looks like they just idk fixed something and now it splits an error perhaps, but ill take me awhile to confirm that since i literally don't use any preserved text things.

placid geode
hexed briar
#

i kinda aware but again, it doesn't throw any errors before so i assume that.

#

it just happened recently.

#

my UIs remains fine for now i think, doesn't throw any errors whatsoever. that was from me fixing up someone UI.

#

i suppose they were changed or something.

clever maple
#

How do I modify the default ActionForm?

#

I cant finde it in server_form.json

#

bc I only see Modalform

candid shadow
#

Is it possible to query the item in a slot? So for example do an operation like (item = 'minecraft:diamond_sword') or something similar? Maybe it's possible with #item_id_aux, but wouldn't an issue arise if the user uses addons that add items or blocks?

sharp zinc
#

is there a way to disable screen animations for certain elements?

sharp zinc
#

damn 😔

manic dragon
sharp zinc
#

i'm just having an issue with using actionbar to display some elements, and apparently values go wonky when they get animated, causing them to appear even if a binding i have says it shouldn't

manic dragon
#

Didn't really understand. A recording would help

sharp zinc
#

i can't :c
nda

manic dragon
#

I see. Can you explain it a bit more then?

sharp zinc
#

basically, i'm using actionbar like how others would normally use title to render conditional based elements

#

and when i open my inventory, something happens to where they appear during the animation time no matter what i do

#

This issue doesn't occur when screen animations are off

manic dragon
#

You can always render the HUD. That might help

sharp zinc
#

it also messes up values like if i'm passing in a texture

#

when i open inventory or another menu, during the animation the texture is broken

manic dragon
#

HUD elements pause rendering when another screen is opened. I think that's the issue for your case.

sharp zinc
#

it probably is that

candid shadow
vernal briar
#

is there a way to dynamically make a certain amount of elements in a panel. Say if a string or number is 4 the panel will contain 4 elements.

barren loom
#

how does everyone make theirs look cool ?

tidal vector
#

good luck bro

uneven epoch
oak verge
#

Depends on what is the form for
Vanilla forms only need .image() and some other small things
To be perfect

plush spruce
#

I saw this screenshot and was wondering if anyone could help me with my idea for it, its herobrines basically, i'd like to be able to change the background texture based on lets say a name so i could do new ChestForm("large", "textures/ui/forge_background.png") and the background would be the custom background, sort of like this.

#

its a java screenshot not mine

barren loom
barren loom
#
  • im tryna make a skill tree npc so like ykwim
limpid reef
limpid reef
#

Or custom placement with offsets

weak cape
#

second

#

one of my first ui's actally

barren loom
#

you guys are actually skilled

#

i watched a tutorial and my brain actually broke

limpid reef
manic dragon
#

You're not going to make a good UI just from watching a tutorial. You'll need to spend time on it

limpid reef
#

You need to learn the syntax / structure before creating from 0

manic dragon
limpid reef
#

The placement is with the script: when no text is provided the button isn’t visible

#
  width: 7,   // largeur de la grille
  height: 7, // hauteur de la grille

  buttons: [
    { pos: [3, 0], text: "locked:Skill [3,0]", icon: "textures/items/apple" },

    { pos: [2, 1], text: "Skill [2,1]", icon: "textures/items/iron_nugget" },
    { pos: [3, 1], text: "Skill [3,1]", icon: "textures/items/gold_sword" },
    { pos: [4, 1], text: "Skill [4,1]", icon: "textures/items/iron_ingot" },

    { pos: [1, 2], text: "Skill [1,2]", icon: "textures/items/gold_nugget" },
    { pos: [2, 2], text: "Skill [2,2]", icon: "textures/items/quartz" },
    { pos: [0, 2], text: "Skill [0,2]", icon: "textures/items/clay_ball" },

    { pos: [4, 2], text: "Skill [4,2]", icon: "textures/items/gold_ingot" },
    { pos: [5, 2], text: "Skill [5,2]", icon: "textures/items/diamond" },
    { pos: [6, 2], text: "Skill [6,2]", icon: "textures/items/emerald" },

    { pos: [0, 3], text: "Skill [0,3]", icon: "textures/items/slimeball" },
    { pos: [6, 3], text: "Skill [6,3]", icon: "textures/items/ender_pearl" },
  ]

};

// Construit une grille width x height remplie de null ou de boutons
function buildGridFromConfig(config) {
  const { width, height, buttons } = config;
  const grid = Array(width * height).fill(null);

  for (const btn of buttons) {
    const [x, y] = btn.pos;

    // Vérification de sécurité
    if (x < 0 || x >= width || y < 0 || y >= height) {
      console.warn(`Bouton ignoré : position invalide [${x}, ${y}]`);
      continue;
    }

    const index = y * width + x;
    grid[index] = btn;
  }

  return grid;
}

export function openSkillsForm(player) {
  const grid = buildGridFromConfig(skillsConfig);
  const form = new ActionFormData().title("custom_nephelia:skills_ui");

  for (const cell of grid) {
    if (!cell) {
      form.button("");
    } else {
      form.button(cell.text, cell.icon);
    }
  }```
#

I generated the logic with ai

#

I was lazy

manic dragon
#

I don't think it matters as long as it works properly

limpid reef
#

Yeah

weak cape
mint charm
#

render player face

#

jiji

buoyant niche
sage vessel
vernal briar
#

I need help with my addon. is there a way to dynamically make a certain amount of elements in a panel. So if the value 4 is passed the panel will contain 4 elements. Sort of like mojang sometimes does with factories and grids in their bedrock-samples that generate elements. Or is there a way to reuse factories or grids, for own uses?

low lance
#

Hi, I need to know how to add a custom interface with elements like health and, in my case, Omnitrix energy, and the alien selector.

low lance
tough imp
#

I built a program to see how the custom menus would look, it is better than trying many times in Minecraft

clever maple
tough imp
tough imp
clever maple
#

can you send it or maybe put it in a website?

tough imp
mint charm
rocky quail
mint charm
rocky quail
#

it's affected by invisibility

mint charm
rocky quail
#

oh wai nvm

#

that's nice

mint charm
#

The bad thing is that centering the head was a bit difficult, but it's done now, it looks good. I'd better not touch anything else or it will get damaged.

limpid reef
#

Test it with grimace egg

#

🤣

mint charm
#

I just noticed that the 4D skins are affected.

limpid reef
#

Oh

earnest tapir
hexed briar
#

idfk what's going on with the hud screen but are you people getting some auto save animation log error by any chance?

manic dragon
hexed briar
#

There's also no auto save animation in my code whatsoever in hud.

#

so it's obviously not my end that doing this

manic dragon
#

Maybe another pack
Or you might have named an element to something the auto save was using

hexed briar
#

It's only my UI pack and doesn't have anything that modifies them either.

#

I looked around the vanilla hud itself, and it turned out its their fault really.

#

they do not properly reference their anims element.

#

they do not even have namespace and I don't think it works like that, so i copied that auto save element, changed it so it properly does what it does and yeah fixed.

#

idk why it is happening in the first place unless it's the root element im using modification property for, in which. does not affect that auto save or with anims whatsoever.

manic dragon
hexed briar
#

I tried doing that years ago and all it does it just crashes my game.

#

when i put them in a namespace, suddenly they work.

#

Yes, anims are prone to crash the game if the element is incorrect back then.

manic dragon
#

Weird, although I always use namespace with my anims I never really faced any crash because of it

hexed briar
#

this thing made my head banging on the desk back then since you'll never know what crashes the game until you rewrite the whole thing piece by piece until you find out what's crashing.

#

though this one, it doesn't seem to crash but instead giving me a invaild anim element error log

manic dragon
#

I started JSON UI much later. When I first started I gave up within a month and didn't do anything Minecraft related for a long time

#

So I don't know how it used to be tbh

hexed briar
#

yeah so i still kinda have no idea how did they managed to break auto save anims

#

it's not even inside my code or whatsoever it just happens when i have a slight modified hud on it

#

i suppose I'll have to fix mojang codes too when working my ui smh lmao

candid shadow
#

Does the ignored propery in bindings accept bindings? So something like (the bindings that I used don't really make sense, but this is just an example):

{
  bindings:[
        {
          "ignored":"#is_left_tab_search",
          "binding_name": "(not #is_left_tab_inventory)",
          "binding_name_override": "#visible"
        }
    ]
}```
manic dragon
candid shadow
#

Got it, thanks

candid shadow
#

Probably I'm asking too many questions, but is there a way to do either of these things:

  • make a parent element inherit the sum of the sizes of the children elements
  • bind the vertical size of an element to the #text property of a label if that element doesn't have its size explicitly stated (like "fill" or "100%")
  • create a stack panel that starts from the bottom
#

Oh nevermind I solved it by taking a screenshot and measuring the pixels in aseprite

limpid reef
#

For the stack panel I think you could anchor bottom and make it 100%c

#

The order will be the same but yeah

night holly
#

Is there any guaranteed way to have a scrolling panel start from the bottom? Tried the jump to bottom on update, and the anchoring variables, which starts it from the bottom, but the game still thinks the scroll is at the top, and will move it back there on any input update

manic dragon
#

Oh wait you already mentioned that. Didn't see mb

mint charm
#

im bad

manic dragon
manic dragon
mint charm
#

a monster cornered me

manic dragon
#

it was mostly unplayable

mint charm
#

but it looks fine except in full screen

manic dragon
#

yeah the graphics api wasn't that good

mint charm
#

he he

night holly
#

my scrolling panel is basically just a massive image, with no other children or buttons, might be messing with the mapping tbf

manic dragon
#

ig generate it with a factory then

placid geode
night holly
#

yeah thats not a bad idea actually ill try that ty

mint charm
night holly
#

you cant rotate an element in json ui

#

unless you mean on the x or y axis but thats still just offsetting

mint charm
#

I mean, like this

#

but that one rotates like a cylinder?? I don't know if I understand myself, something I want to spin as if it were a roulette wheel.

night holly
#

its just clever use of size and offset to simulate the 3d-ness lol

#

gambling ui bad 😠

mint charm
night holly
#

well yeah simulating rotation like that is definetely do-able

mint charm
#

ahh, okay, thanks :3

night holly
#

best to try get animations working first with button click, never personally did that lol

ocean hatch
#

you got what now?

placid geode
#

what? 😰

red creek
#

Why are all the bars full in the menu?

night holly
#

if youre using a visual editor for json ui i dont think youre gonna get your issue resolved here

grand eagle
#

How do I remove the item description when holding it down? I only want to see the item name.

grand eagle
night holly
#

They questions very vague lol

jolly rock
#

Anyone know how to show the same ui to smartphone players'?

#

I got it

red creek
red creek
bronze sorrel
#

can we combine nine slice and aseprite animations?

manic dragon
bronze sorrel
#

i basically made the custom java item tooltip work on bedrock

#

but its animated on java so I'm trying to animate that

manic dragon
#

Looks good

#

But why is your highlight size bigger than the slot itself? Is it intended?

placid geode
#

stopwars tooltip

bronze sorrel
#

Well I couldn't get the animation working

#

but I think it's similar enough

hollow oxide
sour gorge
#

Hello, I need help with something simple (or at least I hope it is). What I want is to make the actionbar (the one you use with commands) appear in the same place where the scoreboard is shown.

weak cape
#

Check out if this works

sour gorge
weak cape
#

Happy to help!

glass valley
#

How do I change server form animations?

#

I want to modify the animation that appears when the server form is opened.

#

I found it

candid shadow
#

Is there a way to do something for size like fill * 0.5? I need to convert the recipe screen content to a stack panel while keeping the child elements centered

clever vapor
candid shadow
candid shadow
#

Nevermind I centered it in another way, without needing to turn it into a stack panel

lone glen
#

guys how do I change the corner radius of a tooltip?

#

nvm I have to change their texture

#

holy I'm dumb

fathom mica
#

Is it possible to display the image according to the image base size?

fathom mica
# manic dragon wdym?

I mean, an image1 whose size is dynamically adjusted to the size of the texture, for example texture A is 6x8 and texture B is 4x4, then image1 will automatically have the same size, I haven't found a way in the code but I thought about using the same frame size and different image sizes... well I hope there is an image with a dynamic size

manic dragon
#

Oh now I get it. But afaik there's no way to detect base size of textures. But you can set base_size and nineslice_size directly in json UI so try detecting the texture name and set the sizes accordingly. It will probably work if the image texture is a variable

#

Not sure if there's any bindings to set base size and nineslice size

fathom mica
fathom mica
manic dragon
fathom mica
#

well unfortunately, many things are limited:v

limpid reef
#

I had this problem too

candid shadow
#

Is it possible to manipulate #hover_text with operations?

#

So for example do (#hover_text - '§o') to remove the italics from the enchantment table

torpid remnant
#

yes can be done like this

{
  "background_with_hover_text/hover_text": {
    "bindings": [
      {
        "binding_name": "#hover_text",
        "binding_name_override": "#text_content",
        "binding_collection_name": "#enchant_buttons",
        "binding_type": "collection"
      },
      {
        "binding_type": "view",
        "source_property_name": "(#text_content - '§o')",
        "target_property_name": "#hover_text"
      }
    ]
  }
}
candid shadow
#

Though like I feel like I did something extremely similar to this and it didn't work.

cyan flint
#

how do I get the chat message to use in another ui element?

glass valley
# cyan flint how do I get the chat message to use in another ui element?
{
    "factory": {
        "type": "stack_panel",
        "size": [0, "100%c"],
        "layer": 20,
        "anchor_from": "top_right",
        "anchor_to": "top_right",
        "factory": {
            "name": "chat_item_factory",
            "control_ids": {"chat_item": "@hud.item"}
        }
    },
    "item": {
        "type": "panel",
        "controls": [
            {
                "background": {
                    "type": "image",
                    "anchor_from": "top_right",
                    "anchor_to": "top_right",
                    "controls": [
                      {
                       "text": {
                          "type": "label",
                          "text": "#text",
                          "localize": false,
                          "font_type": "MinecraftTen",
                          "font_size": "normal",
                          "font_scale_factor": 0.9,
                          "text_alignment": "center",
                          "color": [0.86, 0.86, 0.86],
                          "shadow": true,
                          "bindings": [
                            {
                              "binding_type": "view",
                              "source_control_name": "background",
                              "source_property_name": "#text",
                              "target_property_name": "#text"
                            }
                          ]
                        }
                      }
                    ]
                }
            }
        ]
    }
}
#

You can use factory.

cyan flint
#

tysm

glad sluice
#

Dose any one know how to fix the Chest UI with broke texturs

candid shadow
#

Is it possible to hide the first 9 slots in a grid? Perhaps with the grid position property?

manic dragon
candid shadow
manic dragon
#

For that, get the collection index and hide elements based on that

candid shadow
manic dragon
candid shadow
#

Now that I think about it, I think it would look better if I hide the hotbar instead

#

Thanks anyway

tall trellis
#

Hey guys,
Does anyone know if there is a way to make an certain ui show up when the game brightness level is set to a certain level?

balmy crow
#

Sup guy, I want to know if it is possible to use the technology of the structure block in a UI? like to see the structure in 3D

candid shadow
limpid reef
#

Live ?

#

Like I could do a camera thing

balmy crow
candid shadow
limpid reef
#

Okk

placid geode
limpid reef
#

wait its sick1

#

i could like do a preview thing for an outpost

#

the players could see whats happening there

#

water is a ll bit bugged

#

oh the area must be loaded

candid shadow
#

It works apparently then

manic dragon
limpid reef
#

Oh

cyan flint
#

How do I read a binding from a factory element in its parent?

placid geode
#

is there a way to detect if im using mouse or keyboard arrows to hover a button?

weak cape
#

Depends what you mean by "detect"

#

You can use the buttons "hover" state to see if its hovered.

placid geode
#

yeah ik, but i want to detect if im using keyboard arrows or mouse to hover it

#

like in ore ui, if you use keyboard arrows a white border appears in the hovered element

clever vapor
#

focused and hovered

#

thats the term but no clue though

placid geode
#

🥀

manic dragon
placid geode
#

hmmm ig ill use that, ty

weak cape
#

i still do not know what you want to achieve lol

manic dragon
#

Yk like in ore ui screens when you focus a button using keyboard keys, it has a white outline. This doesn't appear if hovered using mouse
Probably trying to achieve that

weak cape
#

Ohhhh

#

I never used keys/controller

#

yeah two buttons seem to be the only way to do that

torpid remnant
#

found something cool

 "test": {
   "type": "panel",
   "size": ["100%c", "100%c"],
   "layer": 99,
   "property_bag_for_children": {
     "#title_text": "custom test text"
   },
   "controls": [
     {
       "label_holder": {
         "type": "panel",
         "size": ["100%c", "100%c"],
         "controls": [
           {
             "label": {
               "type": "label",
               "text": "#text",
               "color": "cyan",
               "shadow": true,
               "size": ["default", 10],
               "bindings": [
                 {
                   "binding_type": "view",
                   "source_property_name": "#title_text",
                   "target_property_name": "#text"
                 }
               ]
             }
           }
         ]
       }
     }
   ]
 }
weak cape
#

what have you found

oak verge
#

something cool

placid geode
#

bro wtf

#

ig it applies that property to all children elements?

#

If so, then it's very useful, although I think it should work without bindings[] and using "text": "#title_text"

weak cape
#

what are yall on

placid geode
#

that "property_bag_for_children"

cyan flint
#

can someone help me? why this is not working?

"charge": {
                    "type": "image",
                    "texture": "textures/ui/ch_default_100",
                    "clip_direction": "left",
                    "clip_pixelperfect": "false",
                    "bindings": [
                        {
                            "binding_type": "view",
                            "source_property_name": "(#text - ('%.14s' * #text) * 0.01)",
                            "target_property_name": "#clip_ratio"
                        }
                    ]
                }

#text = "!addUich-java-{number 100 - 0}"

placid geode
#

You can't multiply by decimals directly

#

use a "$var": 0.01" and multiply by $var

cyan flint
#
{
                "charge": {
                    "type": "image",
                    "texture": "textures/ui/ch_default_100",
                    "clip_direction": "left",
                    "clip_pixelperfect": "false",
                    "$percent": 0.01,
                    "bindings": [
                        {
                            "binding_type": "view",
                            "source_property_name": "(#text - ('%.14s' * #text) * $percent)",
                            "target_property_name": "#clip_ratio"
                        }
                    ]
                }
            }
#

still not working

#

the image appears full, like as clip_ratio = 0.0

torpid remnant
weak cape
cyan flint
#

got it to work, ty

clever vapor
#

and it's in stable

shut cairn
#

Is it possible to query properties of a player in json ui?

narrow goblet
#

Guys is it possible to add a button tht u can use to cast a special ability or sum. Like when u press the button, u can use scripts to make smth happen accordingly

#

Pls @ me if anyone does know

hexed yacht
#

you could create a custom command, and a macro that triggers that command

#

and then from scripting interact with the ui

#

but each player would have to define that macro on their own

narrow goblet
#

Owhhh

#

Soo its not really a general thing yes?

#

I was planning to add a button tht lets a player cast an ultimate ability tht they chose

#

As well as skills

amber lance
#

Anybody know how to make custom cape pack?

dry fractal
#

Hey everyone, does anyone have any ideas for adding this tooltip icon to the lore? It looks pretty bad right now and I don't have any new ideas.

#

A tooltip set like this consists of several parts that are assembled together.

jovial hemlock
#

😭

placid geode
patent bramble
#

How much do Json UI commissions usually cost?

torpid remnant
#

3000 moneys

patent bramble
#

😔

patent bramble
#

A feature I now desperately can't live without

limpid reef
#

Is it like a global variable in the children scope

#

Instead of using the source control name?

placid geode
#

although you could simply use variables now that I think about it

limpid reef
#

Variables can be modified in a binding statement now?

placid geode
oak verge
earnest tapir
manic dragon
earnest tapir
#

I spent a week studying it from the beginning.

oak verge
manic dragon
#

in that case, the grid should have a higher height value 6*18

#

although I'm not seeing any scrolling panel

oak verge
#

wrong file sorry, i think i fixed it

#

moved the size to the scrollpanel instead

#

not 1:1 but it is something at least

manic dragon
#

remove the scroll or replace it with the one used in mobile
and remove scroll background

oak verge
#

by making a custom container_scroll_panel?

manic dragon
#

nope, there are variables that you can modify for common.scrolling_panel

#

you could set "$touch": true in the scrolling panel and the scrolling panel will work like in mobile

oak verge
#

@manic dragon why did this remove the scrollbar
content didn't fit

#

huh, it is not caused by allow_scrolling_even_when_content_fits

placid geode
#

touch thing

oak verge
#

let me try wider_scroll_area

#

nope

placid geode
#

try with this

#

"$touch": false,
"$scroll_bar_contained": true

manic dragon
# oak verge

Ig change the scrollbar directly instead of overriding touch variable
"$scroll_box_mouse_image_control|default": "common.scrollbar_box_image",
"$scroll_box_touch_image_control|default": "common.touch_scrollbar_box_image",

-# These variables took some time to find

placid geode
#

i would create the scroll view from scratch

oak verge
#

like this?

placid geode
#

scrolling_panel it's just so confusing

oak verge
#

i may do that

manic dragon
# oak verge like this?

Remove the touch variable and copy the control for touch image control in mouse image control

oak verge
placid geode
#

yeah

#

It literally means whether the bar is contained within the content panel or is separate

oak verge
#

yeah, it does overlap with the slots tho

placid geode
#

just offset it

#

wait

#

use $scroll_track_offset

oak verge
#

i don't think this is what you guys are referring to

candid shadow
#

what does the smithing table screen use for the screen content in pocket ui?

#

I tried with smithing_table_screen_2_pocket.json, but it doesn't seem to work

earnest tapir
oak verge
#

dynamic grid is not public yet

placid geode
#

what do you want to do?

oak verge
#

i am just trying to give the user the choice to add dynamic grid with a scrollable panel
i managed to do it tho
just not sure what to give the user in term of customizability
maybe the background and the scrollbar size

candid shadow
torpid remnant
oak verge
hexed briar
#

🤔

oak verge
candid shadow
torpid remnant
#

it is the entrypoint

"[email protected]_screen_common": {
  "$close_on_player_hurt|default": true,
  "close_on_player_hurt": "$close_on_player_hurt",
  "variables": [
    {
      "requires": "($pocket_screen and not $use_smithing_table_2_ui)",
      "$screen_content": "smithing_table_pocket.smithing_table_panel"
    },
    {
      "requires": "($pocket_screen and $use_smithing_table_2_ui)",
      "$screen_content": "smithing_table_2_pocket.smithing_table_panel",
      "$screen_bg_content": "common.screen_background",
      "$screen_background_alpha": 0.4
    }
  ]
}
zinc nebula
#

how do i fix my background disappearance when loading to a world and after leaving a world

ancient agate
#

Is there any better way to make ui than the preserve title text method

manic dragon
dry fractal
#

Where is this part located in the Bedrock sample UI file? I've tried searching through the HUD screen and found nothing related. I currently want to customize the tooltips of the items a bit, so I really need this information. Does anyone know?

manic dragon
dry fractal
oak verge
#

how do i change chest ui hollow bg

manic dragon
#

wdym

oak verge
#

this part

#

-# ignore that this is not ingame

manic dragon
#

Oh it's called dialog_background_opaque

#

You can change it through a variable $dialog_background

#

It's inside common_panel from ui_common

oak verge
#

thanks

earnest tapir
oak verge
candid shadow
#

If two elements have the same layer value and they're overlapping each other, how does the game decide which one does it have to render on top?

placid geode
#

it depends on how the elements are added in jsonui, ig

oak verge
#

there order or relationship or who called who

placid geode
#

[
{"element": {}},
{"renders_over_element": {}}
]

#

same with factories and grids

candid shadow
oak verge
candid shadow
candid shadow
cyan flint
#

is there any way to make conditional animations?

calm birch
#

Does anyone know where to start to create a health bar ui

#

One that doesnt use actionbar

#

Just hardcoded in

calm birch
jolly rock
#

You cant use properties in json ui

calm birch
#

i did it no worries

jolly rock
#

okok

calm birch
jolly rock
#

Can use #hud_title_text_string

#
{
  "root_panel": {
    "modifications": [
      {
        "array_name": "controls",
        "operation": "insert_back",
        "value": [
          {
            "[email protected]_bar": {}
          }
        ]
      }
    ]
  },
  "hp_bar": {
    "type": "panel",
    "controls": [
      {
        "hp": {
          "type": "image",
          "size": [
            200,
            10
          ],
          "anchor_from": "top_left",
          "anchor_to": "top_left",
          "offset": [
            10,
            10
          ],
          "bindings": [
            {
              "binding_name": "#hud_title_text_string"
            },
            {
              "binding_type": "view",
              "source_property_name": "('textures/ui/hp_bar/' + #hud_title_text_string)",
              "target_property_name": "#texture"
            }
          ]
        }
      }
    ]
  }
}
#

Maybe this work

#

You need to use /title @a title _30

#

Also

calm birch
#

ok the issue im finding rn with this

#

can i have multiply action bars

#

at once?

#

or do i have to end up combining it all?

jolly rock
calm birch
#

this black bar shows up now

#

which im guessing is the title bar

jolly rock
#

Try with /tilte @a times 0 0 0

#

Its the title background

#

@calm birch

calm birch
#

perfect

#

tysm

calm birch
#

Idk if there is a better way to do this without the use of titles? Something more hard coded?

torpid remnant
#

made nice hotbar thingy

patent bramble
#

How do y'all ever find what you need with menu screens?

#

I've been sitting here for half an hour trying to find a play button

clever vapor
#

so just search 'play_button' man

patent bramble
#

Well that's the problem right now, all references of play button don't seem to work

#

The only 1 with an actual size I've found either is menu_stack

#

And that isnt returning as a control

#

(I hate Json UI so much)

patent bramble
#

Start screen

clever vapor
patent bramble
#

I was going to make this as an entry point to leaning JsonUi

#

That's not here for me...

#

Oh so now it appears

#

It doesn't seem to have a listed size tho

clever vapor
patent bramble
#

Maybe im not built for this

#

Cause I gotta be visually impaired or something

clever vapor
patent bramble
#

The part after the @

#

start.main_button

#

It's referenced so many times but never defined

clever vapor
patent bramble
#

Im just gonna go back to scripting

#

Cause I'm clearly blind

#

This is all I found

#

Why does moving an element require me to backtrack through 70 different definitions

#

So we need like
start_button@main_button@ui_screen_stuff@hahayoustilllooking@justgiveup@getalife

#

I hope when ore UI releases properly there will be less of this Bs

patent bramble
#

I don't think this will help me

#

I've been trying to learn this for 6 years atp

#

Im hopeless

candid shadow
#

Bark each time I said control (maybe don't)

oak verge
#

can json ui perform actions depending on slot content
for example if a slot have spesific item drop it

clever vapor
oak verge
clever vapor
oak verge
#

alright, thanks
i asume same thing for moving the item around

clever vapor
#

Yep

oak verge
#

alright

#

thanks again

calm birch
#

How do i get rid of the title background?

#

I used preserved text

#

But kinda new to it

manic dragon
# calm birch But kinda new to it

If you're using scripts to send title set animation times to 0 like this

player.onScreenDisplay.setTitle(
  "message",
  {
    stayDuration: 0,
    fadeInDuration: 0,
    fadeOutDuration: 0
  }
);
#

Or send /title @a times 0 0 0
If you're not using scripts

calm birch
#

Im using scripts

#

But a commandblock down for that command to test

#

But it didnt do anything

#

But im using scripts

#

So prob will try

#

Thanks

oak verge
#
"dynamic_label": {
    "type": "label",
    "size": ["100%", "default"],
    "offset": [2, 2],
    "color": "$body_text_color",
    "text": "#form_button_text",
    "bindings": [
        {
            "binding_name": "#form_button_text",
            "binding_type": "collection",
            "binding_collection_name": "form_buttons"
        },
        {
            "binding_type": "collection_details",
            "binding_collection_name": "form_buttons"
        },
        {
            "binding_type": "view",
            "source_property_name": "#collection_index",
            "target_property_name": "#visible",
            "binding_condition": "not ((#collection_index = 0) or (#collection_index = 1))"
        }
    ]
}
[UI][error]-On Control Path: ...dynamic_label | JSON UI parse failure: Must define a source property name in the binding!

whats wrong here

candid shadow
# oak verge ```json "dynamic_label": { "type": "label", "size": ["100%", "default"],...

I think that what you wrote for "binding_condition" must be written in "source_property_name", so the corrected code is this:

"dynamic_label": {
    "type": "label",
    "size": ["100%", "default"],
    "offset": [2, 2],
    "color": "$body_text_color",
    "text": "#form_button_text",
    "bindings": [
        {
            "binding_name": "#form_button_text",
            "binding_type": "collection",
            "binding_collection_name": "form_buttons"
        },
        {
            "binding_type": "collection_details",
            "binding_collection_name": "form_buttons"
        },
        {
            "binding_type": "view",
            "source_property_name": "(not ((#collection_index = 0) or (#collection_index = 1)))",
            "target_property_name": "#visible"
        }
    ]
}

"binding_condition" is used to limit the the moments in which the binding happens, generally to improve performance. It can have these values (idk what they all do):
always
always_when_visible
visible
once
none
visibility_changed

#

So you can delete "binding_condition" or choose one of these enum values

#

and also every operation must be completely sorrounded by a pair of brackets ()

oak verge
#

that worked, thanks

wooden sluice
#

thoughts on this ui?

warm hedge
#

I'm new to the json ui.
I would like to know if there is any way to link the ui not to the title/actionbar, but to the scoreboard?

cyan flint
#

What is the most optimized way, with least conflict with other add-ons, to display UI elements?

candid shadow
cyan flint
#

Has anyone tried using chat messages?

candid shadow
#

you mean customising the chat messages? probably someone has tried

cyan flint
#

So, I made a system that reads chat messages and displays an element based on them, but it has some bugs and limitations.

#

I couldn't make a persistant message system, and it deletes older messages due to the chat message limit.

#

But I have no idea how to solve this.

#

But solving those two problems would be perfect.

#

If there's a way to conditionally delete elements and change bindings from the parent element in factory elements, I believe it would be possible to solve these two problems.

sharp zinc
oak verge
#

how do you target a specific slot?

oak verge
#

nothing beat searching here and stumbling across two well know members arguing

placid geode
torpid remnant
#

if its only 1 button for 1 slot adding this may work

"property_bag": {
  "#collection_index": 5,
  "#collection_name": "container_items"
}
manic dragon
manic dragon
torpid remnant
#

yes it works atleast for property bag so maybe it can also work if you use bindings to set it

manic dragon
#

Oh good to know
I didn't try with property bag before but I remember trying with bindings but didn't work

torpid remnant
manic dragon
#

Oh cool

limpid reef
#

do someone have a code snippet for a grid?

#

like a grid that uses controls array

#

and grid positions

#

i cant seem to make it work

#

thanks

#

could i see the full grid code please?

oak verge
limpid reef
#

my grid crashes my game 🙁

#

ok

#

i did it

hoary skiff
#

May I see how you code grid

limpid reef
#
          "type": "grid",
          "layer": 200,
          "size": ["100%", "100%"],
          "grid_dimensions": [3, 2],
          "controls": [
            {
              "1@boutique_keys.grid_offer": {
                "grid_position": [0, 0],
                "$offer_texture_preview|default": "textures/paladium_kitmap_ui/boutique/keys/",
                "$buy_button_index|default": 4,
                "$offer_name|default": "",
                "$offer_description|default": ""
              }
            },
            {
              "2@boutique_keys.grid_offer": {
                "grid_position": [1, 0],
                "$offer_texture_preview|default": "textures/paladium_kitmap_ui/boutique/keys/",
                "$buy_button_index|default": 5,
                "$offer_name|default": "",
                "$offer_description|default": ""
              }
            },
            {
              "3@boutique_keys.grid_offer": {
                "grid_position": [2, 0],
                "$offer_texture_preview|default": "textures/paladium_kitmap_ui/boutique/keys/",
                "$buy_button_index|default": 6,
                "$offer_name|default": "",
                "$offer_description|default": ""
              }
            },
            {
              "4@boutique_keys.grid_offer": {
                "grid_position": [0, 1],
                "$offer_texture_preview|default": "textures/paladium_kitmap_ui/boutique/keys/",
                "$buy_button_index|default": 7,
                "$offer_name|default": "",
                "$offer_description|default": ""
              }
            }
          ]
        }```
#

oh i forgot to remove |defualt

hoary skiff
#

If yes, you don't have to manually add each item:

{
  "grid": {
    "type": "grid",
    "layer": 200,
    "size": ["100%", "100%"],
    "grid_dimensions": [3, 2],
    "grid_item_template": "boutique_keys.grid_offer",
    "collection_name": "form_buttons",
    "bindings": [
      {
        "binding_name": "#form_button_length",
        "binding_name_override": "#collection_length"
      }
    ]
  },

  "grind_offer": {
    //your other props
    "$offer_texture_preview|default": "textures/paladium_kitmap_ui/boutique/keys/"
  }
}

limpid reef
limpid reef
hexed briar
#
  • a way to set the default unknown value.
#

though they work alot differently than regular variables, this one can only be bounded on the exact element it was created for.

#

property_bag_for_children is the same thing as property_bag except that it passes the default binding variable to child elements.

#

The only thing that is useful on these two, is just debugging purposes or override existing bindings, since you can already do that with regular variables.

#

could also be useful if you don't wanna make extremely long string of condition bindings.

austere flicker
#

what texture path is this guys

oak verge
#

it is not possible to change it using a resource pack

oak verge
#

currently in #1350130244111040593 each adding slots is straight forward, each slot uses a collection index, adding a dynamic grid complicate things a bit, my question is, can we make the dynamic grid start at a specific index

leaden kayak
#

Is there binding that prevents console player to move their dpad to hover the button which i am just using for displaying data? I only want them to hover on clickable buttons

austere flicker
#

where do i find the texture path of this

manic dragon
warm hedge
#

I'm learning how to make ui. What are ALL the ways to connect interfaces to the server? (For example, clicking on a block)

austere flicker
leaden kayak
manic dragon
austere flicker
#

nvm found it thanks for the help

warm hedge
oak verge
#

Are these all the possible mapping for buttons in inventory screen?
button.container_take_all_place_all
button.container_take_half_place_one
button.container_auto_place
button.drop_one
button.drop_all

clever vapor
manic dragon
burnt osprey
#

Is custom sound in Json ui possible?

manic dragon
#

yep

#

usually played through button clicks

burnt osprey
#

figured it out, thank you.

oak verge
#

nvm, it merges stacks

warm hedge
#

guys, what are some ways to connect the UI to the server? (For example, interaction with the block)

oak verge
#

server forms

#

what is the item cell textures?
i can only find cell_image_normal and cell_image_slected
there is a green one for hovered but i can't find it

candid shadow
oak verge
#

highlight_slot

candid shadow
candid shadow
oak verge
mighty ether
#

Hey I've used this trick to convert a string to a number via bindings before, but it seems to have been patched (I'm on 1.26.30). Is there a known workaround currently?

        {
            "binding_type": "view",
            "source_property_name": "(#player_score_sidebar * 1)",   // convert score from string to number
            "target_property_name": "#score"
        },
#

oh 0 + #str worked. Found an earlier discussion
#1067870274894172260 message

mighty ether
#

Is it not possible to access the #hud_title_text_string binding from screens other than the HUD?

tepid ember
#

Does this variable exist? anchored_offset_value_x_absolute

limpid reef
#

I think yeah

tepid ember
limpid reef
#

idk then

quartz axle
#

is it possible to make "skill tree/ability tree" using json ui & server form?

warm hedge
#

I can control the UI by sending it a signal using the action bar, right? And can I do the reverse? If I, for example, press a button on the UI, can I send a signal to the server?

jolly rock
#

This is the closest thing
#1377629363889115267 message

hardy lily
#

is anyone here know how to make a copy button with #form_button_text as the value?

placid geode
hardy lily
#

I see

hardy lily
#

should be possible?

jolly rock
#

Form buttons only returns the index

#

Imean ActionForm

jolly rock
hardy lily
#

like spectatig player, and there's so many duplicated words like I and l that I often mistook

warm hedge
manic dragon
hardy lily
manic dragon
#

Just make sure the property_bag of your text box has "#property_field": "#item_name"
Then set #form_button_text or whatever binding you have to #item_name

hardy lily
#

ah, ok

warm hedge
#

what is the custom form? What is it, and how to trigger it?

clever vapor
warm hedge
#

right?

warm hedge
#

thank u

oak verge
#

how would i use #hover_text (if that is the right var) to display a paperdoll from setting the item name to the entity id

clever vapor
sage vessel
#

Can this code limit the display to 4 buttons, so that the 5th button is not displayed?

manic dragon
manic dragon
sage vessel
manic dragon
#

#form_button_length can be buggy when you have multiple forms
It gives you the correct value first, then it can change, so adding binding condition once forces it to not change

oak verge
jolly rock
torpid remnant
#

...

oak verge
#

welp

hardy lily
#

I have a question and I haven't tested it yet.

what if I create an empty panel in first pack, and then the same panel with values and data in the second pack. will it works?
my Idea is making an addon type UI that works with the server resource pack

jolly rock
#

I understood that it was, but I honestly don't remember anymore

oak verge
#

can't you use modifications and insert into the server ui

manic dragon
hardy lily
#

I see

#

I think I have the idea how to solve this

#

but I'm not sure if this will work

#

if I remember correctly, I can call another elemen using variable like panel@common.$panel_type

manic dragon
#

panel@$panel_type
This'll work

hardy lily
#

yep, that was I meant

#

oh yeah, will this reduce the lag?

#

since it wasn't pre rendered behind visible thing

manic dragon
#

Idk how you plan on doing it without visible binding
You can't assign binding value to a variable

hardy lily
#

oh 😔

jolly rock
manic dragon
#

You can set "$var": "#bind"
The variable won't have the value of the binding. Meaning if the #bind = 4, $var will still contain "#bind", like a text

jolly rock
#

Perhaps he can use variables, right?

Like: { "requires": "($var = 'ex')", "$panel_type": "@server_form.custom_panel" }

#

And "$var": "#title_text"//or #form_text

glass valley
#

Subtitles have been added to Minecraft. Is this a JSON UI? If so, where are they located?

oak verge
#

yes it is json ui, check the hud file

manic dragon
glass valley
#

subtitle_direction_label?

#

I found it! Thank you.

oak verge
#

caption_frame

glass valley
#

How do you combine factory and factory?

#

I want to combine subtitle factory and chat factory.

#

It ends up like this

hollow needle
#

Does anybody know why this doesn't work?

"bindings": [
      {
        "binding_type": "collection",
        "binding_collection_name": "form_buttons",
        "binding_name": "#form_button_texture",
        "binding_name_override": "#category"
      },
      {
        "binding_type": "view",
        "source_control_name": "#category",
        "source_property_name": "#toggle_state",
        "target_property_name": "#visible"
      }
    ]
#

It won't get the toggle_state dynamically

#

But if I type the toggle name manually, it works fine

hoary skiff
#

How do yall send a message just by a click of button

#

for example I have two buttons, one sends "hi" and the other sends "hello"

#

Just need example snippet

manic dragon
hollow needle
#

And that's exactly the toggle name

manic dragon
#

You can't use bindings inside source_control_name

hollow needle
#

It's just that I have categories, and sections inside each category

#

Each section has it's own content

#

It would be a lot to cover using just Json UI

oak verge
#

Is the totem animation a ui element

jolly rock
#

I don't think so

placid geode
hoary skiff
#

I'm guessing its part of player animation

hexed briar
cunning sierra
#

How do I recreate this? Could you help me?

jolly rock
#

I'm not sure if the selected item can be displayed like it, But I think you can do everything else

gaunt apex
weak cape
hollow needle
cunning sierra
manic dragon
patent bramble
#

Can someone please explain how the modifications array works?

candid shadow
# patent bramble Can someone please explain how the modifications array works?

You use "modifications" to move, remove, replace or insert controls, bindings or button inputs.

For example, here's how you add a binding to arrow_icon:

  "arrow_icon":{
    "texture": "textures/ui/anvil/arrow_anvil",
    "size": [10,9],
    "offset": [-5,0],
    "modifications":[
      {
        "array_name":"bindings",
        "operation":"insert_front",
        "value":{
          "binding_name":"(not #cross_out_icon)",
          "binding_name_override":"#visible"
        }
      }
    ]
  },```
patent bramble
candid shadow
#

If instead with move you mean phyisically move in the screen you can use anchors and offsets

patent bramble
#

I was starting to learn Json UI by modifying the start screen, I wanted to move the play button just to see visual feedback that I'm doing things right

candid shadow
#

however, for example with modifications you can make it so that the play button is the last button (after the marketplace button)

patent bramble
#

I guess I have to find the element that the play button is a part of?

wooden sluice
#

does anyone know how to make a search bar? or is there a vanilla file where i can find it?

#

i would look in the search for friends but its all ore ui now

wooden sluice
weak cape
wooden sluice
torpid remnant
#

this stack splitting overlay is driving me crazy

clever vapor
torpid remnant
#

yes

patent bramble
#

Can I detect whether someone has effects in resource pack Json UI?

#

I wanted to see if I can create an invis skin exposer

#

But don't want to affect normal invis pots

patent bramble
#

How does the mob effects render work then?

#

Also I am struggling so much with just adjusting the start screen so maybe I shouldn't be thinking about effect detection yet

#

I thought this would be the 1

#

I guess not

manic dragon
patent bramble
#

I'm trying to find what this stack is

#

And how to change its position

#

since I know I wont be able to move them individually

manic dragon
# patent bramble I'm trying to find what this stack is

Here's a tip, start from the entry point of the file. Look for a variable named $screen_content. Look what value it has and go to the code of that control. You'll see what that screen has. Then you just go down the control tree to find the thing you want. Most of the time the names will tell what it has or does

#

As for those buttons they are in main_buttons_panel
Which is inside another main_buttons_stack_panel. This has both the title and buttons as its controls

patent bramble
#

I heard from someone else that stack panels aren't anchorable or something

manic dragon
patent bramble
#

So would I copy the entire stack panel here? and just mess with values?

#

Or do I grab main buttons panel instead?

#

I just wanna see change

#

So I know I have the right thing

#

There's a lot about new player flow

manic dragon
patent bramble