Solved How to get a trail of locations

Discussion in 'Plugin Development' started by Deleted user, Oct 28, 2014.

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

    Deleted user

    Think about a critical arrow... it leaves a trail of critical particles. I want to do this with firework stars, without the entity, in a row.
    I know how to spawn the particle effect, so now I need to build a Set<Location> with every point of the trail. I can start from a Location or build a Vector, it depends on you.
    I tried to use a drop with Item.getLocation() called in a repeating task, but even a 1 tick period makes them too far apart.
    I tried to use a BlockIterator object, but they are blocks, so too far apart.
     
  2. Offline

    Luke_Lax

    Erm are you asking about path finding goals?
     
  3. Offline

    Watto

    Yeah you need to elaborate a bit more, what you're trying to achieve, what you have tried, etc.
     
  4. Offline

    Deleted user

  5. Offline

    Deleted user

  6. Offline

    Luke_Lax

    This may be what you're looking for :)
     
  7. Offline

    Funergy

    Luke_Lax Its an old thread but it can still be usefull for reading. I won't suggest really using it because I've made that when I was like 2 and a half months busy with coding. there are so much better methods to use, to make that fun effect.
    (I think it was not that good. but I'm really happy that I've made that when I was coding for like 2,5 months)
     
  8. Offline

    Luke_Lax


    Maybe you should invest some time and make a good method, it's quite a nice idea :)
     
  9. Offline

    Funergy

    Luke_Lax Yeah I've already thought about. but I'm too lazy right now xD maybe tommorow. but look at the original post I've updated. And the reason I never updated before is just Slikey the developer from Hypixel already posted a good method so yeah :)
     
  10. Offline

    TheCodingCat

    if only there was an EntityMoveEvent Hey Dinnerbone! When you update bukkit add support for it! :p
     
  11. Offline

    Slikey

    No. This is not a good idea since it'd be too heavy on the performance.
    Anyhow. If you want to track a Entity that is ALWAYS moving, you should add a task and schedule it to run every tick.

    Funergy The method needs some interpolation if you want to change the interval of particles. I am very busy atm, so I won't be able to do it. Maybe if i get my hands on it in my spare time.. That's likely not to happen the next days. Sorry
     
    Funergy and OffLuffy like this.
  12. Offline

    Deleted user

    Luke_Lax Slikey That is my problem!
    If I use a repeating task, particles spawn too far apart. And I'm using a drop, but I do not want it!
    I think the solution is building a Set<Location>. How do I get them?
     
  13. Offline

    Funergy

    Joiner Look at my tutorial I've updated the code to make it better and non laggy ;p
    With some credits for Slikey 's method
     
  14. Offline

    Slikey

    The best method is to have a scheduler putting the current location of the arrow in an arraylist
    then iterate over that list and create the link vector of entry N and entry N+1
    then multiply that vector by like 0.1
    display particles along these vectors.. i'll do that tomorrow for it so you can learn from it
     
  15. Offline

    Deleted user

    Ok.
    How?
     
  16. Offline

    Plugers11

    Joiner
    There is a thread about that
    Look in resources
     
  17. Offline

    Deleted user

    Slikey Funergy Luke_Lax Watto Thank you.
    Code:java
    1. Location start = Player.getEyeLocation();
    2. Location increase = start.getDirection().toLocation(start.getWorld());
    3. for (int index = 0; index < 100; index++) {
    4. Location point = start.add(increase);
    5. }
     
Thread Status:
Not open for further replies.

Share This Page