Solved How to make that when I get right click for a horse & wrote a command it gets mine?

Discussion in 'Spigot Plugin Development' started by DickPig396, Jun 13, 2021.

  1. I making it for an mmo horses (it won't be like a popular plugin) and your help will be the great fo' me
     
  2. Make a HashMap<Player, Horse>, then listen to PlayerInteractEvent. If the player clicks a horse, add them into a hashmap, and on command check if the player is in a hashmap. If it is, do your thing (tame the horse with code). It's Horse#setOwner(AnimalTamer at), use it like Horse#setOwner(YourPlayer)). Also you probably will have to do Horse#setTamed(true) after that, but idk if it is necessary. You might want to also use Horse#setPassenger(YourPlayer) and somehow give the horse a saddle later, I think you'll do it yourself
     
    #2 ZBLL, Jun 13, 2021
    Last edited: Jun 13, 2021
    • Winner Winner x 1
  3. Could You please help me with a listening to these?
     
  4. Да и так пойму)
     
  5. написал)