Effects

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

  1. Offline

    PHILLIPS_71

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    Minecraft account:
    MCUSERNAME
    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?

    This post has been edited 1 time. It was last edited by PHILLIPS_71 Mar 30, 2013.
  2. Offline

    Tirelessly

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    Minecraft account:
    MCUSERNAME
    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

    PHILLIPS_71

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    Minecraft account:
    MCUSERNAME
    @Tirelessly

    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. Offline

    MCForger

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    Minecraft account:
    MCUSERNAME
    @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.

    This post has been edited 2 times. It was last edited by MCForger Mar 31, 2013.
  5. Offline

    PHILLIPS_71

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    Minecraft account:
    MCUSERNAME
    @MCForger
    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

    MCForger

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    Minecraft account:
    MCUSERNAME
  7. Offline

    PHILLIPS_71

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    Minecraft account:
    MCUSERNAME
    @MCForger
    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
  8. Offline

    DSH105 BukkitDev Staff

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    Minecraft account:
    MCUSERNAME
    The first value is the initial delay. The second is how long until the task is repeated again.

Share This Page