-
-
Notifications
You must be signed in to change notification settings - Fork 361
Expand file tree
/
Copy pathbot.js
More file actions
41 lines (39 loc) · 1.27 KB
/
Copy pathbot.js
File metadata and controls
41 lines (39 loc) · 1.27 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
const mineflayer = require('mineflayer');
console.log('Starting...')
function createBot () {
const bot = mineflayer.createBot({
host: "localhost",
port: "fannym.aternos.me:21437"
username: "24ATERNOSBOT",
version: false
})
bot.on('login', function() {
bot.chat('/reginster 123123123 123123123')
bot.chat('/login 123123123 123123123')
})
bot.on('chat', (username, message) => {
if (username === bot.username) return
switch (message) {
case ';start':
bot.chat('24 ATERNOS > Bot started! - Made By Fortcote')
bot.setControlState('forward', true)
bot.setControlState('jump', true)
bot.setControlState('sprint', true)
break
case ';stop':
bot.chat('24 ATERNOS > Bot stoped! - Made By Fortcote')
bot.clearControlStates()
break
}
})
bot.on('spawn', function() {
bot.chat('Bot > Spawned')
})
bot.on('death', function() {
bot.chat('Bot > I died, respawn')
})
bot.on('kicked', (reason, loggedIn) => console.log(reason, loggedIn))
bot.on('error', err => console.log(err))
bot.on('end', createBot)
}
createBot()