Discussion in 'Plugin Development' started by PHILLIPS_71, Mar 30, 2013.

  1. Offline


    I have got a plugin that shoots a grenade when you right click but I want it so every block it travails it shoots off a particle effect I don't know if I can do it like that or do it as a schedualed task and make it every 5-10 ticks it gives the particle effect?
  2. In a scheduled task, entity.getWorld().playEffect(params) with one of the parameters being the entity's location. I don't recall the parameters off the top of my head.
  3. Offline



    Ok when a player left clicks with a bow it shoots a explosive arrow so how would I get the location that the arrow travails as i want the effect to be on the arrow not the player
  4. PHILLIPS_71
    You will need to get the arrow you just shoot then run a scheduler every 2 seconds or so that spawns an effect at the arrow's location until it stops moving.
  5. Offline


    Im not on my computer so i just got this scheduler I found for a example as I'm not to good with schedulers

    server.getScheduler().scheduleSyncRepeatingTask(plugin, new Runnable() {
    public void run() {
    //add code for the arrow and add effects here?
    }, 2L, 2L);
  6. Offline


    Thanks, with the 2L I assumed that was ticks was I correct if so why does there need to be 2 sets of 2L 2L sorry for the noobs question I'm still learning bukkit/java code
  7. The first value is the initial delay. The second is how long until the task is repeated again.

Share This Page