Sandmine.js is a simple minecraft bot, with several cool functions, all made with JavaScript.
Contributions are always welcome! You can open a pull request by clicking here.
- Usage/Features
- Credits
- License
- Changelogs
- Docs
- Step 1: Installation
- Step 2: Opening LAN World
- Step 3: Configuration
- Step 4: Start the bot
- Errors and how to fix them
- Auto-eats if you give it appropriate food.
- Consumes stuff.
- Kills a mob when in a particular radius.
- Looks at nearest player.
- Pathfinds the player and gets as close as possible if a player says "
follow me
" and stops if you say "stop
". - PvP you if you say "
fight me
" and stops if you say "stop
". - Bow fights you.
This bot is made possible with mineflayer and its other packages.
This project is licensed under the GPL General Public License v3.0. See the LICENSE file for details.
View Changelog.md.
You can make your own version of Sandmine.js. Please read the docs fully so that you understand what's happening, and to reduce the amount of errors you may run into. See the web version of the documentation at https://sandmine.js.org
Also, it would be appreciated if you credit me.
Install VSCode (or any other IDE you like), Git, and Node.js.
If you're planning to make a local connection, you must follow this step.
-
Open Minecraft and open your Single player world.
-
You'll now see a new message pop up on your Minecraft chat specifying the port. Please note it, and make sure that you do NOT copy mine since it's different for everyone.
Open Visual Studio Code, open a folder, and do:
git clone https://github.com/SpreeHertz/Sandmine.js.git
then do:
cd Sandmine.js-master
- Go to
.env.example
, and specify the port that I told you to note in the previous subtopic. (Please note that the port always changes when hosting locally everytime you start up your LAN server.) - For
host=
, Give itlocalhost
if you're hosting locally. - Finally, rename
.env.example
to.env.
Go to config.json
. There are some values you'll see. Here's what they do:
playerToLook
- This is the player that the bot should look at. Default is SpreeHertz
, please change it to your Minecraft in game name.
mobToKill
- When the bot sees this particular mob, it will start killing it. If you don't want this feature, you can leave this value empty.
In order to start the bot, open a New Terminal by clicking on Terminal
(top) > New Terminal.
(Required) Install the dependencies by doing:
npm install
(Required) Then do this to start your bot:
node .
(Optional/Preference) For testing purposes, you can do:
npm run test
(Optional) To check if there are any code formatting / code styling issues, you can do:
npm run lint
And there you go! Your bot should be working properly by now.
If you see a connect ECONNREFUSED
error, it means that the IP address and/or port that you specified in your .env
file might be wrong.
When doing npm run test
, you might see this:
[nodemon] clean exit - waiting for changes before restart
This occurs when the bot crashes immediately (most probably because of the ECONNREFUSED error).
- Make sure that you have done
npm i
ornpm install
. - Make sure you have Node.js installed. It should be v14 or higher.
- Make sure you have
cd foldername
. You want your terminal to go inside the folder where you've cloned Sandmine.js. - Make sure you haven't deleted any main files like
index.js
orsrc/events
. If you don't really have much knowledge of JavaScript, it's recommended that you just delete files fromsrc/functions
folder to turn off particular functions, unless you know what you're doing.
Are you seeing an error that is not mentioned in this Readme? Well, you should report it by clicking here. I'd be more than happy to help, and there might be others that are down to help you as well.
minecraft, minecarft bot, minecraft pathfinder, minecraft javascript bot, minecraft js, minecraft easy to use bot