Getting Shooter of Projectile

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

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



    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:

    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...

  2. Offline


    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:, :D.
  4. Offline


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

Share This Page