#gui isn't opening

1 messages · Page 1 of 1 (latest)

hearty summit
#

import { ActionFormData } from "@minecraft/server-ui"
import { world } from "@minecraft/server"

class Mains {

    Menu(player) {
        const form = new ActionFormData()
            .title('title text')
            .body('body text')
            .button('button 1', 'textures/items/apple') //0
            .button('button 2') //1
        form.show(player).then((data) => {
            if (data.selection === 0) {
                player.runCommandAsync('clear @s ninjago:enterscroll')
            }
            if (data.selection === 1) {
                player.runCommandAsync('say Command 2')
            }
        })
    }

}
export const Main = new Mains()

world.afterEvents.itemUse.subscribe(e => {
    if (e.itemStack.typeId === "ninjago:choose_croll") {
        Main.Menu(e.source)
    }
})```
ashen gate
#

Main.Menu(e.source) ==> Mains.Menu(e.source)

reef mesa
ashen gate
#

ok

hearty summit
#

what ?

reef mesa
#

Are you sure you wrote the item ID correctly?

hearty summit
#

okay, so i caught the spelling error changed it to the right scroll, and now its still not working, what do i do?

hearty summit
ashen gate
hearty summit
#

just a bunch of errors on custom projectile animations, and recipes i dont wanna add

hearty summit
ashen gate
brazen vault
#

in the rp

brazen vault
# hearty summit K

i'd suggest deleting the file or removing it
just to test if it's the problem