#New to scripts, want to make a custom gui for my realm

1 messages · Page 1 of 1 (latest)

candid blade
#

I've only recently taken interest in bedrock scripting and want to create a gui for my realm, but have no idea where to look for tutorials or anything. I want just a normal menu with a spawn button, warps button, rules / info button, and settings button

rare grail
# candid blade I've only recently taken interest in bedrock scripting and want to create a gui ...

https://learn.microsoft.com/en-us/minecraft/creator/scriptapi/minecraft/server-ui/actionformdata?view=minecraft-bedrock-stable

Example:

import { world, system, Player } from "@minecraft/server";
import { ActionFormData } from "@minecraft/server-ui";

world.beforeEvents.itemUse.subscribe((e) => {
    if (e.itemStack.typeId == 'minecraft:compass') 
      system.run(() =>  { main(e.source) })
});



function main(player) {
  const main = new ActionFormData();
  main.title('example');
  main.body('example body');
  main.button('button', 'textures/path/example');
  main.show(player).then(({ selection, canceled }) => {
      if (canceled) return;
      if (selection === 0) {
         player.sendMessage('you clicked a button!')
         player.playSound('random.levelup')
        }
  })
}

Contents of the @minecraft/server-ui.ActionFormData class.

west ermine
# candid blade I've only recently taken interest in bedrock scripting and want to create a gui ...

I’ve got an Admin Addon I could share with ya, doesn’t do everything you want but should give you a solid starting point. Mine has an option for spectator, an option to enable an on screen tps and mspt monitor, option to kill mobs within a range, kill items within a range, toggle greifing and there’s a little settings config for setting title colours and the title name from the form itself. Made it for my server admin so they could have similar tools used by X on hermitcraft for handling lag.

waxen monolith
candid blade
uncut radish
uncut radish
#

The wiki has complete info, idk how that makes easier to understand, but I guess it's up to you which is easier for you.

Also I see no difference, except they run the form using function. Nothing else.