Finding the coordinate of what a bow shot?

Discussion in 'Plugin Development' started by cdsboy2000, Nov 9, 2013.

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

    cdsboy2000

    Hi,
    I'm currently working on a plugin that erases a block that was shot at after a toggle command is executed. However, I'm not exactly sure how to find the block coordinate of what the arrow hit. Any ideas of what code I could use?

    Thanks,
    -Chris
     
  2. Offline

    drtshock

  3. Offline

    L33m4n123

    I am not 100 percent sure but maybe something along these lines

    Code:java
    1.  
    2. public void onBowShot(EntityShootBowEvent e) {
    3. if (e.getEntity() instanceof Player) {
    4. Player p = (Player) e.getEntity();
    5. Location arrowLocation = e.getProjectile().getLocation(); // the Location the Arrow hit?
    6.  
    7. }
    8.  
    9. }
     
Thread Status:
Not open for further replies.

Share This Page