Solved 1.11.2 ArmorStand update method

Discussion in 'Spigot Plugin Development' started by FrostedSnowman, May 31, 2017.

  1. FrostedSnowman

    Resource Staff

  2. What are you trying to update?
    Armorstand provides access to arm movement, leg movement, I think head movement,
    gravity, and others.
  3. FrostedSnowman

    Resource Staff

    in the post i linked, the guy said this in his code

    Code (Java):

      // This is the update method of the entity
        public void m() {

            // Getting the nms class of the player to have easier access to some
            // data.
            EntityPlayer p = ((CraftPlayer) Bukkit.getPlayer(player)).getHandle();
            // Setting the position
            setPosition(p.locX, p.locY, p.locZ);
            //Setting the yaw and pitch of the armor stand. If it fails we get another change to set it with the codes below.
            this.yaw = p.yaw;
            this.pitch = p.pitch;
            // Setting the yaw of the armor stand. I don't know for sure if this
            // works.
            setBodyPose(new Vector3f(0.0F, p.yaw, 0.0F));
    Code (Text):

      // This is the update method of the entity
    im trying to find the equivalent of this but in 1.11.2
  4. FrostedSnowman

    Resource Staff

    found it: it's the A_ method.

    let me tell you, it looks fucking dope mimicking the player lol
  5. I see, you are working with a friend of your's API I presume?
    You can work directly with ArmorStand's fields by supplying
    custom EulerAngles to change the direction of the specfic
    part of the ArmorStand to your liking.
  6. FrostedSnowman

    Resource Staff

    no. just making my own entity's. yes, im doing more than just working with the update method. (saying stuff, pathfinding, etc). but thanks for the info. i decided to use this since i believe its more efficient than using a repeating task to modify / update the position of the entity constantly. (especially with many entities at once)