Solved getShooter() 1.7.2 ro4

Discussion in 'Plugin Development' started by jthort, Mar 25, 2014.

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

    jthort

    I have the following code
    Code:
    @EventHandler
        public void onHit(EntityDamageByEntityEvent e) {
        if (!(e.getDamager() instanceof Arrow))
        return;
        if(!(e.getEntity() instanceof Player)) return;
        Arrow r = (Arrow) e.getDamager();
        Player p = (Player) e.getEntity();
        System.out.println(r.toString());
        System.out.println(r.getShooter());
     
        }
    Which works with 1.7.2 Ro2, but when I use 1.7.2 Ro4 it says it cannot find the .getShooter() method.

    Did that change in the new version? Is this a bug? Thanks
     
  2. Offline

    Bammerbom

    jthort I just tested it, for me the method still exist.
     
    jthort likes this.
  3. Offline

    jthort

  4. Offline

    Barinade

    Not sure why it would work but try casting Projectile and accessing the method directly rather than inheritance
     
Thread Status:
Not open for further replies.

Share This Page