Basic configuration system

main
Andrea Santaniello 2 years ago
parent 2a4beaabf8
commit a40dce9a13
  1. 2
      README.md
  2. 12
      config.json
  3. 14
      index.js

@ -16,7 +16,7 @@ This project aims to be a a persistent proxy and a bot for Minecraft servers (mo
* Right now the bot is developed for 1.12.2, i could work even on newer and older versions, hover due to the use of version specific packets some features need or might need tweaks to work in versions different than 1.12.2
## To-Do
* Configuration system
* ~Configuration system~ done
* A better command system/modular plugins (right now commands gets also passed to the server)
* Handling of crashes, disconnects, kicks, ban and reboots
* Webhook notifications to Discord or other services

@ -0,0 +1,12 @@
{
"client": {
"username": "",
"password": "",
"host": "",
"port": "",
}
"server": {
"host_bind": ""
"port": ""
}
}

@ -1,7 +1,7 @@
var mineflayer = require('mineflayer')
const mc = require('minecraft-protocol');
var autoeat = require("mineflayer-auto-eat")
var botConfig = require('./config.json')
var config = require('./config.json')
const cachePackets = require('./cachePackets.js');
var proxyClient; // This is the real client (java)
@ -21,8 +21,8 @@ function run()
server = mc.createServer({
'online-mode': true,
encryption: true,
host: '0.0.0.0',
port: 25565,
host: config.server.host_bind,
port: config.server.port,
version: "1.12.2",
'max-players': maxPlayers = 1,
'motd': "§cl§6u§eh§af§9'§bs§5 §ca§6f§ek§a §9p§br§5o§cx§6y§e §as§9e§br§5v§ce§6r"
@ -30,10 +30,10 @@ function run()
log("Starting mineflayer client");
bot = mineflayer.createBot({
host: "",
port: 25565,
username: "",
password: "",
host: config.client.host,
port: config.client.port,
username: config.client.username,
password: config.client.password,
plugins: {
physics: false
},

Loading…
Cancel
Save