I have been playing around with the latest Tekkit Classic.
I want to be able to have other players running around my world that are controlled by A.I.
I would like them to have pretty much all the capabilities of a real player: mining, building, eating, dieing, equipping and using items and tools, carts etc
I was wondering what has been done in this area? and how I might go about doing it myself? I have not looked into modding minecraft before, but I am a fairly experienced coder with experience writing a.i. for games.
An interface where I can somehow detect and process the world around the player and then send input for that player is all I need.
I dont know if some sort of mechanism exists to do this in a single player game, (with default modding apis or via 3rd party frameworks), or whether the approach of creating a multiplayer game and creating bots is a better way to approach it.
I realize that this is a stab in the dark so any vague hints/comments/insults are welcome.
Generally though AI is usually fairly specific to what you want to do and it is hard to get much code that does exactly what you want already. Like you mentioned, you just need the entity to "sense its surroundings" and then change it's AI state based on those surroundings. Just break the problem down into smaller pieces. The built-in AI task system is fairly clever as it uses mutex bits to prevent some AI from running simultaneously, and also uses a priority system. I have a tutorial on it here: http://jabelarminecraft.blogspot.com/p/minecraft-forge-1721710-custom-entity-ai.html
Basically the entity's AI state is embodied by the AI task it is currently running. Each AI task has a shouldExecute() and continueExecuting() method in which you'd put your "sensing". For example, in the shouldExecute() for an AI task for building a house you might want to check to see if it has enough materials and also whether it has already built a house close by. In the actual execution, you would set a position target and get a path to get there. When it reaches the end of the path, it would do what you want -- place a block, break a block, etc.
net. minecraft . entity.ai is the best place to start imo
Rollback Post to RevisionRollBack
I have made an unofficial port of the spectacular ExRollerCoaster mod, updated for Minecraft 1.12.2.
Build wonderful roller coasters which can go in ANY direction, and the camera will twist and turn with you.
I'm not releasing it through the usual channels but I hope four years on this site makes me a trustworthy modder.