#Why won't my custom form work?
1 messages · Page 1 of 1 (latest)
Uh sorry not sure what you mean by that? Do you mean the "Chain Kits" title?
in the file, the name of the ui is (§1§2§3§r), so in the ui script did you put that as the title? the ui is activated only when the custom title that you entered in the file sent before is present
I tested in vanilla and the ui works perfectly if you enter ui §1§2§3§r as the title, I don't see the keys because they are not present in the script
because in the code as a variable to start the gui you created, you use a custom title, which doesn't start it without that, instead once inserted it works, I hope I explained myself well
Ah I see! I didn't know that! So I can make different forms for different types of uis? That's awesome because I had a menu and I didn't want it to look like the shop gui
So I make a form called const §1§2§3§r = new ActionFormData(); it'll work?
exactly, based on the ui title, you can create variations of new uis
no
So I've got to make the title of the form that then?
import * as ui from '@minecraft/server-ui'
function test_custom_ui(player) {
const form = new ui.ActionFormData()
form.title("§1§2§3§r")
form.body("test")
form.button("test")
form.show(player).then(result => {
if (result.selection === 0) {
player.sendMessage({"rawtext":[{"text":" §6§l"},{"selector":"@s"},{"text":"\n"},{"translate":"test"}]});
player.runCommandAsync("playsound break.amethyst_block @s ~ ~ ~ 3 1 3");
}
}
)
}
if you want to add other variants, first you make them in the texture side in the server_form and then several ui in the script side. for each of them in the script you will have to insert the corresponding title, so when you start they are activated
You just saved me so much time! I thought I'd have to make custom glyphs for the title tysm
to work it works,but of course you have to be careful how you edit
Don't worry, ask for more info
Okay thank you
I tried that today and it didn't work @analog scarab
that code is for the form, to open it you have to decide how, via chat, block, item or entity
Does that code work in vanilla, which opens the ui via item?