#how to update

1 messages · Page 1 of 1 (latest)

rocky helm
#

i dont really know scripting apis too much but i want to edit a template, if someone could please rewrite this in the newest minecraft bedrock update, this is like 2021 btw

const { ServerUI, ui } = require('@minecraft/server-ui');

// Create a game test script
const MyGameTest = ServerUI.registerGameTest("my_game_test", (test) => {
  // Listen for the player right-clicking with a compass
  test.assertCommand('/execute @p ~ ~ ~ detect ~ ~ ~ minecraft:compass 0 execute @s ~ ~ ~ testforblock ~ ~-1 ~ minecraft:air', 1);

  // Create the UI screen for the game test
  const screen = new ui.SimpleForm();
  screen.setTitle('Game Test');
  screen.setContent('Welcome to My Game Test!');
  screen.addButton('Start Game');
  screen.addButton('Exit');

  // Register the event handler for button clicks
  screen.onButtonClick((buttonIndex) => {
    if (buttonIndex === 0) {
      startGame(test);
    } else if (buttonIndex === 1) {
      test.succeed(); // Exit the game test
    }
  });

  // Show the UI screen to the player
  screen.sendTo(test.getPlayer());
});

function startGame(test) {
  // Your game logic here
  test.log('Starting game...');
  // Additional game logic can be added based on your specific requirements
}

// Run the game test
MyGameTest.run();```
prisma ginkgo
#

lol that's chatgpt

rocky helm
#

because what is written is what i need i just dont know how to code it yknow?

dense forge
#

imo

#

this is not outdated

#

its garbage

#

straightup lies

#

there some tutorials for compas gui on yt. Yes they are also outdated but they are closer to the actuall thing than this

pliant spindle
#

If you want @rocky helm I can make you a gui tomorrow

pliant spindle
rocky helm
rocky helm
pliant spindle
#

Nah it’s fine I message wan i wake up tomorrow

#

I have added you I will message you tomorrow good night @rocky helm and good night nerd @dense forge

rocky helm
#

thank you! you have a good night too :D @pliant spindle

dense forge
#

ask small questions

#

more small questions then 1 big one (for the chat gpt thing)

rocky helm
#

ooh okay, i tried but it cant recognize links so sending the wiki page thing the documents idk what its called, with specifying still didnt turn out too good