#Sound isn't playing in item event

7 messages · Page 1 of 1 (latest)

lament perch
#

I'm trying to make a custom grab-bag, but for some reason the sounds don't seem to be working properly. They don't play at all, but the rest seem to be working properly.

ItemEvents.rightClicked(e => {
let loopcount = 1
let i = 0

if(e.item.id == "kubejs:coin_purse") {
    if (e.player.crouching == true) {
        loopcount = e.item.count
    }

    for (i = 0; i < loopcount; i++) {
        e.item.count--
        e.entity.playSound("minecraft:item.armor.equip_gold")
    }
}
})
plain idolBOT
#

Once your ticket has been resolved, please close it with </ticket close:1054771505520717835> command!

lament perch
#

Sound isn't playing in item event

celest vale
#

use ```js
e.server.runCommandSilent(playsound)

#

last time i tried to use playsound it wasn't working properly