#JSON-UI General
1 messages · Page 54 of 1
What were you trying to do with this?
It’s for a extra hot bar for moves it also has selection thing
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"
}
]
}
Okay
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"
}
]
}
okay but the technique bar isnt in hudscreen its in a diffent file
you added these stuff in the hud_screen, right?
that would be enough
should be enough
okay \
what about the binding name cuz will i need to make a new bindings for every slot so in the technique panel or what
wdym
{
"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
no but the bindings aren't right here
remove the binding_name, that won't be necessary
and try to follow the pattern here
you just need to provide the correct name in the source_control_name
maybe through variables
so i should make it like "$slot": "('technique_slot_' - $technique_slot - ':' )", this
yes
okay do you want me to send the update thing for you can look at it
sure
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"
}
sorry one sec
so do i just copy the ones i already made and put them in mods?>
just a sec
okay
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"
}
]
}
}
okay let me try it
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"
}
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
if you get any errors
paste them here
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
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
set all the animation times to 0 when sending the title
my mistake I named the last data_control data_control0, it should be data_control8
how do i do that i just learn about the setdisplay thing
like this
player.onScreenDisplay.setTitle(
"message",
{
stayDuration: 0,
fadeInDuration: 0,
fadeOutDuration: 0
}
);
okay dynamic properties this is the last thing can i also find out what is in a slot to
and how do i do them
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
});
}
it's possible ig, you should read the documentation for more info
i will thank you and i can rtead about dynanic properties
alr i got it to work i just need to find out how to make it do it right as the client is done loading
"text": "#gamertag_label",
"bindings": [
{
"binding_name": "#gamertag_label"
}
]
prueba con esto
That won't work because it will display its own name in all the spaces
It's the scoreboard list i think
ahh I already saw what he really wants haha
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"
}
]
}
Tks
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
hi
pinkguy
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
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"
}
]
}
}```
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?
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
@manic dragon, help me plis ;c
add it as a background using "$screen_bg_content"
Thanks bro
Yo guys, Quick question.
theres an alternative way to make this without looping in flip-book???
im gonna try this
wish me luck
depends
how?
You can do with a size anim
A white image with increasing size and decrease anim afterwards
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",
I did that , but Is not the best, becuz Height increases with Width
why's that?
use fixed height in animation. only the width will increase
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
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
anyone knows how to make the focus magnet work with console controllers?
its only selecting, north, south, west and east but not the corners
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?)
keep_ratio: false
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
may need clip_direction
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
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
i tried that and it just straight up did nothing
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
What's your hover text?
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
There's a §o at the beginning
Remove that too
the label has a §z for the sake of making it render
if i leave it as a number it doesn't render
Why is it italic then?
because of the §z
§z has no affect on string
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
What are the bindings for the text
try removeing § from the hover text and see what it outputs as text
#pre_value_2 set to ((#hover_text - ('%.8s' * #hover_text) ) * 1)
and #text to ('§z' + (#pre_value_2)
Try removing that * 1
Didn't have to remove §z
Does the first 6 characters represent progress?
the first 6 characters are whatever odd things the game does with text
so basically
Remove first 3 characters
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
Easy way to see what's in front is to remove § character
By - '§'
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
huh
yea doing that just gives me back the z
there may be something after the number
Set it to a higher layer value
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
Yeah those are from how you're renaming the item
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
Are you renaming using scripts? This shouldn't really happen. Minecraft adds §o in the beginning but nothing else iirc
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
Remove first 12 bytes
That should give you the integer
Then multiply it in another binding and set it to #clip_ratio
so uhh
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
(((#hover_text - '§' - 'r' - 'o' - 'f') * 1) / $max_value) should work
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
I just tested and Minecraft actually adds §o§f at the front and §r§r§r at the end
yeah that's what happens when you save an int as a string for some reason
really really odd stuff
§f (based on rarity) and §r§r§r is present for all item names but §o is added when renamed
at least now i can make progress bars without using five million progress items
Is It normal with the New ui whe need to wait 13 tick for opening e new one ?
I think you should ask here: #1468350392826990624
Et ça dépend de ce que tu as dedans
what can i do about this error?
wrong channel but what is line 14?
"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?
line 14 is the form.show, also wym by "wrong channel"?
what event are you using?
alr
oh bruh you need to add a tick delay bc its a beforeEvent
system.run(() => {
//here the Form
})
alright thank you
Heey, is it possible to update the layer index of an preserved title element(s)??
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
So you want to store variable value to a binding?
If yes, you can use property bag for that
"property_bag": {
"#name": "$var"
}
You can use this #name in bindings
this doesn't seem to be registering for other elements trying to use the binding
like this
it's just showing nothing when i try to use it
You can't make it globally accessible
You could use it with source control name. But you also can't access factory generated elements like this
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
twst
is it possible to test for third person perspective?
anyone has an example of an scrollable label?
nope, not with json ui
Try to put your ability content in a custom button that does nothing and just have the white border visible
i thought the same but will xbox players be able to scroll that?
i dont want it to be just selection
it needs to be scrolleable
ill try that first
Yaeh put the custom button in the child control of the scrolling panel
Maybe this will allow controllers to focus the text to scroll
didnt worked
i found the solution, actually it was more simple
i didnt know that was a thing
Ohhh
Me too
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.
Huh? Why???
honestly idk, but it works fine without it now.
Technically it was never necessary
But I used it in some of my projects
And now I have to change the code again
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.
It still works on the stable version that I can confirm. I didn't try it on preview
but yeah, this thing is gone now.
I don't have preview installed, so im not sure if it still works or not
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
ill need to see if that slbling scope works
I mean there's no reason to remove that because it's used in a lot of places in vanilla codes
Oh.
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.
You sure you're doing everything correctly?
I don't get why they'd remove these
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
},```
I believe you can't use resolve_ancestor_scope without view binding
Or resolve_sibling_scope
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.
afaik it works only with view type
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.
How do I modify the default ActionForm?
I cant finde it in server_form.json
bc I only see Modalform
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?
is there a way to disable screen animations for certain elements?
damn 😔
You can either check #hover_text or #item_id_aux
both have their cons. For aux id you already got the issue. For hover text different languages will be the issue as it doesn't use translation keys
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
Didn't really understand. A recording would help
i can't :c
nda
I see. Can you explain it a bit more then?
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
You can always render the HUD. That might help
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
HUD elements pause rendering when another screen is opened. I think that's the issue for your case.
it probably is that
Thank you again for the piece of info
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.
how does everyone make theirs look cool ?
good luck bro
I personally prefer the vanilla action form UI as opposed to custom UIs and i think this looks perfectly fine how it is
Depends on what is the form for
Vanilla forms only need .image() and some other small things
To be perfect
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
bro what 😭
i like the way this looks but im tryna make a RPG styled game nd I just feel a cooler looking UI would be better
- im tryna make a skill tree npc so like ykwim
I once did this
yeah naw fuck json ui
you guys are actually skilled
i watched a tutorial and my brain actually broke
I mean it’s like a new language
You're not going to make a good UI just from watching a tutorial. You'll need to spend time on it
You need to learn the syntax / structure before creating from 0
It's a nice one. Did you use a grid? The spacing is uniform
Yes that’s a grid
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
I don't think it matters as long as it works properly
Yeah
you will master it with constant practice
uff hermano
Why does the animation behave like this when it’s placed inside the button?
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?
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.
I have all the necessary textures done.
I built a program to see how the custom menus would look, it is better than trying many times in Minecraft
I have it as a file
can you send it or maybe put it in a website?
I plan to put it on a website, but I still need to add some functions and test what codes it works with, because I have only tested it with already created codes.
Wow, that's impressive
Paperdoll renderer?
it's affected by invisibility
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.
Oh
idfk what's going on with the hud screen but are you people getting some auto save animation log error by any chance?
Nope no errors (I'm on stable)
I'm at the latest stable too, still getting this dogwater error log.
There's also no auto save animation in my code whatsoever in hud.
so it's obviously not my end that doing this
Maybe another pack
Or you might have named an element to something the auto save was using
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.
It does work. If you don't specify a namespace, it'll use the current namespace
typically it does work if you're using it for elements not the anims property if i recall.
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.
Weird, although I always use namespace with my anims I never really faced any crash because of it
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
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
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
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"
}
]
}```
Nope ignored property doesn't accept bindings no matter where you use them
Got it, thanks
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
For the stack panel I think you could anchor bottom and make it 100%c
The order will be the same but yeah
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
Try changing $scrolling_content_anchor_from/to variables
By default, they are set to top_left
Oh wait you already mentioned that. Didn't see mb
im bad
I think you should look at the code for chat screen scrolling panel
even I couldn't pass level 1
it was mostly unplayable
but it looks fine except in full screen
yeah the graphics api wasn't that good
he he
yeah i tried honestly, but seems like the fact the child is a factory might have something to do with it? already spent like 3 hours think ill cut my losses on this one 😭
my scrolling panel is basically just a massive image, with no other children or buttons, might be messing with the mapping tbf
ig generate it with a factory then
maybe adding some animation that changes the content size so the scroll panel detects it?
yeah thats not a bad idea actually ill try that ty
One question, can you animate a form so that it always rotates and when you click on one of the buttons it stops?
you cant rotate an element in json ui
unless you mean on the x or y axis but thats still just offsetting
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.
its just clever use of size and offset to simulate the 3d-ness lol
gambling ui bad 😠
ahh, so yes it could, right?
well yeah simulating rotation like that is definetely do-able
ahh, okay, thanks :3
best to try get animations working first with button click, never personally did that lol
you got what now?
what? 😰
Why are all the bars full in the menu?
if youre using a visual editor for json ui i dont think youre gonna get your issue resolved here
What do you mean? No wnte
How do I remove the item description when holding it down? I only want to see the item name.
/gamerule showtags false
Ty
Oh is that on the right a form then the left is hud?
They questions very vague lol
Yes, that's right
Sorry
can we combine nine slice and aseprite animations?
I haven't tried this personally but try adding the nineslice property in the image (in JSON UI) where you applied the aseprite animation
thanks i'll test it out
i basically made the custom java item tooltip work on bedrock
but its animated on java so I'm trying to animate that
Looks good
But why is your highlight size bigger than the slot itself? Is it intended?
stopwars tooltip
nah not intended but i was just messing around with json ui, will get it fixed later trying to get the animation done first
Well I couldn't get the animation working
but I think it's similar enough
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.
Check out if this works
Happy to help!
How do I change server form animations?
I want to modify the animation that appears when the server form is opened.
I found it
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
"filled_panel": {
...
"size": ["fill", "fill"],
"controls": [
{
"your_element": {
...
"size": ["50%", "50%"]
}
}
]
}
should I make filled_panel not visible and your_element not visible?
Nevermind I centered it in another way, without needing to turn it into a stack panel
guys how do I change the corner radius of a tooltip?
nvm I have to change their texture
holy I'm dumb
Is it possible to display the image according to the image base size?
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
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
Actually you can use absolute size, but yeah it might be a bit heavy if there are a lot, so I think I'll use the same frame
yeah, but nineslice will actually widen the image🗿
I actually wanted something similar too but didn't find any way because we can't detect the texture's original sizes
well unfortunately, many things are limited:v
I had this problem too
Is it possible to manipulate #hover_text with operations?
So for example do (#hover_text - '§o') to remove the italics from the enchantment table
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"
}
]
}
}
thank you so much
Though like I feel like I did something extremely similar to this and it didn't work.
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.
tysm
Dose any one know how to fix the Chest UI with broke texturs
Is it possible to hide the first 9 slots in a grid? Perhaps with the grid position property?
It is possible to "hide" the elements but they will still take up space. Grid position won't help with this unless you add the elements manually
The fact that it still takes up space doesn't matter, as I need to show the hotbar and hide the first 9 slots of the grid, or else those items will render both in the hotbar and in the first 9 slots of the grid
For that, get the collection index and hide elements based on that
is there a binding for collection index, or should I do it with variables?
{
"binding_type": "collection_details",
"binding_collection_name": "<collection_name_used_on_grid>"
}
Add this in your bindings array and you can use #collection_index
Now that I think about it, I think it would look better if I hide the hotbar instead
Thanks anyway
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?
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
set the element type to custom and use 3d_structure_renderer as the renderer. Include in the property bags:
#block_position [x,y,z]
#top_right_block (array) [x,y,z]
#bottom_left_block (array) [x,y,z]
#include_entities (boolean)
#remove_blocks (boolean)
#include_players (boolean)
Thy
This really works ??
Live ?
Like I could do a camera thing
i try in 2 H
don't know, I haven't tried myself 🫠
I'm basing my info on the docs https://wiki.bedrock.dev/json-ui/json-ui-documentation
Okk
yes but in a very límited way as we can't manipulate arrays in json ui
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
It works apparently then
yeah, and trying to load larger areas will freeze the game for sometime
Oh
How do I read a binding from a factory element in its parent?
is there a way to detect if im using mouse or keyboard arrows to hover a button?
Depends what you mean by "detect"
You can use the buttons "hover" state to see if its hovered.
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
🥀
Don't think you can. However, you can use an alternative ig
e.g- have two buttons on top of another. Top one with focus disabled so it can't be focused using keyboard and that consumes hover events. The other with focus enabled which will only be used for keyboard focus. It should be below the first button
hmmm ig ill use that, ty
i still do not know what you want to achieve lol
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
Ohhhh
I never used keys/controller
yeah two buttons seem to be the only way to do that
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"
}
]
}
}
]
}
}
]
}
what have you found
something cool
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"
what are yall on
that "property_bag_for_children"
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}"
{
"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
seems so
Ohhh. Now that's it cool
got it to work, ty
and it's in stable
That is cool!
Is it possible to query properties of a player in json ui?
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
well
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
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
Anybody know how to make custom cape pack?
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.
🍆 🍆 🍆 🍆 🍆
How much do Json UI commissions usually cost?
3000 moneys
😔
I got jealous of a pack again
A feature I now desperately can't live without
What would be the use of this feature?
Is it like a global variable in the children scope
Instead of using the source control name?
yep
although you could simply use variables now that I think about it
Huh?
Variables can be modified in a binding statement now?
No, what I mean is that you can simply use (#value + $global_value) instead of (#value + #global_value)
how do i make my dynamic grid items not overlap
seems like a size issue
increase the width of the grid
I spent a week studying it from the beginning.
it is scrollable tho, the size is intentional
in that case, the grid should have a higher height value 6*18
although I'm not seeing any scrolling panel
wrong file sorry, i think i fixed it
moved the size to the scrollpanel instead
not 1:1 but it is something at least
remove the scroll or replace it with the one used in mobile
and remove scroll background
by making a custom container_scroll_panel?
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
@manic dragon why did this remove the scrollbar
content didn't fit
huh, it is not caused by allow_scrolling_even_when_content_fits
touch thing
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
i would create the scroll view from scratch
like this?
scrolling_panel it's just so confusing
i may do that
Remove the touch variable and copy the control for touch image control in mouse image control
what scroll_bar_contained does is include the bar in the panel itself
yeah
It literally means whether the bar is contained within the content panel or is separate
yeah, it does overlap with the slots tho
i don't think this is what you guys are referring to
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
How can I use it like this?
dynamic grid is not public yet
what do you want to do?
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
Smithing_table_screen_pocket.json doesn't work either
smithing_table_screen.json
These variables took some time to find
no wonder, this panel is a rabit hole
scrolling_panel
└─ scrolling_panel_base
└─ scroll_view_control
├─ scroll_background_and_viewport
└─ scroll_bar_and_track
├─ scrollbar_track
│ └─ $scroll_track_image_control
└─ scroll_box
├─ scrollbar_box_image
└─ touch_scrollbar_box_image
└─ anim_scrollbar_box_fadeout
🤔
Isn't that for classic UI? I'm searching the one for pocket ui
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
}
]
}
how do i fix my background disappearance when loading to a world and after leaving a world
Is there any better way to make ui than the preserve title text method
this is the best way to pass data to json UI imo
But there are other options- chat, scoreboard, subtitle, actionbar etc.
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?
highlight_slot_panel in ui_common.json
Oh thank you
how do i change chest ui hollow bg
wdym
Oh it's called dialog_background_opaque
You can change it through a variable $dialog_background
It's inside common_panel from ui_common
thanks
What kind of result do you want? And what did you do to achieve that?
nvm i figured it out
just trying to get the in game ui as close to the editor as possible
Ok
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?
it depends on how the elements are added in jsonui, ig
there order or relationship or who called who
you mean like the order they have in the controls array?
made a small extension
got it, thanks
almost forgot to thank you
is there any way to make conditional animations?
Does anyone know where to start to create a health bar ui
One that doesnt use actionbar
Just hardcoded in
i did it no worries
okok
is there a better way to link to health?
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
Check this video:
Code: https://github.com/LeGend077/json-ui-resources/blob/main/custom_progress_bar.json
Preserve Title Text: https://wiki.bedrock.dev/json-ui/preserve-title-texts.html
Music:
Sweden, Minecraft - C418
#minecraftbedrock
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?
https://wiki.bedrock.dev/json-ui/preserve-title-texts
You might find this difficult if you're new to this
yes i manage to figure how to make multiple title text, now im having trouble with a visual bug
this black bar shows up now
which im guessing is the title bar
Nvm just test it again doesnt work but thanks for ur help
Idk if there is a better way to do this without the use of titles? Something more hard coded?
made nice hotbar thingy
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
if you think you know what's the name of the element you're finding, 70% of the time it is exactly named like that
so just search 'play_button' man
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)
which screen
Start screen
?
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
hint: find the reference of that button
what did you search
The part after the @
start.main_button
It's referenced so many times but never defined
right path, but you need to exclude the namespace and the dot
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
no one's judging you dude, lock in
I don't think this will help me
I've been trying to learn this for 6 years atp
Im hopeless
The good thing is that most of the time these types of controls have variables to control properties of the child controls that allow you not to go through 6759394857483384484849467 control definitions
Bark each time I said control (maybe don't)
can json ui perform actions depending on slot content
for example if a slot have spesific item drop it
I can answer that it is possible, but I don't know the steps into it. There is no automation though, you still need to make an interaction (whether that is clicking a button)
i know about the button part
so we can't for example use preserved text on the item name to detect something and drop it?
The act of dropping something needs interaction
alright, thanks
i asume same thing for moving the item around
Yep
How do i get rid of the title background?
I used preserved text
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
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
"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
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 ()
that worked, thanks
thoughts on this ui?
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?
What is the most optimized way, with least conflict with other add-ons, to display UI elements?
use the least amount of entry points
Has anyone tried using chat messages?
you mean customising the chat messages? probably someone has tried
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.
Depends on what its for
how do you target a specific slot?
nothing beat searching here and stumbling across two well know members arguing
collection_index maybe?
if its only 1 button for 1 slot adding this may work
"property_bag": {
"#collection_index": 5,
"#collection_name": "container_items"
}
Collection index
I'd create a collection panel/stack panel with the collection name of chests and add the button as it's child with the collection index
You can use a grid alternatively
Does it work?
I mean setting collection index/name through bindings
yes it works atleast for property bag so maybe it can also work if you use bindings to set it
Oh good to know
I didn't try with property bag before but I remember trying with bindings but didn't work
Oh cool
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?
i never understood what property_bag do
May I see how you code grid
Yeah
"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
Is this for form ui
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/"
}
}
Yeah I solved it thank you
SOLVED
property_bag is a variable for bindings.
- 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.
what texture path is this guys
"D:\XboxGames\Minecraft for Windows\Content\data\gui\dist\hbui\assets\account-46c198f87391d9c79cf7.png"
it is not possible to change it using a resource pack
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
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
where do i find the texture path of this
The assets are in gui/dist/hbui folder
There's a texture atlas named menu_atlas, that has all these
I'm learning how to make ui. What are ALL the ways to connect interfaces to the server? (For example, clicking on a block)
can i know that specific texture? i mean the texture that is not in the atlas
My Forms aren't usable from a controller at all
I think it's the last row of textures in the atlas. I can't find separate texture for it. I might be missing it
nvm found it thanks for the help
can I link the ui to the scoreboard score?
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
you can get a bit more in ui_common.json I think
There are more. check container_slot_button_prototype in ui_common.json
Is custom sound in Json ui possible?
figured it out, thank you.
the only new one there is coalesce_stack
no idea what it does tho
nvm, it merges stacks
guys, what are some ways to connect the UI to the server? (For example, interaction with the block)
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
It's simply called cell_image
Are you asking for the default texture of the item cells or the highlighted texture?
the one that show on hover
nah it is fine, i found it
thanks tho
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
Is it not possible to access the #hud_title_text_string binding from screens other than the HUD?
Does this variable exist? anchored_offset_value_x_absolute
Binding
I think yeah
I've never seen this in any documentation, and every time I try to use it, it never works.
idk then
how are you using it?
is it possible to make "skill tree/ability tree" using json ui & server form?
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?
plz help
Yeah
Yesn't
This is the closest thing
#1377629363889115267 message
is anyone here know how to make a copy button with #form_button_text as the value?
not possible afaik, the closest thing would be a textbox
I see
how about a text box filled with that bindings?
should be possible?
Or can you explain better what you want to do?
I'm planning to make copy button form for admin form thing
like spectatig player, and there's so many duplicated words like I and l that I often mistook
I can't figure out exactly how it works (
Damn
You can't make any button that copies something
You could put the content in a text box so that the player can copy manually from there
and how to put the text inside a text box? I'm still new at text box bindings after all
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
ah, ok
what is the custom form? What is it, and how to trigger it?
modal forms in script api
that is, a long form is an action form, and a custom form is a modal form?
right?
yes
thank u
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
you need to use horse renderer, which u can search about in this server
{
"binding_name": "#hover_text",
"binding_name_override": "#entity_id"
"binding_type": "collection",
"binding_collection_name": "container_items"
}
Can this code limit the display to 4 buttons, so that the 5th button is not displayed?
You can't, not from #hover_text at least
Minecraft adds format code in front and back of the hover text making it unusable for entity rendering
Try adding "binding_condition": "once"
So what does that do?
#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
Ohh, got it. Thanks bro
can i strip that from the string
No, The value must be a string; if you remove it, it becomes a number
...
welp
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
I understood that it was, but I honestly don't remember anymore
can't you use modifications and insert into the server ui
If you create the same panel in the second pack you won't need the empty panel of the first pack
But I think what you mean is creating an empty panel and inserting into it from a second pack which is possible. Just have to keep the first pack below
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
panel@$panel_type
This'll work
yep, that was I meant
oh yeah, will this reduce the lag?
since it wasn't pre rendered behind visible thing
Idk how you plan on doing it without visible binding
You can't assign binding value to a variable
oh 😔
$var = #value
That didn't work?
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
Perhaps he can use variables, right?
Like: { "requires": "($var = 'ex')", "$panel_type": "@server_form.custom_panel" }
And "$var": "#title_text"//or #form_text
Subtitles have been added to Minecraft. Is this a JSON UI? If so, where are they located?
yes it is json ui, check the hud file
Nope. That's what I was trying to say. $var doesn't have the value of #title_text
In this case "#title_text" acts like a string set to a variable
Isn't it name "caption'?
I don't know where it is on the HUD.
subtitle_direction_label?
I found it! Thank you.
caption_frame
It was subtitle_panel
Caption_frame exists in previous versions as well.
How do you combine factory and factory?
I want to combine subtitle factory and chat factory.
It ends up like this
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
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
What does #form_button_texture contain?
Just category0
And that's exactly the toggle name
You can't use bindings inside source_control_name
So there is no way to set the name of the toggle that needs to be enabled from the script?
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
nope
Is the totem animation a ui element
I don't think so
nope
I'm guessing its part of player animation
No.
How do I recreate this? Could you help me?
I'm not sure if the selected item can be displayed like it, But I think you can do everything else
well"
You can through the hover element but Minecraft items are so messy I never have and will play with them😭
Can I at least use variables?
Could you guide me and give me more information. md?
Yeah you can use variables
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"
}
}
]
},```
So it's not the method to move locations of elements?
depends on what you mean with 'move': if you mean change the order of elemts in the array, you should use modifications. Though moving in the array is useful in stack panels only
If instead with move you mean phyisically move in the screen you can use anchors and offsets
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
I assume that one is in a stack panel: in that case offsets and anchors don't work, unless you wrap the control in another panel that is then part of the stack panel
however, for example with modifications you can make it so that the play button is the last button (after the marketplace button)
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
i can send you an example
i would appreciate that
nvm i found the source of my example, this is how i made my searchbar
this is so much bindings math
this stack splitting overlay is driving me crazy
isn't that just for mobile
yes
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
Nope
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
It's a custom renderer. So you can't modify much of anything from json UI for this
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
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
I'm seeing "[email protected]_buttons_stack_panel"
I heard from someone else that stack panels aren't anchorable or something
You can't use anchor or offset for the controls in a stack panel
But you can change them on the stack panel itself given that it's not inside another stack panel
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
You don't need to copy the entire code. You should look at the wiki. It has these guides for what you should modify and what not
I've tried the wiki so many times
