Solved Change the item for shooting an arrow

Discussion in 'Plugin Development' started by ThunderWaffeMC, Dec 31, 2012.

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

    ThunderWaffeMC

    Not sure if this is possible for the bukkit API, but how would I go about making it so you can shoot an arrow by right clicking your sword? So the sword acts as a bow but you can still hit entities with the sword by left clicking?

    Thanks in advance
     
  2. Offline

    tommycake50

    p.launchProjectile(Arrow.class);
     
  3. Offline

    fireblast709

    PlayerInteractEvent, event.getAction() == Action.RIGHT_CLICK_BLOCK/RIGHT_CLICK_AIR, event.getItem() != null && event.getItem().getType() == Material.SOME_SWORD, player.launchProjectile(Arrow.class)
     
    ThunderWaffeMC likes this.
  4. Offline

    ThunderWaffeMC

    Thanks.

    fireblast709 & tommycake50

    How can I change the amount of arrows getting shot? At the moment it shoots 2 arrows on every click? I currently want it so it shoots only 1. Is this done with ticks?

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: May 30, 2016
  5. Offline

    fireblast709

    maybe you are clicking too fast. Put a delay on it (like: store the System.currentTimeMillis() in a HashMap)
     
Thread Status:
Not open for further replies.

Share This Page