The idea behind this project was to develop a bot able to recognize and cut down trees using computer vision.
This project is extremely experimental and far away from working flawlessly
- Language:
- Also available in:
Prerequisites
First and foremost, you need a python based integrated development environment, such as Spyder or Pycharm.
Then, you will need to install PyAutoGui, OpenCV and a few other libraries.
In order to do so, open up your IDE's terminal and type the next commands:
pip install pyautogui
pip install opencv-contrib-python
pip install pydirectinput
pip install keyboard
You will need, of course, a copy of Minecraft.
Create a new world, join and open up the configuration menu. Go to Controls, then Mouse Settings and check the Raw Input option. It must be OFF.
You need to run the game in fullscreen, otherwise the script won't work.
Now you are ready to try out this project! Enjoy!
It starts by taking a screenshot of your screen. Aided by opencv, the script detects every pixel related to the color of a tree.
If the amount of pixels/area is bigger or smaller than a certain number, many things could happen:
- The player keeps moving forward.
- The player moves to the left.
- The player moves to the left.
- The player starts cutting down a tree.
- PyAutoGui - Python module for human beings. Used to programmatically control the mouse & keyboard.
- opencv - Computer Vision library and tools.
- PyDirectInput - Similar to PyAutoGui.
- Keyboard
- Juan Manuel Díaz Arbués