Teleporting a players pet to them

Discussion in 'Plugin Development' started by edragy, Aug 2, 2012.

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

    edragy

    How do you teleport a players pet to that player?
     
  2. Offline

    TheSmallBones

    Get the coordinates of the pet.
    Get the coordinates of the player and change the z by -1. Call this newPetC
    Change the coordinates of the pet to newPetC.
     
  3. Offline

    ZeusAllMighty11

    What if there are multiple players with multiple pets?

    Well if you did it that way, you'd have to manage to GET the pet first. And if you were gonnna get the pet first, why not just teleport after? Why get the coordinates of it?
     
  4. Offline

    edragy

    Yeah, getting the pet is what I need help with
     
  5. Offline

    michaelb10297

  6. Offline

    edragy

  7. Offline

    lycano

    edragy EternalWolf.java#L43 would give you everything you need to do a simple "Get all my living Wolfes to my location"

    Well, you can optimize this for shure if you store the UniqueEntityId to the players metadata for example ... but anyways it is a question of what you want to archieve.

    Cause if you do want to get all tamed wolves per player you have to track each EntityTameEvent and store the ID of that Entity with wolf.getUniqueId().

    All wolves that already spawned can be teleported via the given example. For all non-spawned entities ... well you cant teleport whats not already there and to prevent side effects with other plugins you shouldn't (recreating the entity by killing and resetting it, can cause problems with other plugins if they use getUniqueId()) .

    You have to find a way to spawn that exact Entity if its even possible...

    Hope that helps a bit.
     
Thread Status:
Not open for further replies.

Share This Page