Solved Armorstand rotation

Discussion in 'Spigot Plugin Development' started by epe07, Jul 2, 2016.

Thread Status:
Not open for further replies.
  1. Hi!

    When i spawn armorstands, they will always be rotated same direction as player.
    I dont want to do that.

    I tried to set rotation with EulerAngle and teleport to location that has rotation 0.

    Does not work. :(
     
  2. FormallyMyles

    Supporter

    • Like Like x 1
  3. Code (Text):
    World w = p.getWorld();
                            ArmorStand stand = (ArmorStand) w.spawnEntity(p.getLocation().add(x*0.62, y*0.62, z*0.62), EntityType.ARMOR_STAND);
                            stand.setHelmet(new ItemStack(Material.COBBLESTONE));
                            stand.setGravity(false);
                            stand.setVisible(false);
                            stand.setHeadPose(new EulerAngle(0, 0 ,0));
                            Location l = stand.getLocation();
                            l.setYaw(0);
                            l.setPitch(0);
                            stand.teleport(l);
     
  4. FormallyMyles

    Supporter

    Try .setBodyPose as well?
     
    • Like Like x 1
  5. Nope.
     
  6. FormallyMyles

    Supporter

    Perhaps instead of p.getLocation().add(x*0.62, y*0.62, z*0.62)

    Use:

    Location loc = p.getLocation().clone().add(x*0.62, y*0.62, z*0.62);

    Then:
    loc.setYaw(0f);

    and pass loc into w.spawnEntity
     
    • Useful Useful x 1
  7. Thanks. :)
     
    • Agree Agree x 1
Thread Status:
Not open for further replies.