Giter Club home page Giter Club logo

minebot's Introduction

minebot

Minebot is a mod for minecraft that takes control of the player and automatically does tasks for you. It simulates keyboard and mouse input to interact with the word.

Minebot is written to be played on normal minecraft in survival mode. Creative mode and some mods partially work but are not targeted.

The bot is controlled by giving it commands using the chat line. For advanced uses, it can be controlled using simple scripts or the Javascript API.

Have a look at the Getting Started Wiki Page to see how to use the bot.

This repo also contains an independent bow aiming helper.

Download + Installing

Install Forge mod loader.

Get the latest release.

Extract the ZIP file and put the jar files in your minecraft mods directory.

Building

Building Minebot is straight forward. You need linux, git and the normal java development tools.

  • Clone this repo
  • Run ./release.sh
  • Extract that ZIP file in your minecraft mods directory

Developing Minebot

I use eclipse for development. You should know how to set up and use Minecraft Forge.

How to add a new command:

  • Add a new command class and register it in AIChatController. The class needs an AICommand-Annotation. Most commands use "minebot" as base cmmand.
  • At at least one method with an AICommandInvocation-Annotation.
  • Add parameters to that method. Each parameter needs a AICommandParameter-Annotation that is used to generate the help text and tab completion. It can have any supported type (int, enums, color, block, ...) but should not allow ambigious command lines.
  • Implement that method. You can either implement a strategy that should now be used or do the stuff directly in the method.

How to implement a new strategy:

  • Let a new class extend TaskStrategy
  • Implement the search task method. It should search new stuff to do and send the tasks to the passed AIHelper calling it's addTask method. If it does not send any tasks, it is finished.
  • Mind that, due to server lags or other problems, the search method might be called before all previously assigned tasks have been worked on. You should handle this.

How to implement a new searching strategy (the fast way)

  • Extend MovePathfinder. Look at the other examples on how to do it, basically you just have to rate each destination and can add a task that should be done when a destination is reached.
  • Always work on the local world object when pathfinding. This allows the bot to pre-search tasks while it is still working on the old ones.

How to implement a new task:

  • Let a Class extend an AITask
  • Add a isFinished method that returns true if the task is done.
  • Add a runTick method, that is called every tick and should work towards the goal. You will find a lot of helpful methods in the AIHelper.
  • There are many optional methods. Have a look at the AITask documentation.

minebot's People

Contributors

promofaux avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.