From 4752986b204f6d09aaff4a638e9a3e6c641d5333 Mon Sep 17 00:00:00 2001 From: SpreeHertz Date: Sat, 20 Nov 2021 18:37:49 +0530 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8Add=20more=20instructions=20&=20improv?= =?UTF-8?q?e=20on-kick=20callback?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Changelog.md | 5 +++++ index.js | 4 +++- src/events/antiCrash.js | 2 ++ src/events/disconnect.js | 2 ++ src/events/onKick.js | 4 +++- src/events/viewer.js | 2 ++ src/functions/autoEat.js | 2 ++ src/functions/bowPvP.js | 3 +++ src/functions/consume.js | 6 ------ src/functions/killMob.js | 2 ++ src/functions/pvp.js | 2 ++ src/functions/welcome.js | 1 + 12 files changed, 27 insertions(+), 8 deletions(-) delete mode 100644 src/functions/consume.js diff --git a/Changelog.md b/Changelog.md index a1b7121..90197c1 100644 --- a/Changelog.md +++ b/Changelog.md @@ -1,5 +1,10 @@ # Changelogs | Sandmine.js +### November 20th 2021 (v1.0.8) + +1. Added more instructions on code. +2. Improved on-kick callback. + ### November 18th 2021 (v1.0.7) 1. Improved viewer.js. diff --git a/index.js b/index.js index 0a9dade..5525103 100644 --- a/index.js +++ b/index.js @@ -1,3 +1,5 @@ +// Do not modify/delete this file unless you know what you're doing. + const mineflayer = require('mineflayer'); require('dotenv').config(); const chalk = require('chalk'); @@ -6,7 +8,7 @@ const fs = require('fs'); // Log console.log(chalk.blueBright.bold(`Logging into ${process.env.bot_username}...`)); -// creating the bot +// Bot constructor const bot = mineflayer.createBot({ host: process.env.host, port: parseInt(process.env.port), diff --git a/src/events/antiCrash.js b/src/events/antiCrash.js index 8953029..82b3ef9 100644 --- a/src/events/antiCrash.js +++ b/src/events/antiCrash.js @@ -1,3 +1,5 @@ +// Do not delete/modify this file unless you know what you're doing. + const chalk = require('chalk'); const bot = require('../../index'); diff --git a/src/events/disconnect.js b/src/events/disconnect.js index fc725bd..2e1f4ae 100644 --- a/src/events/disconnect.js +++ b/src/events/disconnect.js @@ -1,3 +1,5 @@ +// Do not delete/modify this file unless you know what you're doing. + const bot = require('../../index'); const chalk = require('chalk'); diff --git a/src/events/onKick.js b/src/events/onKick.js index 4471372..74e83b9 100644 --- a/src/events/onKick.js +++ b/src/events/onKick.js @@ -1,6 +1,8 @@ +// Do not delete/modify this file unless you know what you're doing. + const bot = require('../../index'); const chalk = require('chalk'); bot.on('kicked', () => { - console.log(chalk.yellowBright('warn') + chalk.yellow(` ${process.env.bot_username} got kicked/banned from the server, or the server was stopped.`)); + console.log(chalk.yellowBright('warn') + chalk.yellow(` ${process.env.bot_username} got kicked/banned from the server, or the server was stopped. Also, make sure that the bot is whitelisted if you're running this in a public server.`)); }); diff --git a/src/events/viewer.js b/src/events/viewer.js index f6f4ee3..32a3ac3 100644 --- a/src/events/viewer.js +++ b/src/events/viewer.js @@ -1,3 +1,5 @@ +// Do not delete/modify this file unless you know what you're doing. + const mineflayerViewer = require('prismarine-viewer').mineflayer; const bot = require('../../index'); const chalk = require('chalk'); diff --git a/src/functions/autoEat.js b/src/functions/autoEat.js index ee7561b..d3a633e 100644 --- a/src/functions/autoEat.js +++ b/src/functions/autoEat.js @@ -1,3 +1,5 @@ +// Delete this file if you don't want your bot to auto eat food. + const bot = require('../../index'); const autoeat = require('mineflayer-auto-eat'); const chalk = require('chalk'); diff --git a/src/functions/bowPvP.js b/src/functions/bowPvP.js index ceddab1..c54db88 100644 --- a/src/functions/bowPvP.js +++ b/src/functions/bowPvP.js @@ -1,3 +1,6 @@ +// Delete this file if you don't want your bot to bow PvP. + + const bot = require('../../index'); const minecraftHawkEye = require('minecrafthawkeye'); diff --git a/src/functions/consume.js b/src/functions/consume.js deleted file mode 100644 index ccba5ac..0000000 --- a/src/functions/consume.js +++ /dev/null @@ -1,6 +0,0 @@ -const bot = require('../../index'); - - -bot.on('saturation', () => { - bot.consume(); -}); \ No newline at end of file diff --git a/src/functions/killMob.js b/src/functions/killMob.js index 976c936..9a26e1b 100644 --- a/src/functions/killMob.js +++ b/src/functions/killMob.js @@ -1,3 +1,5 @@ +// Delete this file if you don't want your bot to kill a mob. + const bot = require('../../index'); const killMob = require('../../config.json').mobToKill; diff --git a/src/functions/pvp.js b/src/functions/pvp.js index 31e6eff..3df81a8 100644 --- a/src/functions/pvp.js +++ b/src/functions/pvp.js @@ -1,3 +1,5 @@ +// Delete this file if you don't want your bot to PvP you. (normal) + const bot = require('../../index'); const { pathfinder } = require('mineflayer-pathfinder'); const pvp = require('mineflayer-pvp').plugin; diff --git a/src/functions/welcome.js b/src/functions/welcome.js index a57fafe..f73a91c 100644 --- a/src/functions/welcome.js +++ b/src/functions/welcome.js @@ -1,4 +1,5 @@ // Delete this file if you don't want your bot to welcome. + const bot = require('../../index'); bot.once('spawn', () => {