sefirosweb / minecraftLegion

Legion of bots for minecraft
45 stars 9 forks source link

MinecraftLegion

Minecraft multipurpose bot

This project are based on mineflayer & PrismarineJS repository

What can does the bot?

All of them are based on jobs, and you must be configure with web UI

Watch the videos so you can see what it can do for you

https://www.youtube.com/watch?v=QIz6o7cJITg&list=PLPwIRDkD3kwSdQ04LnzcGrLrlST9XoKjk&index=5

Basic usage of commands in chat:

There only are the basic commands for full manage you must need to use a web UI

First, activate the bot attention "hi namebot" or "hi all" to start all bots simultaneously.

Make the bot/s follow you.

Make the bot/s stand in the current position.

to finish commands

Current Jobs

Installation

Manual:

  1. Clone or download the repositorio git clone https://github.com/sefirosweb/minecraftLegion.git && cd minecraftLegion/
  2. Auto Install all the dependencies and build them npm run build
  3. Go to server folder and create .env file with password

Example:

SERVER=localhost
PORT=25565
MASTERS=player1,player2
WEB_SERVER=http://localhost
WEB_SERVER_PORT=4001
WEB_SERVER_PASSWORD=admin
DEBUG_MODE=false
CUSTOM_START=false
AUTO_RESTART=true
ENVIRONMENT=prod

To update the bot execute git pull and npm run build

  1. Start all: npm start

With docker

Create .yml file and pull the container

Example of docker-compose.yml file:

version: "3"
services:
  app:
    image: ghcr.io/sefirosweb/minecraft-legion:latest
    environment:
      SERVER: host.docker.internal # Minecraft Server // "localhost" in reality is host.docker.internal 
      PORT: 25565 # Minecraft Port
      MASTERS: player1,player2 # Names of master players, separated with comma
      WEB_SERVER_PASSWORD: admin # Password to login into front end
      AUTO_RESTART: true # If bot crashes they auto reload again
      CUSTOM_START: false # If you want to do some actions before start bot, you can put here your own custom.js file (used for logging into servers)
      SECRET_TOKEN: input_here_random_text # This token is used to encrypt your session, must be randomnly and dont share it

    volumes:
      - "./botConfig:/app/core/botConfig" # Folder on saved bot configuration
      - "./custom_start:/app/core/custom_start" # Folder is execute custom start before start bot
      - "./db:/app/db" # This file stored session info and all bot config

    ports:
      - "80:80" # Web port
      - "4500-4550:4500-4550" # Ports used to attach viewers

Need to do actions before start bot?

If you need to do some actions before start bot for example login, or move into some hall you can do this:

1º) In .env file change to true the variable: CUSTOM_START

2º) On start bot they create automatically a folder with file: custom_start\custom.js

There put all you need to do before bot starts, the function "starts" must be return a promise, when the promise is resolve all bot behavior configuration will be started

TODO

Please keep calm. I'm working hard on this project :D