Armorstand Passenger

Discussion in 'Spigot Plugin Development' started by MakingTheMagic, May 31, 2016.

  1. Hey guys!

    Does anyone know how I could go about teleporting an Armorstand with a passenger? Thanks.
    Any advice will be appreciated.
  2. remove passenger -> teleport stand -> teleport passenger -> add passenger back
  3. The passenger is a minecart, that I want to ride, so would I still teleport it?
  4. In that case, you are the passenger. The minecart is the vehicle. You still teleport both entities.
  5. Ok, but if I teleport the minecart, it just ejects the passenger and I don't really want to have to teleport the player.
  6. Choco


    Think about it this way...
    You can't drive a car if the person isn't willing to move anywhere.

    You have to teleport the entities individually, otherwise it's only going to teleport the one entity you specified
  7. Alrighty, so I would just check if the minecart had a passenger, then teleport that passenger?
    • Agree Agree x 1
  8. Choco


    Pretty much. Just make sure that you set the vahicle's passenger again after teleporting. The player will be kicked out of the vehicle once one of the entities are teleported. vehicle.setPassenger(player) after teleporting. Not all that difficult :)
  9. Ok, I will try this and get back to you :)
  10. How I would I make it so the passenger doesn't get kicked out of the minecart every time?
  11. Choco


    If the entity is too far away, the passenger is going to be removed. It's just how it works ;P
  12. Ugh. Well isn't there a way to stop the passenger being teleported out each time I teleport the cart?
  13. Or is there a way, I could change the location to a vector?
  14. Why not just put them back in after the teleport?