simple horse teleport

Discussion in 'Archived: Plugin Requests' started by switorik, Dec 15, 2013.

  1. Offline

    switorik

    I've been looking for a plugin to teleport horses with a player. The only one I've come across seems to be inactive (HorseTeleport).

    For example, if a player does /home or /spawn, I want the horse to teleport with them (assuming they are mounted on it).

    Is this possible or does one exist?
     
  2. Offline

    GetGoodKid

    I'm currently working on a Horse RPG plugin. Maybe it has what you're looking for? At the moment players can only own one horse (unless the server owner modifies the horses database).

    Horse RPG: http://dev.bukkit.org/bukkit-plugins/horse-rpg/

    Use "/hr spawn (or summon)" & "/hr banish" commands to summon/banish your horse.

    Soon though, I'll integrate Vault (economy), add horse skills, add multiple horse owning, buying/selling, etc.
     
  3. Offline

    switorik

    I'm looking more for just simple straight up player+horse teleporting. I don't want any extras. If I type /spawn and I'm on a horse, the horse teleports with me to spawn.
     
  4. Offline

    j1752ss

    I think he means when player types /spawn and they are on the horse they both will be tpd to spawn .. Last time checked if u were on horse and you typed /spawn it will not tp you there
     
  5. Offline

    JRL1004

    For any dev who wants to do this, I pretty much made the code for you:
    Code:java
    1. package horseTeleport;
    2.  
    3. import org.bukkit.entity.Entity;
    4. import org.bukkit.entity.EntityType;
    5. import org.bukkit.entity.Player;
    6. import org.bukkit.event.EventHandler;
    7. import org.bukkit.event.Listener;
    8. import org.bukkit.event.player.PlayerTeleportEvent;
    9.  
    10. public class TeleportListener implements Listener {
    11. @EventHandler
    12. public void onTeleport(PlayerTeleportEvent event) {
    13. final Player player = event.getPlayer();
    14. if(player.getVehicle() == null) return;
    15. final Entity entity = player.getVehicle();
    16. if(entity.getType() != EntityType.HORSE) return;
    17. event.setCancelled(true);
    18. entity.teleport(event.getTo());
    19. player.teleport(event.getTo());
    20. entity.setPassenger(player);
    21. }
    22. }
    23.  

    Just make the main class and register it.
     

Share This Page