Solved Horse Mount

Discussion in 'Plugin Development' started by king_of_all96543, Jan 1, 2014.

Thread Status:
Not open for further replies.
  1. Hello guys i am trying to figure out the event for when a player mounts a horse. I honestly dont know this i googled it but i couldnt find it. If you can help me that would be great! Thank you.
  2. Offline


  3. Gater12 Im not sure but i will check it out thanks.
    Edit: Thanks i believed that worked, but just to make sure i check if the Vehicle is a horse with this right?
        public void onHorse(VehicleEnterEvent e){
            Entity h = e.getVehicle();
            Player p = (Player) e.getEntered();
                    p.sendMessage(ChatColor.RED + "You are not a rider, you may not ride this horse!");
  4. Offline


    @king_of_all96543 VehicleEnterEvent​
  5. Forseth11 Thanks for confirming the event for me. Just to make sure is the code i gave up above the correct way to check if its a horse?
  6. Offline


    king_of_all96543 Mostly. You need to make sure the rider is a player before implementing 'p'.
  7. Offline


  8. Offline


    You can also do
    1. if(h instanceof Horse)
    Gater12 likes this.
Thread Status:
Not open for further replies.

Share This Page