New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Can't Stop a Sound from Playing in a PlaySoundEvent #1778
Comments
Logs. |
What do you mean, by saying Logs? Do you want any Logs from me? There are no important Logs, because its a semantic Bug, a Bug, which does not throw any Exceptions, except for the last one, becuase the Event is not cancelable. |
PlaySoundEvent does not have HasResult or Cancellable annotations. |
Why each doesn't work. The old way you used in 1.7 should be what your after. event.result = null; EDIT: |
Thanks, for your Help. Although, its confusing, naming a Function getResult and setResult?? You could rename them to setResultState and getResultState, just to clarify things. Because right now, it looks like you would set the event.result. |
OK, but if I try now to stop the music by using soundHandler.stopSound() (I want to Stop the music if the user clicks on the Play Button of the GUi), if a GUI is Open, and I Close the GUI again, the Music starts to Play again from the beginning on, without generating an Event. (I Think its the same situation when you open and close the Esc Menu). Only Calling the Method again and the soundHandler.update() Method, after the GUI has been Closed helps. This did not happen in MC 1.7. |
@diesieben07 added labels [Bug] |
setResultSound(null) will prevent the sound from playing. |
HI,
I'm currently working on a mp3 Player Mod, and so I have to Stop any Background Music from playing when the Player is playing music. I have tried to Subscribe to the PlaySoundEvent to stop the Music. But I cant stop the Music from Playing. I have tried these three Methods:
I'm using Forge 11.14.1299 (I know that this isn't the newest Version of Forge, but I have had a look in the Changelog and there were no issues regarding that).
In Minecraft 1.7 (Forge V1.7.10-10.13.0.1180) this Worked:
BTW:
Is there a way of playing a File from a specified Path and not use the SoundSystem directly, or get the SoundSystem Object without reflection?
The text was updated successfully, but these errors were encountered: