Hello, i would like to create a mini-game with a llama. The player will spawn on a llama and will control it. But, i don't understand how a player can control a llama like an horse. Thanks for your help !
https://hub.spigotmc.org/javadocs/s...y.html#addPassenger-org.bukkit.entity.Entity- Entity.addPassenger(Entity) Where the first entity is the llama and the second entity is the player.
@elian1203 The problem is llamas are not controllable in the base game. That will let them ride the entity, but the player will have no control over its movements. @Spadax You need to dig into the llama's NMS code and change it so it is controllable. Since NMS is quite complicated, and there are no current tutorials for llamas, I would only recommend you do this if you have already had experience writing NMS.
Hello @Zombie_Striker , i haven't got an experience in bukkit NMS, it's the probleme and yes, i didn't find a tutorial with the llama. Have you got an idea ?
Maybe one way, not as complicated as making llamas "controllable" but you would still need to get NMS under your skin. If speed is not a factor, eg no stopping or going, just running around in the direction your player is facing, you could tell the llama to walk to a certain location based on the direction a player is facing. There's an example of the method deep in the bowels of my computer systems, but I'd reckon you'll find the method pretty quick out there on the Internet. Good luck
@Spadax it does not matter which entity you want to make ridable. in the end you have to copy the movement methods of EntityHorseAbstract anyway. I have tried to make a cow ridable for 1.12.1 once but it was a mess. It is not that easy