I am making a KitPvp plugin and I want to make a ranger class. How do I make it shoot a bunch of arrows, or like you dont need to charge up your bow, and what about just shooting faster ? Quickshot is what I think its called. Thank You!
@BladdonB Check in the playerInteract event if the player has a bow in his hand and arrows in his Inventory. Then remove one arrow, launch an arrow (player.launchProjectile I think it was called) and maybe add a coolown so that the player can't shoot too fast.
Im new to coding and I still don't know everything to coding and when I make this plugin it helps me learn new things, do you think you can show me an example?
@BladdonB Code: @EventHandler public void onBowClick(PlayerInteractEvent e){ Player p = e.getPlayer(); if(e.getAction() == Action.RIGHT_CLICK_AIR || e.getAction() == Action.RIGHT_CLICK_BLOCK){ if(p.getItemInHand().getType() == Material.BOW){ Arrow ar = p.launchProjectile(Arrow.class); ar.setVelocity(p.getLocation().getDirection().multiply(2)); } } }
@BladdonB Mark as solved if solved. If you're new to Java, then please learn Java before you continue. If you know Java and don't know Bukkit, then look here: http://docs.codelanx.com/Bukkit/1.7.10/ And find the event/class you want and look at all of it's methods.