How do you this "beam" effect?

Discussion in 'Plugin Development' started by born2kill_, Aug 19, 2014.

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

    born2kill_



    Go to 1:14. Could someone help me code this?
     
  2. Offline

    IkBenHarm

    Code:java
    1. Location location = p.getEyeLocation();
    2. BlockIterator blocksToAdd = new BlockIterator(location, 0D, lenght);
    3. Location blockToAdd;
    4.  
    5. while (blocksToAdd.hasNext()) {
    6.  
    7. blockToAdd = blocksToAdd.next().getLocation();
    8. //play effect and do other stuff
    9. }
     
  3. Offline

    Dubehh

    IkBenHarm
    Wouldn't a BlockIterator create the trail instantely (Not actuall shooting)?
    Just wondering
     
  4. Offline

    xTrollxDudex

    It would be relatively fast but it should have a beam effect nevertheless. In the case it was too fast, transverse the location list with a BukkitRunnable and you should be fine.
     
Thread Status:
Not open for further replies.

Share This Page