Slowing down/adding delay or speeding up this?

Discussion in 'Plugin Development' started by AaronL98, Jun 22, 2013.

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

    AaronL98

    Hey, so I've developed a plugin which fires snowballs from a hoe. I was wondering if there was a way to make more snowballs fire out faster than they already do when holding right click. I was also wanting a way to add a feature where if I held right click, i would only be able to shoot 1 snowball, then wait X seconds grant access to fire again. Heres my code:
    Code:
    public void onPlayerEvent(PlayerInteractEvent event){
            Player player = event.getPlayer();
            ItemStack snowball = new ItemStack(Material.SNOW_BALL, 1);
            if (player.getItemInHand().getType() == Material.WOOD_HOE){
                if(event.getAction() == Action.RIGHT_CLICK_AIR || event.getAction() == Action.RIGHT_CLICK_BLOCK){
                            if (player.getInventory().contains(Material.SNOW_BALL)){
                                shootSnowball(2.5, player);
    Also is there a way to make the snowball swerve slightly to the right/left/up at a certain angle so eventually the farther the snowball travels the more unaccurate it is? Thanks
     
  2. Offline

    bennie3211

    setVelocity()
     
  3. Offline

    AaronL98

    Not speeding up the snowball, speeding up the fire RATE.
     
  4. Offline

    bennie3211

    make a scheduler and check if player is right clicking in it, if he is then fire a snowball
     
  5. Offline

    AaronL98

    Could you please explain more? I'm kinda new-ish to bukkit
     
Thread Status:
Not open for further replies.

Share This Page