#Set passenger after armor stand teleported

1 messages · Page 1 of 1 (latest)

sharp cargo
#

So I have a player I want to be put as a passenger of an armor stand, for cleaner spawning I spawn the armor stand under the world so it does not flash, that works however the player for a split second gets tp'd under the world, how can I solve that? (apart adding a large delay with runSyncDelayedTask)

thick umbra
#

delay by 1 tick

sharp cargo
#

i am delaying by 2 ticks

#

still not working

sharp cargo
#
ArmorStand stand = (ArmorStand) world.spawnEntity(spawnLocation, EntityType.ARMOR_STAND);
PersistentDataContainer container = stand.getPersistentDataContainer();
container.set(key, PersistentDataType.INTEGER, 0);
container.set(tpKey, PersistentDataType.STRING, toTpId);
// flags n shit
stand.teleport(loc);
```Spawning

```java
@EventHandler
public void on(EntityTeleportEvent event) {
  System.out.println("EntityTeleportEvent " + event.getEntity().getName() + " " + event.getEntityType()); // Never getting called for that armor stand
}
```Listener