Tripleshot Bow when LeftClick

Discussion in 'Plugin Development' started by swagbobcow, Apr 22, 2017.

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


    So this code below shoots an arrow if you left click the Power 1 Bow. How do I make the bow shoot 3 arrows at the same time. It'll be like the hypixel bowspleef tripleshot.

    ItemStack archerBow = new ItemStack(Material.BOW);
      public void tripleshot(PlayerInteractEvent event){
              Player p = event.getPlayer();
              Action action = event.getAction();
              if(archerBow.getEnchantmentLevel(Enchantment.ARROW_DAMAGE) == 1){
              if(p.getItemInHand().equals(archerBow) && (action.equals(Action.LEFT_CLICK_AIR) || action.equals(Action.LEFT_CLICK_BLOCK))){
                  p.launchProjectile(Arrow.class).setCritical(true); // do tripleshot??
  2. Offline


    @swagbobcow if you are wanting to shoot 1 arrow per tick for 3 ticks, then you need to create a bukkit runnable. Inside that runnable you put your arrow launching code. Be sure to create a check if the runnable has run 3 times, then cancel the runnable.
  3. Offline


    No, i want to shoot 3 arrows at the same time.
  4. Offline


    Why not just paste
    3 times then?????????
  5. Offline


    Or, don't violate D.R.Y and use a for loop. :p
    Horsey and N00BHUN73R like this.
  6. Offline


    but that will only shoot 3 arrows in the same direction at different times.

    I just want 3 arrows to be shot at the same time. One arrow should go slightly off to the left of the direction of where the player is viewing. One arrow will go directly straight. The last arrow would go slightly to the right of where the player is looking.
Thread Status:
Not open for further replies.

Share This Page