Solved Simple question. How do I save the changes I made to the armor stand entity

Discussion in 'Spigot Plugin Development' started by MCrafterzz, Aug 11, 2018.

  1. Hello I want to modify a armorstand. Code:
    Code (Text):
    CraftEntity craftEntity = (CraftEntity) event.getRightClicked();
                    net.minecraft.server.v1_13_R1.Entity nmsEntity = craftEntity.getHandle();

                    NBTTagCompound compound = new NBTTagCompound();
    compound.setBoolean("Small", true);
    ArmorStand armorStand = (ArmorStand) craftEntity;
                            armorStand.setLeftArmPose(new EulerAngle(25, 0, 0));
                            armorStand.setRightArmPose(new EulerAngle(335, 0, 0));
                            armorStand.setLeftLegPose(new EulerAngle(25, 0, 0));
                            armorStand.setRightArmPose(new EulerAngle(335, 0, 0));
    This doesn't sabe the changes made to the armorstand. How do I do that? I'm sure it's something ovious but the craftEntity doesn't have any saveData methoud or similar atleast what I can find.
  2. Well I do change some stuff like NoAi that requires NMs it's just that I removed it from the uploaded code as it otherwise would have been very long. So how do I make this work?
  3. Idon't know what "nmsEntity#c" and "nmsEntity#f" does (well you use it obviously to serialize it to an NBT tag and deserialize it again, but this shouldn't be done while the entity is active and living in a world).
    Everything which is part of the bukkit API, what you posted works well for me.

    Try instead of using NBTTagCompounds to set it as small or no AI or whatever... use the fields of the actual entity object.
  4. No I've coverted it to use the bukkit versions and now nothing works. I also tried ArmorStand armorStand = (ArmorStand) event.getRightClicked(); but that didn't change anything. I think the changes needs to be saved somehow
  5. SetAi excisted for LivingEntity so the only thing I couldn't convert is setting the age. Moving all the craftdata stuff to the location when editing the age fixed it.