Stopping a sound from playing

Discussion in 'Plugin Development' started by ImTheFool, Jan 17, 2013.

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

    ImTheFool

    I'm currently using
    Code:
    Location loc=event.getPlayer().getLocation();
    loc.getWorld().playEffect(loc, Effect.POTION_BREAK, 0);
    
    for the splash potion visual effect, but unfortunately, it also plays the glass-break sound. Is there any way to stop it from playing that sound, or doing something sneaky like playing the same sound with 0 volume or something?
     
  2. Offline

    Miner_Fil

    its on volume 0 i think, Try
    Code:
    Location loc = event.getPlayer().getLocation();
    loc.getWorld().playEffect(loc, Effect.POTION_BREAK, 10);
     
    ImTheFool likes this.
  3. Offline

    ImTheFool

    The last argument is the type of potion out of the potion types listed here: http://www.lb-stuff.com/Minecraft/PotionDataValues1.9pre3.txt. So changing that number just changes the color of the particles. :\
     
  4. Offline

    Miner_Fil

  5. Offline

    fireblast709

    there is no volume in playEffect(). I don't know if this is even possible (as the packet also plays the sound)
     
    ImTheFool likes this.
  6. Offline

    ImTheFool

    Ah. :[. Is there any way to modify the Effect Enums? Looking here: http://jd.bukkit.org/doxygen/d9/d42/Effect_8java_source.html, it says

    73
    POTION_BREAK(2002, Type.VISUAL, Potion.class),

    , which I would think that the Type.VISUAL would mean it doesn't send a sound, but is that just a mistake on the docs or w/e?
     
  7. Offline

    fireblast709

    the javadocs contain more mistakes
     
  8. Offline

    ImTheFool

    Ah. Poop. Well, thanks.
     
Thread Status:
Not open for further replies.

Share This Page