Put Player on a Horse ?

Discussion in 'Plugin Development' started by MrOAriO, Jul 2, 2013.

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

    MrOAriO

    I Want to Put a Player on a Horse which has Diamond Armor and a Saddle ?
    How can i do this ?

    My Code to Spawn but it dont work :
    Code:
        public void setHorse(Location location, Player p) {
            World world = location.getWorld();
            Entity horse = world.spawnCreature(location, EntityType.HORSE);
            horse.setPassenger(p);
        }
     
  2. Offline

    Ivan

    horse.setPassenger(player)
     
  3. Offline

    MrOAriO

    My Code to Spawn but it dont work :
    Code:
        public void setHorse(Location location, Player p) {
            World world = location.getWorld();
            Entity horse = world.spawnCreature(location, EntityType.HORSE);
            horse.setPassenger(p);
        }
     
  4. Offline

    Eats_Rainbows

    Code:
    public void setHorse(Player player) {
           
      LivingEntity theHorse = (LivingEntity) player.getWorld().spawnEntity(player.getLocation(), EntityType.HORSE);
      theHorse.setPassenger(player);
           
    }
    I believe this should work, I haven't tested it though.
     
  5. Offline

    MrOAriO

    Caused by: java.lang.IllegalArgumentException: Cannot spawn an entity for org.bukkit.entity.Horse
    Not working i think because the Bukkit API
     
  6. Offline

    add5tar

    I'm also trying this and getting the same problem... anyone know what's going on?
    Bukkit API doesn't support spawning horses? :(
     
  7. Offline

    desht

    CraftBukkit for MC 1.6.1 has only just been released. Meaning you can start up a CraftBukkit 1.6.1 server and have MC 1.6.1 clients connect to it, but don't expect any 1.6 Bukkit API yet. That will come soon enough; either be patient or learn how to contribute to the project.
     
Thread Status:
Not open for further replies.

Share This Page