-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwrapper.js
More file actions
28 lines (28 loc) · 1.02 KB
/
wrapper.js
File metadata and controls
28 lines (28 loc) · 1.02 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
module.exports = (bot) => ({
TEAM_PREFIX: 'Go team: ',
TEAM_SUFFIX: '!',
RESUPPLY_MSG: 'resupply',
colors: ["white", "black", "dark_blue", "dark_green", "dark_aqua", "dark_red", "dark_purple", "gold", "gray", "dark_gray", "blue", "green", "aqua", "red", "light_purple", "yellow"],
findNearestGrass: () => {
//TODO, find nearest Grass using bot
},
findNearestSapling: () => {
//TODO, find nearest Grass using bot
},
findNearestBlock: (id) => {
return bot.findBlock({
point: bot.entity.position,
matching: (block) => {
if (block && (block.type == id)) {
const blockAbove = bot.blockAt(block.position.offset(0, 1, 0))
return !blockAbove || blockAbove.type === 0 //empty space above
}
return false
},
maxDistance: 3
})
},
distance: (v1, v2) => {
return Math.abs(v1.x - v2.x) + Math.abs(v1.y - v2.y) + Math.abs(v1.z - v2.z)
}
})