Add PlaySoundEvent #10582
Snuiper228
started this conversation in
Ideas
Add PlaySoundEvent
#10582
Replies: 1 comment
-
This is kinda iffy for me. Tons of sounds are completely client side with the server being unable to stop them at all. And there doesn't seem to be a clear way to tell what sound is controlled by the server and what is played by the client. I would be much more in favor of an event for the level event stuff, as that controls more than just sound, but quite a few other things. But that should come after that system is revamped to more accurately describe the level event system. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Is your feature request related to a problem?
The point of this event is that you can intercept and do whatever you want with the sound before it is sent to the client because it's impossible to do now. Sometimes you do now want some sounds to be played at all and this even would be useful in such situation
Describe the solution you'd like.
Inside the playSound() methods (they are inside the LevelAccessor and Entity class) add a PlaySoundEvent to be called and the plugin decides whether to cancel that event, which sound to play at which position, etc. Because sometimes sounds are played along with level events , it should also call the PlaySoundEvent in the levelEvent() and globalLevelEvent() methods (they are inside the LevelAccessor class) and in case something has changed, do not send the level event, but send the sound and particles separately
Describe alternatives you've considered.
There is no way to intercept the sound effect. There is only one way, which requires a ProtocolLib and listeners on ClientboundSoundPacket, ClientboundSoundEntityPacket, and ClientboundLevelEventPacket.
Other
Beta Was this translation helpful? Give feedback.
All reactions