Play particle effects

Discussion in 'Plugin Development' started by AppleMen, May 3, 2014.

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

    AppleMen

    Hello all,

    I'm wondering, if I want to play particle effects, I use:
    Code:java
    1. player.playEffect(player.getLocation(), Effect.MOBSPAWNER_FLAMES, 5);


    2 questions about it, where is the last number for? I changed it multiple times, nothing changed. And javadocs says T with Data.

    Also, I want to keep the particles playing, I was thinking to use a runnable. But how many ticks do I use? It should not play, stop for a few seconds, and play again. Just keep playing.
     
  2. Offline

    foldagerdk

    I don't remember what the Data is for.. I believe it is used for quantity, direction or something like that, but I am probably wrong. If you know how to use runnables, you can do it with around 50-100 ticks, since 20 ticks are around 1 second.
     
  3. Offline

    IkBenHarm

    AppleMen foldagerdk
    The number is, with Potion break effect, the colour. The rest of the effects i do not know
     
  4. Offline

    user_90854156

    The Data value changes some properties for some of the effects like,
    Smoke 1 to 8 changes the direction the smoke 'puffs' to (south, east, north, west, upwards etc..)
    Potion break changes which type of potion gets broken
    The sounds changes sounds and stuff
    Rest of the effects doesn't need the last value

    And to keep the particles keep playing, use a ScheduleSyncRepeatingTask
    PHP:
    Bukkit.getServer().getScheduler().scheduleSyncRepeatingTask(this, new Runnable() {
                            public 
    void run() {
                                    
    player.playEffect(player.getLocation(), Effect.MOBSPAWNER_FLAMES);
                            }
                    }, 
    120); // every second
     
Thread Status:
Not open for further replies.

Share This Page