Particle flame tail

Discussion in 'Plugin Development' started by FailCode, Jul 29, 2019.

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

    FailCode

    How create flame tail, and are there any faster threads than BukkitRunnable?
    Particles must appear even during rapid change x,y,z.
    Example (open)
     
  2. Offline

    timtower Administrator Administrator Moderator

    @FailCode Minecraft itself isn't faster.
    Did you consider spawning multiple things in the same tick?
     
  3. Offline

    FailCode

    show an example of a similar animation.
    I tried:
    Code:
      public void startTail() {
         new BukkitRunnable() {
           int i;
        public void run() {
    
        if(i<=10) {
              p.getWorld().spigot().playEffect(p.getLocation().clone().add(
                  0
                  ,0
                  ,1), Effect.FLAME, 2, 1, (float)0,(float)0,(float)0, (float)0.05, 30, 100);
        }else {
           this.cancel();
        }
         
        i++;
        }
         }.runTaskTimer(this.main, (long) 0.1F, (long) 0.1);
       }
    
    
     
  4. Offline

    timtower Administrator Administrator Moderator

    @FailCode That only shows 1 particle per tick though.
    Put in a for loop.
     
  5. Offline

    Kars

    @FailCode If you feel like Bukkit's threading system is not "fast" enough you could always use the native Java one. I am unclear as to what the difference is, however.
     
  6. Offline

    timtower Administrator Administrator Moderator

    You need to do those thing on the main thread though so you are still stick with the same tick rate.
     
  7. Offline

    FailCode

    Can you show a small example of tail creation using several methods?
     
  8. Offline

    timtower Administrator Administrator Moderator

    @FailCode
    Code:
      public void startTail() {
         new BukkitRunnable() {
        public void run() {
    
        for(int i = 0;i<10;++i){
              p.getWorld().spigot().playEffect(p.getLocation().clone().add(
                  0
                  ,0
                  ,1), Effect.FLAME, 2, 1, (float)0,(float)0,(float)0, (float)0.05, 30, 100);
        }
        }
         }.runTaskTimer(this.main, (long) 0.1F, (long) 0.1);
       }
    
    
    Now it spawns a bunch repeated
     
  9. Offline

    FailCode

    I think, can use particle lines, used: x,z random.nextGausian(); 10 times? And
    I do not know how to do it
     
  10. Offline

    timtower Administrator Administrator Moderator

  11. Offline

    FailCode

    Particles do not keep up with the player vector :(
    Screenshot (open)

    Code (open)

    Code:
         new BukkitRunnable() {
           int i;
        public void run() {
    
        if(i<=100) {
           for(int i = 0; i<5; i++) {
                p.getWorld().spigot().playEffect(p.getLocation().clone().add(
                      ,x
                    ,y
                    ,z), Effect.FLAME, 2, 1, (float)0,(float)0,(float)0, (float)0, 30, 100);
           }
         
        }else {
           this.cancel();
        }
       
        i++;
        }
         }.runTaskTimer(this.main, (long) 0.1F, (long) 0.1);
    
    
     
    Last edited: Aug 1, 2019
Thread Status:
Not open for further replies.

Share This Page