Hide arrows on players

Discussion in 'Plugin Development' started by Bikkel007, Feb 6, 2014.

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

    Bikkel007

    Hello,

    I am wondering how to hide arrows on a player. I have the following class but this won't remove an arrow when it hits a player. Is there a way to remove or hide the arrows on a player? I know this is possible because I saw it on another server.

    Code:
    public void OnProjectileHit (ProjectileHitEvent event)
        {
            if(event.getEntity() instanceof Arrow)
                event.getEntity().remove();
            }
    Kind Regards,
    Bikkel007

    Bump, Does anyone knows how to do this?

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Jun 6, 2016
  2. Offline

    Alshain01

    Bikkel007

    getEntity in that event gets the entity the projectile hit. Since arrows can't hit arrows it won't ever be an arrow. Use EntityDamageByEntityEvent. Check to see that getEntity() instanceof Player and getDamager() instanceof Arrow
     
  3. Offline

    Bikkel007

    Alshain01

    The class I showed you removes the arrows actually, so it is working. If I use the EntityDamageByEntityEvent the arrows still get stuck in the players :(
     
  4. Offline

    Alshain01

    If it's working, what do you need help with?
     
  5. Offline

    Bikkel007

    Alshain01

    I mean it is removing the arrows from the ground but if you hit a player with that arrow, it will get stuck in the player so that part is not working. I tried your EntityDamageByEntityEvent to remove the arrows, but that works like my own class.
     
  6. Offline

    Conarnar

    Bikkel007 The arrows that appear stuck in a player aren't arrow entities. It is actually the client rendering the players like that.
     
  7. Offline

    Desle

Thread Status:
Not open for further replies.

Share This Page