Go to file
2021-03-26 22:25:55 +00:00
protocol Detect disconnection and exit the script 2021-03-26 22:25:55 +00:00
.gitignore Rename data module to mcdata 2020-12-14 05:40:17 +00:00
blocks.py Add a job for grabbing supplies from barrels 2020-12-17 00:02:56 +00:00
bot.py Move to our own vector module instead of Panda3D 2021-03-26 22:25:55 +00:00
download_mcdata.sh Rename data module to mcdata 2020-12-14 05:40:17 +00:00
game.py Move to our own vector module instead of Panda3D 2021-03-26 22:25:55 +00:00
items.py Fix trading bugs 2021-02-28 23:33:31 +00:00
jobs.py Pause for 0.5 s when finding a bad crop 2021-03-04 21:17:35 +00:00
LICENSE Initial commit 2020-05-20 15:41:01 -06:00
main.py Add state machine for eating food 2021-01-05 05:57:06 +00:00
mcdata.py Finish executing the villager trade 2021-02-24 01:02:00 +00:00
mobs.py Rename data module to mcdata 2020-12-14 05:40:17 +00:00
monkey_patch.py Detect disconnection and exit the script 2021-03-26 22:25:55 +00:00
path.py Program the bot to crawl, fix wood farming bugs 2021-03-26 22:25:55 +00:00
README.md Add list of commands to readme 2021-03-26 16:22:04 -06:00
requirements.txt Correct pyCraft requirement 2021-01-16 06:30:04 +00:00
test_pycraft.py Rename test script 2020-09-06 15:37:04 -06:00
utils.py Rename data module to mcdata 2020-12-14 05:40:17 +00:00
vector.py Move to our own vector module instead of Panda3D 2021-03-26 22:25:55 +00:00

Minecraft Bot

Setup

Assuming Debian / Ubuntu based distro:

$ sudo apt update
$ sudo apt install build-essential python3 python3-dev python3-pip python3-virtualenv git

$ git clone https://git.tannercollin.com/tanner/minecraft-bot.git
$ cd minecraft-bot/
$ bash download_mcdata.sh
$ virtualenv -p python3 env
$ source env/bin/activate
(env) $ pip install -r requirements.txt

Always make sure the virtual environment is running (env).

Running

(env) $ USERNAME=you@domain.com PASSWORD=supersecret SERVER=example.com python main.py

Commands

Talking to bot (All commands can be found in "game.py" under "public commands", starting around line 494)

Use prefix (in this case, "1") to call to attention before giving command. (EX. 1ping, 1here, etc.)

ping

Will respond "pong" if active and listening

pos

Will respond with current position

afk

Will afk (if not already)

unafk

Will unafk (if afk)

error


inv

Will list inventory (in terminal)

time


count


loaded


players


objects


mobs


monsters


villagers


threats


spiral


sand slice


zzz

Will afk if in overworld, and if not already afk

tree


block


temporary workarounds

Add "?" to line 457, which is "match1 = re.match(r'<(\w+)> (.*)', text)"

It should now look like this "match1 = re.match(r'<?(\w+)> (.*)', text)" This allows the bot to react to commands made by someone else than the creator of code (Tanner6)