I've got a rubber block implemented in the block registry, like so:
.displayName('Block of Rubber')
.soundType('shroomlight')
.bounciness(0.9)
.fallenOn(entity => { entity.applyFallDamage(0)})
.requiresTool(true)
.tagBlock('create:wrench_pickup')
.tagBlock('minecraft:mineable/pickaxe')
.tagBlock('minecraft:mineable/axe')```
I'd like it to play a sound when it bounces entities that fall on it. I figured I could just add `entity.playSound('<THE SOUND>', 1, 1)` to the fallenOn parameter, after the fall damage nullification, eg.
```.fallenOn(entity => {
entity.applyFallDamage(0)
entity.playSound('minecraft:entity.enderman.teleport', 1, 1)
})```
but this doesn't work; it just throws an error like this each time the block's fallen on:
```[19:53:18] [Server thread/ERROR] [KubeJS Startup/]: block_registry.js#27: Error while an entity fell on custom block : dev.latvian.mods.rhino.EcmaError: TypeError: Cannot find function playSound in object dev.latvian.mods.kubejs.block.callbacks.EntityFallenOnBlockCallbackJS@5f5dd18e.```
I'm not really sure how to work with playSound; it's not really documented at all on the wikis and I cribbed the code I'm (successfully!) using elsewhere with it from here previously since the wiki examples didn't work.