Remove arrows on ground?

Discussion in 'Plugin Development' started by mike0631, Feb 15, 2013.

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

    mike0631

    How do I remove all arrows on ground on the whole map ?
     
  2. Offline

    Vandrake

    Bukkit.getWorld().getEntities() or something
    then check if the entity is an arrow then remove it :3
     
  3. Offline

    mb01

    Code:
    for (Arrow arrow : currentWorld.getEntitiesByClass<Arrow.class>) {
      Vector vector = arrow.getVelocity();
     
      // Check if the arrow is moving, maybe there's a cleaner way of doing it
      if (vecor.getX() != 0 || vecor.getY() != 0 || vecor.getZ() != 0) {
        continue;
      }
     
      arrow.remove();
    }
     
  4. Offline

    mike0631

    Syntax error on token ">", Expression expected after this token
     
  5. Offline

    mb01

    getEntitiesByClass<Arrow.class>
    Replace the < >, it's a simple method call, use parentheses. I just wrote this too quickly.

    I'm just showing that you can get the arrows from a world object and remove them if they're immobile. Don't copy past a code if you don't understand it.
     
  6. Offline

    mike0631

    I got it to work, I did something wrong then.
    I understood it.
     
Thread Status:
Not open for further replies.

Share This Page