代码拉取完成,页面将自动刷新
const mineflayer = require('mineflayer')
const { pathfinder, Movements, goals } = require('mineflayer-pathfinder')
const pvp = require('mineflayer-pvp').plugin
const bot = mineflayer.createBot({
host: "mc.icraft.cc",
username: "_chater",
port: 49282,
version: "1.16.5",
})
bot.loadPlugin(pathfinder)
bot.loadPlugin(pvp)
bot.on('chat', (username, message) => {
if (message === 'fight me') {
const player = bot.players[username]
if (!player) {
bot.chat("I can't see you.")
return
}
bot.pvp.attack(player.entity)
}
if (message === 'stop') {
bot.pvp.stop()
}
})
function chat_to_game(msg)
{
bot.once('spawn', () => { chater.chat(msg) })
}
bot.on('message', (message) => {
console.log(message.toAnsi())
})
bot.on("login", (login) =>{
chat_to_game("/l tt5566tt")
})
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。