Help making animals rideable

Discussion in 'Plugin Development' started by Tiger24, May 5, 2021.

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

    Tiger24

    I was wondering if there is a way to make any mob rideable and be able to control them using spigot/bukkit in eclipse.
    I've seen people riding and controlling the ender dragon and riding other animals using command blocks but is there a way to do this to all animals automatically when you load the world using eclipse. I tried to use the entity.getpassengers but 1. I don't know if this will even work and 2. it does not let me add an entity (player) to the passengers list.
    If I can't use eclipse could I make my own mod?
     
    Last edited: May 5, 2021
  2. Offline

    Kars

    You can execute commands from code. Why not do it that way?
     
  3. Offline

    KarimAKL

    @Tiger24 Use Entity#addPassenger(Entity) to add a passenger to the entity, do not modify the list directly as it is likely a copy.

    Also, Eclipse is just your IDE. It does not affect how your code works.
     
    davidclue likes this.
  4. Offline

    Tiger24

    Do you know if it is possible to add a Player to an entity as a passenger using this?
    Sorry I am quite new to plug-ins but am trying to learn to do it myself :)
     
    Last edited: May 5, 2021
  5. Offline

    KarimAKL

    That is what the method exists for. You should test it. :)

    It is fine. We all start somewhere. :p
     
  6. Offline

    Tiger24

    Ok thanks! I'll test it out.
     
Thread Status:
Not open for further replies.

Share This Page