1.8.8 Armor stand smooth animation

Discussion in 'Spigot Plugin Development' started by Junat, Sep 16, 2020 at 8:59 PM.

  1. Guys, im trying to do a armor stand animation, but i can't do it smooth

    Current animation
    [​IMG]

    I'm trying to achieve something like this

    [​IMG]

    Anyone has idea how i can do my animation fluid/smooth?

    There is my current code

    Code (Java):
    Location center = player.getLocation().getBlock().getLocation().clone().add(0.5, -0.4, 0.5);

                            new BukkitRunnable() {

                                    float angle = 0f;
                                    final double RADIUS = 1.3;

                                    ArmorStand armorStand = null;

                                    @Override
                                    public void run() {

                                            double x = RADIUS * Math.sin(angle);
                                            double y = RADIUS * Math.cos(angle);

                                            if(armorStand == null){
                                                    armorStand = center.getWorld().spawn(center.clone().add(x, y, 0),  ArmorStand.class);
                                                    armorStand.setVisible(true);
                                                    armorStand.setHelmet(new ItemBuilder(Material.SKULL_ITEM)
                                                        .durability((short) 3)
                                                        .textureSkull(SKULL_URL).toItemStack());
                                                    armorStand.setSmall(true);
                                                    armorStand.setGravity(false);
                                            }

                                            angle += 0.1;

                                            armorStand.teleport(center.clone().add(x, y, 0));

                                    }
                            }.runTaskTimer(this, 0, 1);
     
    #1 Junat, Sep 16, 2020 at 8:59 PM
    Last edited: Sep 16, 2020 at 9:16 PM
  2. I can only imagine doing this with a PacketPlayOutRelEntityMovement packet. ProtocolLib could be helpful.

    But then I’d actually create the whole armor stands with packets then.
     
  3. So i tried it, but i got nothing...

    Idk what do, tried to change the armorstand velocity, but a got an bug.