Solved How to see how many blocks an arrow/snowball travels?

Discussion in 'Plugin Development' started by Floofy, Apr 16, 2014.

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

    Floofy

    I've had an attempt to see how many blocks an arrow/snowball/enderpearl/etc; travels, but to no avail. BlockIterators, for example, seemed to have no success.

    (The BlockIterator results varied too much for them to be useful for this)

    Is there an easy way to do this that I've missed?

    Edit:

    Solved this by using...

    Code:
     
                    Location shooter = ((Player) ((Snowball) damager).getShooter()).getLocation();
                    Player entity2 = (Player) ((Snowball) damager).getShooter();
     
    
    Then to get the distance:

    Code:
    entity.getLocation().distance(shooter)
     
Thread Status:
Not open for further replies.

Share This Page