How to teleport a spider jockey?

Discussion in 'Plugin Development' started by Bobcat00, Jul 4, 2014.

Thread Status:
Not open for further replies.
  1. Offline


    I want to teleport a spider jockey. The skeleton shows up as being in a vehicle (the spider). If I attempt to teleport the spider, it seems to fail. So does anyone know how to teleport the spider jockey?
  2. Offline


    Unmount, teleport spider, mount?
  3. Offline


    So far the best solution to teleporting entities with passengers/vehicles is a recursive loop that unmounts, teleports, and mounts again. I created something like this and I recommend that if you do this, to add a bit of a delay (I chose 3 ticks) between each step, as doing it all at once generally produces some buggy behavior.
  4. Offline


    that reminds me of having to setup arch linux...
  5. Offline


    I don't care that much if the jockey arrangement stays intact, so I simply eject the skeleton, then teleport both of them. It works well.

    I simply check if the spider has a passenger. Interestingly, I was unable to do the reverse -- check that the skeleton is in a vehicle and the vehicle is a spider -- because it appears there's no way to check that a vehicle is a spider. At least I couldn't find a way.

    Here's what I ended up doing:
    // Handle spider and chicken jockeys
    if (((entity.getType() == EntityType.SPIDER) &&
        !entity.isEmpty() && (entity.getPassenger() instanceof Skeleton)) ||
        ((entity.getType() == EntityType.CHICKEN) &&
        !entity.isEmpty() && (entity.getPassenger() instanceof Zombie)))
Thread Status:
Not open for further replies.

Share This Page