Solved Cancel sounds

Discussion in 'Plugin Development' started by MrGeneralQ, Sep 3, 2018.

Thread Status:
Not open for further replies.
  1. Offline

    MrGeneralQ

    Good afternoon

    Is there any possible way to cancel a sound from being played? In this particular example, I'm looking for a good method of canceling the existing thundersounds from playing. In case it is possible I was looking for an event so I could play a different sound instead.

    Thank you in advance!

    Br,

    Quinten
    MrGeneralQ
     
  2. Online

    timtower Administrator Administrator Moderator

  3. Offline

    MrGeneralQ

    Is there any way to manipulate that then?
     
  4. Offline

    The_Spaceman

    player.stopSound(Sound.ENTITY_LIGHTNING_BOLT_THUNDER);

    something like this?
     
  5. Offline

    MrGeneralQ

    That's what I need yes. But the question is, how do I cancel that WHEN it is happening.
     
  6. Offline

    The_Spaceman

    you can try using this event: 'LightningStrikeEvent'
    I dont know if this works...

    Next time when using Intellij you can open the 'external libaries' tab, and navigate to 'org.bukkit.event' to have a look for yourself :D
     
  7. Offline

    MrGeneralQ

    That might help, I can maybe use that event to stop the sound and then play my sound instead. I'll give it a try.

    UPDATE:
    It doesn't work. The target was to cancel the lightning sound. But it seems to be not possible. Not even with the stopSound.

    I will consider this topic solved anway.
     
    Last edited: Sep 6, 2018
Thread Status:
Not open for further replies.

Share This Page