Compare commits
4 Commits
8e719d5ccf
...
6b71de0356
Author | SHA1 | Date | |
---|---|---|---|
|
6b71de0356 | ||
|
96214ffe37 | ||
|
034f8d331a | ||
|
69d0f5830d |
|
@ -196,7 +196,14 @@ function command(username, message) {
|
||||||
subcommand("go follow " + message_parts.slice(2).join(" "))
|
subcommand("go follow " + message_parts.slice(2).join(" "))
|
||||||
break;
|
break;
|
||||||
case "come":
|
case "come":
|
||||||
|
switch (message_parts[1]) {
|
||||||
|
case "close":
|
||||||
|
case "closer":
|
||||||
|
subcommand("go follow close")
|
||||||
|
break
|
||||||
|
default:
|
||||||
subcommand("go follow once")
|
subcommand("go follow once")
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
case "move":
|
case "move":
|
||||||
case "go":
|
case "go":
|
||||||
|
@ -252,11 +259,14 @@ function command(username, message) {
|
||||||
cfg.plugins.mover.follow(bot.nearestEntity())
|
cfg.plugins.mover.follow(bot.nearestEntity())
|
||||||
break
|
break
|
||||||
case 1:
|
case 1:
|
||||||
|
let dist = 3
|
||||||
switch (message_parts2[0]) {
|
switch (message_parts2[0]) {
|
||||||
|
case "close":
|
||||||
|
dist = 1
|
||||||
case "me":
|
case "me":
|
||||||
case "once":
|
case "once":
|
||||||
if (player) {
|
if (player) {
|
||||||
cfg.plugins.mover.follow(player, message_parts2[0] !== "once")
|
cfg.plugins.mover.follow(player, message_parts2[0] === "me", dist)
|
||||||
} else {
|
} else {
|
||||||
cfg.quiet || bot.chat("can't see you")
|
cfg.quiet || bot.chat("can't see you")
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,10 +2,10 @@ let cfg
|
||||||
let bot
|
let bot
|
||||||
let mcData
|
let mcData
|
||||||
|
|
||||||
function info() {
|
function block() {
|
||||||
const block = bot.blockAtCursor()
|
const block = bot.blockAtCursor()
|
||||||
console.log(block)
|
console.log(block)
|
||||||
cfg.quiet || bot.chat([block.id, block.name])
|
cfg.quiet || bot.chat([block.type, block.name].join(": "))
|
||||||
}
|
}
|
||||||
|
|
||||||
const load = (config) => {
|
const load = (config) => {
|
||||||
|
@ -19,4 +19,4 @@ const load = (config) => {
|
||||||
|
|
||||||
const unload = () => {}
|
const unload = () => {}
|
||||||
|
|
||||||
module.exports = { load, unload, info }
|
module.exports = { load, unload, block }
|
|
@ -37,7 +37,7 @@ function moveNear(pos, distance = 3) {
|
||||||
bot.pathfinder.setGoal(new GoalNear(pos.x, pos.y, pos.z, distance))
|
bot.pathfinder.setGoal(new GoalNear(pos.x, pos.y, pos.z, distance))
|
||||||
}
|
}
|
||||||
|
|
||||||
function follow(entity, dynamic = true) {
|
function follow(entity, dynamic = true, distance = 3) {
|
||||||
console.assert(entity)
|
console.assert(entity)
|
||||||
const { GoalFollow } = require('mineflayer-pathfinder').goals
|
const { GoalFollow } = require('mineflayer-pathfinder').goals
|
||||||
|
|
||||||
|
@ -53,7 +53,7 @@ function follow(entity, dynamic = true) {
|
||||||
// console.log(entity)
|
// console.log(entity)
|
||||||
|
|
||||||
bot.pathfinder.setMovements(movements.defaultMove)
|
bot.pathfinder.setMovements(movements.defaultMove)
|
||||||
bot.pathfinder.setGoal(new GoalFollow(entity, 3), dynamic)
|
bot.pathfinder.setGoal(new GoalFollow(entity, distance), dynamic)
|
||||||
}
|
}
|
||||||
|
|
||||||
function hit(blockOrEntity) {
|
function hit(blockOrEntity) {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user