Solved Custom Arrow Effect

Discussion in 'Plugin Development' started by m16, Nov 11, 2018.

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

    m16

    Hi there,

    I'm currently trying to develop a plugin for 1.8 where if a user shoots an arrow with a bow and if the arrow lands on another player it would give the player that was hit a potion effect, such as nausea, blindness, etc. I've been looking everywhere to try to find how to do this but I just can't seem to find it. Is this possible in 1.8? If so what would be the general way to go about it? Thanks!
     
  2. Offline

    Zombie_Striker

    @m16
    It's possible. This is what you would need to do:
    1. Create a HashMap to store the arrow and the potion effect
    2. on EntityShootBowEvent
    3. If a player is shooting your bow with the arrows, add the arrow to the hashmap along with the effect
    4. on ProjectileHitEvent.
    5. If the arrow was in the hashmap, apply the effect to the hit player.
    Or just update ;p
     
    m16 likes this.
Thread Status:
Not open for further replies.

Share This Page