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)
}
})```
#gui isn't opening
1 messages · Page 1 of 1 (latest)
Main.Menu(e.source) ==> Mains.Menu(e.source)
no no no
ok
what ?
Are you sure you wrote the item ID correctly?
okay, so i caught the spelling error changed it to the right scroll, and now its still not working, what do i do?
anything else, you guys wanna recommend ?
that you show the error log :v
it has nothing involving scripts
just a bunch of errors on custom projectile animations, and recipes i dont wanna add
the item works as if it opens the gui, like it doesntbreak dirt on long press, but no gui opens
most probably it has to do with json ui
meaning the problem is with the server_form.json file
in the rp
K
i'd suggest deleting the file or removing it
just to test if it's the problem
Thanks it worked