When you hit someone with arrow you get the arrow back

Discussion in 'Plugin Development' started by Edvio, Apr 27, 2015.

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

    Edvio

    I need help with coding!
    If you hit a player or animal with an arrow from a bow you get the arrow back.
     
  2. Offline

    sgavster

    EntityDamageByEntityEvent
    get the damager - check if it is a arrow
    cast damager to arrow, get the shooter, check if it is a player
    get the entity, check if it is an animal or player
    if all that is true, give the shooter his arrow back.
    We will NOT spoon feed.
     
  3. Offline

    Msrules123

    Call an EntityDamageEvent and check if the damager is an instance of Arrow, if it is, get the shooter and check if it is a player. Then get the player's inventory and add a new ItemStack, containing one arrow.

    Ninja'd
     
  4. Offline

    Edvio

    How do you do that?
     
  5. Offline

    sgavster

Thread Status:
Not open for further replies.

Share This Page