Get fireball deflection

Discussion in 'Plugin Development' started by jimbo8, Aug 4, 2015.

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

    jimbo8

    Hey!

    Is there any way to detect when a fireball gets deflected? I tried searching a lot on google, but I couldn't find anything except things that don't work, like EntityDamageByEntityEvent or such.

    I basically need to get the fireball that is getting deflected, and give it to the player instead of shooting it back.

    Thanks!
     
  2. EntityDamageByEntityEvent should work... What do you have so far?
     
  3. Offline

    jimbo8

    Sorry, it does actually work! My bad.

    I managed to fix it. Now, I need to figure out if the fireball hits a block instead of a player. Is there a clean and easy way to do this? I need to get the block it hits to drop an item there.

    @FisheyLP
     
  4. Offline

    Eos

    ProjectileHitEvent
     
  5. Offline

    jimbo8

    @Eos Thanks!

    Fixed that aswell, though, I have a problem. Whenever I shoot the fireball towards a wall or at the roof, it drops at the top of the roof, or outside the wall. How would I go forth if I wanted to make it actually spawn within the arena?
     
  6. Offline

    Eos

    @jimbo8
    You could try settings the Y of the projectile or get the block that was hit and spawn it 2 blocks under.
     
  7. Offline

    jimbo8

    @Eos I thought of that for the roof, but that wouldn't work for the walls.
     
Thread Status:
Not open for further replies.

Share This Page