#itemUse Events

1 messages · Page 1 of 1 (latest)

keen badger
#

Try using beforeEvents

slow orchid
keen badger
#

Player is not defined there btw

slow orchid
keen badger
keen badger
slow orchid
keen badger
untold zodiac
#

check error

#

or check ur Menu function logic

keen badger
#
world.afterEvents.itemUse.subscribe(({ itemStack, source: player }) => {
    if (itemStack.typeId === "minecraft:stick") {
        Menu(player)
    }
});
slow orchid
#

Oh, I think that's right, I just remembered

keen badger
#

I literally did that, read the script first buddy

#

And I'm not a beginner ☠️

#

Then why ping me 😭

#

Mybad lol

slow orchid
#
world.afterEvents.itemUse.subscribe((event) => {
    const itemStack = event.itemStack;
    const player = event.source;
  if (itemStack.typeId === "minecraft:stick") {
 Menu(player)
 }
 })

I tried and the same problem occurred. I don't think the problem is here because I also used console.warn("test") and the same thing happened

#

no. I used chatSend Events and it worked

#

Yes

#
function Menu(player) {
    const mevo = new ActionFormData()
    mevo.title("Menu")
    mevo.body("§l§aBy Mevo")
    mevo.button("Statistics", "textures/ui/icon_book_writable");
    mevo.button("Top", "textures/ui/multiplayer_glyph_color");
    mevo.show(player).then((r) => {
        if (r.canceled) return;
        const response = r.selection;
        switch (response) {
            case 0:
StatisticsMenu(player);
break;
            case 1:
TopMenu(player);
break;
                default:
        }
    })
}
#

Yes . and There are no errors in log

#

It is in main.js and there is no error in the code in general, because as I told you before, the menu was opened via chatSend Events, and I only changed the opening method.

#

Yes, of course

#
{
    "format_version": 2,
    "header": {
        "description": "Creator : §4Mevo",
        "name": "Statistics §l§a[Behavior]",
        "uuid": "e471cf08-447f-4459-b15a-39db0e2245e6",
        "version": [ 1, 0, 0 ],
        "min_engine_version": [ 1, 20, 0 ]
    },
    "modules": [
        {
            "description": "",
            "type": "data",
            "uuid": "ac02b7d5-ad51-4002-a633-9ba226b7858a",
            "version": [ 1, 0, 0 ]
        },
        {
            "uuid": "e5225bc6-f9c0-445a-8759-431eba653f79",
            "version": [ 1, 0, 0 ],
            "type": "script",
            "language": "javascript",
            "entry": "main.js"
        }
    ],
    "dependencies": [
        {
            "module_name": "@minecraft/server",
            "version": "1.11.0-beta"
        },
        {
            "module_name": "@minecraft/server-ui",
            "version": "1.2.0-beta"
        }
    ]
    }
#

What

#

I don't think there is a difference because it worked before

#

The same problem

obsidian pewter
#

send your add-on @slow orchid

slow orchid
#

Of course I did it

slow orchid
obsidian pewter
#

the behavior pack

slow orchid
#

and know there are no errors in the script because before I put itemUse it was working

obsidian pewter
slow orchid
obsidian pewter
#

yeah

slow orchid
#

So, as you told me before, the fault could be mine

obsidian pewter
#

btw what is the other folder before

slow orchid
novel mural
#

Plz no one preferre ActionForm GUI

slow orchid
#

@obsidian pewter Ok i will closed this post . come Dm

novel mural
#

Use json ui some how and create new tab in pause menu