Controllable Mobs API
Welcome to the API which lets you take full control of (nearly) any entity!
This project has been discontinued!
Features
- order an entity to move or look at specified locations, jump, wait, die, follow or attack custom targets
- fully take control of an entity by planning actions that are added to an action queue
- modify the AI of any entity - remove default behaviors or add custom ones!
- configure custom behaviors with various parameters
- modify an entity's attributes (movement speed, attack damage, ...)
- standalone plugin - just add a dependency and updating will be done in no time.
- Bukkit-friendly API - you don't have to deal with Craftbukkit code or native minecraft server code.
- server-only mod - does not require client modifications
API tutorials
work-in-progress (is not being maintained atm)
- The basics (creating a plugin, spawning entities, creating actions)
API Documentation
- Setting up a plugin with Controllable Mobs API
- Basic steps
- Make entities controllable
- Adjust attributes
- Modifying AI behaviors
- Managing entity actions
- Some examples
API resources
- Latest javadoc
- Javadoc for v5
- Javadoc for v4
- API source code at GitHub
- Test plugin source code at GitHub
Important notes
Got any problems?
- Make sure you are using the correct plugin, matching your Minecraft server's version.
- Search the tickets for an error similar to yours, if it is already existing, do not post a new ticket. Instead, post a comment to the existing ticket.
- If the problem hasn't been reported yet, Open a new ticket. Provide as many information as possible. I won't handle issues posted as comments.
Want new features?
I can always provide more features, as needed! You just have to open a new ticket. Provide as many details as possible. I won't handle feature requests posted as comments.
@rimidalv111
You can fix it by extending distance with this method:
@rimidalv111
Thats no bug. Minecraft limits the range to 16
Am I the one who isn't able to control some monsters? Ticket link.
I'm using the latest API to control a horse and make it follow a player, and stop following it once the player rides it. That's all.
I get this error/crash preiodically: http://pastebin.com/nMFY4yaY
EDIIT
After inserting a small amount of code into the canStart() method in PathfinderGoalAIMonitor, I tried to recreate the null pointer exception.
I spawned my horse and attached a lead to it, and while leading the horse through the water, the canStart() method was called, and the error message I inserted was displayed. The simple null check I inserted seems to work for now, with no bugs/errors thrown while using the horse.
Current PathfinderGoalAIMonitor.java I'm using: https://gist.github.com/thoosequa/a3d3a96994641a878fd8
Curious as to whether you can control horses with this.
What about controlling a horse/pig when a player is riding it?
@DevCybran
Cybran found a bug in targetNearest, after they target a player and move to you, if you move 16 blocks away from them they will just stand still and not target anyone unless that player is again 16 blocks (or less) away from the entity.
Hey, you seem like a very good person and I hear that you are under alot of stress and/or have no time to continue this code
Could you make a small tutorial on mod behaviour somewhere so people could learn from making this less dependent on 1 man? I would really apriciate it as a am a coder that has been stuck on this for awhile plus it would take some stress off you.
Thanks for your amazing plugin.
@DevCybran
<3
API updated for 1.6.2
All update processes finished. You can now access the following:
I wish you good luck and a lot of fun with 1.6.2 :)
Please note that I don't have enough time to update the documentation right now. I will be busy during exam time next weeks, so you have to rely on the javadoc. But most of the new methods are pretty self-explanatory.
@DevCybran
Thank the heavens
Great news!
I completed the source code update for 1.6.2 now, all functions should be up and running! This is quite a big update, I added a completely new attribute API, some helpful methods for AI controlling and some major and many minor bugfixes.
Now working on the javadoc, I will upload the results when it's done!
However, I simply don't have the time to test all possible AI behaviors. So, if you meet any bugs, wish them a good day and send them over here by creating a ticket!
@bartjelol1
Change hash map from public HashMap<ControllableMob, Player> zombieMap; to public HashMap<Entity, Player> zombieMap; and add only the entity not the ControllableMob<Zombie> so: Zombie zombie = pos.getWorld().spawn(pos, Zombie.class); here goes your zombie AI edit ControllableMob<Zombie> cZombie = ControllableMobs.assign(zombie, true); blah blah zombieMap.put(zombie, player);
@DevCybran
Yo get on skype some time so we can chat (or pm on here), and if you need some help im up for it.
@superpeanut911
I have spent some time to go through the nms code today and have set up the base classes for a new attribute API! The new system provides great new options, but is rather complex, so it will take more time to for a successfull API integration. I am busy tomorrow, so.. if everything goes well, it might be done until monday.
@DevCybran
Any ETA? This plugin is a huge part of my server right now :P
Update:
I am currently working on an update for Minecraft 1.6.2. Entity AI controlling is already done, but due to changed entity inheritance updating the actions is a bit more complicated. Also, entities have new attribute objects - this is very interesting, because it maybe allows to access more properties and modify them at runtime! However, the old attribute variables are gone and I have to completely rework everything related to custom movement speed.
Also, I have managed to successfully set up a local repository and will try to push changes to github once updating for 1.6.2 is complete.
@themuteoneS
Of course it is!
@hatchcatch020
This API will break with every new Minecraft version, you will have to wait for an update :(
Since a lot of stuff changed in 1.6.1, it isn't done in just a few minutes...
Will this work with 1.6.1 or will we have to wait for you to post an update ?
Would it be ok if I have my plugin in development download your library from here?
@Ugleh
You need to actually have ControllableModsApi.jar inside your plugins folder. Also, make sure in your plugin's "plugin.yml" you have: "depend: [ControllableMobsAPI]"