Solved Make a location produce particles?

Discussion in 'Plugin Development' started by Seemayr, Mar 24, 2014.

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


    Hey guys,
    I just was wondering if there's a way to get a location/block produce particles (the way someone with a potion effect or something would do if you know what I mean).

    (It would be perfect If there's a way to get all Blocks/Location-points do that, which got a distance of 200 Blocks from the spawn.)

    I really hope you know what I mean. If you don't - don't hesitate to ask, I could try to explain it again of course.

  2. Offline


    This will create a block break effect, but other effects are similar
  3. Offline


    rfsantos1996 Thanks, this works:
    1. world.playEffect(loc, Effect.MOBSPAWNER_FLAMES, 5);

    But this only creates particles one time and then it stops.
    Is there a way to produce them permanently or every 2 seconds or something? Do I need a Scheduler for that?
  4. Offline


    Schedual a repeating task! Or if you want to have those particles while that block isn't air, do

    while (!loc.getBlock().getType().equals(Material.AIR){
    loc.getWorld().playEffect(loc, Effect.MOBSPAWNER_FLAMES, 5);
  5. Offline


    Thank you, did it now and worked:

    1. getServer().getScheduler().scheduleAsyncRepeatingTask(this, new Runnable() {
    2. @Override
    3. public void run() {
    4. world.playEffect(l, Effect.MOBSPAWNER_FLAMES, 5);
    5. }
    6. }, 10L, 30L);
  6. Offline


  7. Offline


    Only 1 problem :

    1. scheduleAsyncRepeatingTask

    Dont use Async!

    Use something like this :
    1. Bukkit.getScheduler().scheduleSyncRepeatingTask(main,
    2. new Runnable() {
    3. public void run() {
    4. }
    5. }, 20, 2 * 20);
Thread Status:
Not open for further replies.

Share This Page