KubeJS (Old)

KubeJS (Old)

3M Downloads

Playsound on player not working

Auseawesome opened this issue ยท 15 comments

commented

Minecraft Version

1.20.1

KubeJS Version

2001.6.4-build.138

Rhino Version

2001.2.2-build.18

Architectury Version

9.2.14

Forge/Fabric Version

Forge 47.2.20

Describe your issue

ItemEvents.rightClicked('minecraft:stick', event => {
    event.player.playSound('minecraft:entity.chicken.death')
    event.player.tell("Testing 123")
})

tells the player but does not play any sound.

ItemEvents.rightClicked('minecraft:stick', event => {
    event.level.playSound(null, event.player.x, event.player.y, event.player.z, 'minecraft:entity.chicken.death', 'master', 1, 1.0)
    event.player.tell("Testing 123")
})

But this works

Crash report/logs

No response

commented

thats the level one I'm using currently iirc. Which is the bottom thing I suggested, it's the fact the player one doesn't work at all thats the issue, which you admitted to not being able to get working yourself in the previous comment on this issue.

commented

ofcourse

commented

i would just use the level one then

commented

I am, this issue isn't about helping me, its about getting the player one fixed, as its kind of redundant at the moment

commented

i agree

commented

though its a known issue at this point i believe

commented

i think lats aware of it anyways, though you could keep this open for max/lat to see

commented

try doing player.x.toFixed(0) ect, i know some minecraft commands are like that though not sure if this is the same way

commented

well surely it should have a location because otherwise it's completely useless, as far as I could tell I couldn't pass a location in

commented

i personally tried my best to get the player one working but i ended up just using the vanilla commands for it, is the level method not working or something that you need the player playsound?

commented

image

commented

The bottom one works, its the top one that doesn't work and that doesn't involve player.x

commented

ahh yeah thats a known thing, it doesnt specify a location so it goes to 0 0 0 always

commented

but surely it should know location if the bottom one works?

commented

the bottom one is a different method entirely, its the level playsound, the player playsound doesnt have it