Hello! i am trying to move an armorstand that the player is riding in a pattern, i can get the point i want to move it to as well as where it is, i cant teleport it as you cant teleport something that has a passenger (well you can kick the passenger out teleport the stand then add the passenger back but that looks extremely shaky) so i need to add velocity to the armor stand, the problem is im not good at vector math. this is what i have: (entity is the Armour stand) Code (Text): new BukkitRunnable() { double t = 0; double r = 1; public void run() { t = t + Math.PI / 16; double x = r * Math.cos(t); double y = t; double z = r * Math.sin(t); loc.add(x, y, z); Vector to = new Vector((entity.getLocation().getX() - loc.getX()),entity.getLocation().getY() - loc.getY(),entity.getLocation().getZ() - loc.getZ()); to.normalize(); to.multiply(1); entity.setVelocity(to); loc.subtract(x, y, z);
why would you need to have a player ride an armour stand? just teleport an armour stand to the player. Also to use the code block hit the plus symbol at the top of the editor and hit code!
im trying to make a amusement park ride, and i dont want to use minecarts as i cant make them invisible and i cant use animals as i need to display a custom model wich can be achieved by placing the custom model on the armor stands head
while this would work i would like (if possible) to keep the player in the sitting animation, also constantly teleporting the player constantly locks there view.
i did some testing, make an invisible pig with a name of your choosing and have the player sit in it, teleport the armour stand to the pig and move the pig, the player will stay seated.
Got it, just had to fix my math (for anyone who was having the same problem here is my code) Code (Text): Vector pos = entity.getLocation().toVector(); Vector target = loc.toVector(); Vector velocity = target.subtract(pos); entity.setVelocity(velocity.normalize().multiply(0.5));