#itemUse Events
1 messages · Page 1 of 1 (latest)
Ok. I will
Player is not defined there btw
source
The player is still not defined. Did you source: player
So did beforeEvent work?
No
Weird that supposed to work
world.afterEvents.itemUse.subscribe(({ itemStack, source: player }) => {
if (itemStack.typeId === "minecraft:stick") {
Menu(player)
}
});
Oh, I think that's right, I just remembered
I literally did that, read the script first buddy
And I'm not a beginner ☠️
Then why ping me 😭
Mybad lol
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
send your add-on @slow orchid
Of course I did it
main.js ?
the behavior pack
and know there are no errors in the script because before I put itemUse it was working
🤷♂️
Bruh
yeah
So, as you told me before, the fault could be mine
btw what is the other folder before
It is not from me that when it is unzipped it produces this and I do not know why
Plz no one preferre ActionForm GUI
@obsidian pewter Ok i will closed this post . come Dm
Use json ui some how and create new tab in pause menu
anshaallah