#Why won't my custom form work?

1 messages · Page 1 of 1 (latest)

analog scarab
#

doesn't work even with the keywords inserted in the title of the ui? (§1§2§3§r)

elfin silo
analog scarab
#

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

analog scarab
elfin silo
#

So I make a form called const §1§2§3§r = new ActionFormData(); it'll work?

analog scarab
elfin silo
#

So I've got to make the title of the form that then?

analog scarab
#

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");
        }
     }
  )

}

elfin silo
#

Thank you!

#

Let me see if it'll work

analog scarab
#

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

elfin silo
#

You just saved me so much time! I thought I'd have to make custom glyphs for the title tysm

analog scarab
analog scarab
elfin silo
elfin silo
analog scarab
#

that code is for the form, to open it you have to decide how, via chat, block, item or entity

elfin silo
#

The form is defined here, same title

analog scarab
analog scarab
elfin silo
#

Yeah it works, it opens the UI but it's not the custom one

#

It worked!

#

Bro tysm this is sick

#

Wait but there's no butons