#2nd page

1 messages · Page 1 of 1 (latest)

teal narwhal
#

anyone now how to make a button that opens up a second page?

dusty terrace
#

yes white function is very easy mahe this

terse tiger
# teal narwhal anyone now how to make a button that opens up a second page?
import { world } from "@minecraft/server"

function Form(player) {
    const form = new ActionFormData()
    form.title('name') ///your title
    form.button('test') ///your button
    form.show(player).then(r => {
        if (r.selection === 0) {
            Form1(player)
            player.runCommandAsync('say a')
        }
    })
}

function Form1(player) {
    const form1 = new ActionFormData()
    form1.title('a') ///your new ui title
    form1.button('button 1') ///your button
    form1.show(player).then(r => {
        if (r.selection === 0) {
            player.runCommandAsync('say a')
        }
    })
}

world.afterEvents.itemUse.subscribe((event) => {
    const item = event.itemStack
    const player = event.source
    if (item.typeId === "minecraft:diamond") { ///you can chose an other item with his Id
        Form(player)
    }
})```
#

@teal narwhal

teal narwhal
#

someone already helped me sorry

terse tiger