Getting Shooter of Projectile

Discussion in 'Plugin Development' started by handyplayer13, Mar 6, 2014.

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

    handyplayer13

    Hello!

    I am new to plugin programming, but I have experience with Java.

    I use the "ProjectileHitEvent" to react when a snowball hits something.
    There I want to get the shooter of it. I tried it the following way:

    Code:java
    1. if (e.getEntity().getShooter() instanceof Player) { }


    This actually works, but it says the method "LivingEntity getShooter()" is deprecated!
    Everywhere I searched for a way for getting the shooter, I saw it like that.

    How to use the "ProjectileSource getShooter()" method?
    I can´t figure it out...

    Thanks!
     
  2. Offline

    Timbals

    When the method is deprecated it still works but it will be removed in the next updates
    You can still use the method
    and when you don't like the warning you can add a SupressWarning
     
  3. This may help you: https://forums.bukkit.org/threads/h...fter-checking-the-shooter-is-a-player.229674/, :D.
     
  4. Offline

    handyplayer13

    I fixed it using Bukkit instead of CraftBukkit! :)
     
Thread Status:
Not open for further replies.

Share This Page