#Help with item event script
26 messages · Page 1 of 1 (latest)
Once your ticket has been resolved, please close it with </ticket close:1054771505520717835> command!
well you are running the command execute, the playsound thing should be at the end after run right?
if you have an entity you can point to it'd be way easier, you could just run :
execute at entity as entity run playsound [...]
It's a script to make it when player right click a item it run that command and play a sound, i thought player and entity are written differently
I'm guessing you can get the coordinates and the dimension the player is inside
I'm still unsure how do i write that down
I am not sure of the exact writing but your IDE should autocomplete correctly
let player = event.getPlayer()
[....]
player.level.dimension
player.x,player.y,player.z
ItemEvents.RightClicked('kubejs:clumling', event => { let player = event.getPlayer() [....] player.level.dimension player.x,player.y,player.z }
no no
the thing I wrote was exemple
the player.x things you replace in your existing code
the first line you need to put separately
what i replaced it with?
the thing in dollar signs
normally this should work
as in event.server.runCommandSilent('execute in $(player.level.dimension)
etc etc
Do i just remove the "positioned ${event.entity} part or replace it with something else?
oh wait
ItemEvents.RightClicked('kubejs:clumling', event => { event.server.runCommandSilent('execute in ${player.level.dimension} positioned ${player.x} ${player.y} ${player.z} playsound a_man_with_plushies:ratatin_voice_line1 player @s ) })
like that?
ok that din't worked
uhhm