How can I playSound with sound id string in sponge 8.0

This is the sound string “minecraft:entity.player.levelup”

in sponge 7.0 I can play sound by use this code

p.playSound(SoundType.of(“minecraft:entity.player.levelup”), p.getPosition(), 999);

but In sponge 8.0 I don’t know how to get sound type by string.

How can I play sound at the player with sound string ?

Please help me.

This is similar to getting a forge sound type

RegistryTypes.SOUND_TYPE.get().findValue(ResourceKey.minecraft("entity.player.levelup")

https://jd.spongepowered.org/spongeapi/8.1.0/org/spongepowered/api/registry/RegistryTypes.html#SOUND_TYPE

1 Like

Thank for you care!