Skip to content

Commit

Permalink
✨Add more instructions & improve on-kick callback
Browse files Browse the repository at this point in the history
  • Loading branch information
SpreeHertz committed Nov 20, 2021
1 parent 4d871aa commit 4752986
Show file tree
Hide file tree
Showing 12 changed files with 27 additions and 8 deletions.
5 changes: 5 additions & 0 deletions Changelog.md
Original file line number Diff line number Diff line change
@@ -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.
Expand Down
4 changes: 3 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
@@ -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');
Expand All @@ -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),
Expand Down
2 changes: 2 additions & 0 deletions src/events/antiCrash.js
Original file line number Diff line number Diff line change
@@ -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');

Expand Down
2 changes: 2 additions & 0 deletions src/events/disconnect.js
Original file line number Diff line number Diff line change
@@ -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');

Expand Down
4 changes: 3 additions & 1 deletion src/events/onKick.js
Original file line number Diff line number Diff line change
@@ -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.`));
});
2 changes: 2 additions & 0 deletions src/events/viewer.js
Original file line number Diff line number Diff line change
@@ -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');
Expand Down
2 changes: 2 additions & 0 deletions src/functions/autoEat.js
Original file line number Diff line number Diff line change
@@ -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');
Expand Down
3 changes: 3 additions & 0 deletions src/functions/bowPvP.js
Original file line number Diff line number Diff line change
@@ -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');

Expand Down
6 changes: 0 additions & 6 deletions src/functions/consume.js

This file was deleted.

2 changes: 2 additions & 0 deletions src/functions/killMob.js
Original file line number Diff line number Diff line change
@@ -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;

Expand Down
2 changes: 2 additions & 0 deletions src/functions/pvp.js
Original file line number Diff line number Diff line change
@@ -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;
Expand Down
1 change: 1 addition & 0 deletions src/functions/welcome.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// Delete this file if you don't want your bot to welcome.

const bot = require('../../index');

bot.once('spawn', () => {
Expand Down

0 comments on commit 4752986

Please sign in to comment.