Stopping records (playEffect)

Discussion in 'Plugin Development' started by Unica, May 3, 2015.

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

    Unica

    Yes, I know there are several threads about it.

    When I play an record_play effect, I need to stop it at a certain point;
    I found certain posts about setting the Material id to 0 (or air) but it simply doesn't work.

    Code:
    /* Playing effect (works) */
    player.playEffect(player.getLocation(), Effect.RECORD_PLAY, Material.RECORD_10.getId());
    
    /* Stopping effect (doesnt work) */
    player.playEffect(player.getLocation(), Effect.RECORD_PLAY, 0);
    
    Could anyone tell/link/enlighten me about this problem :)?

    my debug:
    [​IMG]

    I printed Material.getMaterial(-current-id-that-was-being-played-)

    Thanks.
     
  2. Offline

    DSCxSander

    It's not possible since 1.6.4.
     
  3. Offline

    nverdier

    What isn't?

    @Unica I have heard you have to use packets to stop this...
     
  4. Offline

    Zombie_Striker

    If you don't want to use packets, try using a JukeBox underground. Activate the jukebox and make it play a sound, and when you want it to stop, deactivate the jukebox and replace it with the block it was before.
     
  5. Offline

    Unica

    @nverdier Thanks, i'll look into that! Could you send me a link to the correct page :)? I'm unfamiliar with packets.


    @Zombie_Striker Yea, that could also be possible, thanks!
     
Thread Status:
Not open for further replies.

Share This Page