Ride and control an animal?

Discussion in 'Plugin Development' started by robbertie, May 9, 2014.

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

    robbertie

    Hi guys,

    I have a question because I am working on a plugin that allows you to ride on for example a chicken, so I want to make it possible to execute a command for example /ride and then it will spawn a chicken and your player will ride on it and you can control it.
    How can I do this?

    Thanks,
    Robbert
     
  2. Offline

    xTigerRebornx

    robbertie Well, there is WASD controls https://forums.bukkit.org/threads/tutorial-1-7-5-wasd-entity-riding.163019/
    and there is simply setting the velocity (such as having an item that acts as a 'steering wheel' and when you right click it it'll set the velocity, but this would require some calculations)
    Thats for controlling

    For spawning, simply use World#spawnEntity(), casting it to Chicken, then setting its passenger to the Player.
     
    jthort likes this.
  3. Offline

    robbertie

    Thanks! It looks kinda difficult, but I will have a look into it.
    One thing when I try to set the Chickens passenger to player it doesn't work..
     
Thread Status:
Not open for further replies.

Share This Page