core fix(?) + remove / from fill command

This commit is contained in:
ChomeNS 2023-01-10 09:37:38 +07:00
parent 3199b5f696
commit 37b6aa341b

View file

@ -7,6 +7,8 @@ const relativePosition = new Vec3(0, 0, 0)
function inject (bot, dcclient, config) { function inject (bot, dcclient, config) {
const mcData = require('minecraft-data')(bot.version) const mcData = require('minecraft-data')(bot.version)
const core = { const core = {
start: new Vec3(null, null, null),
end: new Vec3(null, null, null),
isCore (position) { isCore (position) {
return position.x >= core.start.x && position.x <= core.end.x && position.y >= core.start.y && position.y <= core.end.y && position.z >= core.start.z && position.z <= core.end.z return position.x >= core.start.x && position.x <= core.end.x && position.y >= core.start.y && position.y <= core.end.y && position.z >= core.start.z && position.z <= core.end.z
}, },
@ -58,7 +60,7 @@ function inject (bot, dcclient, config) {
function placeCore () { function placeCore () {
try { try {
const fillCommand = `/minecraft:fill ${core.start.x} ${core.start.y} ${core.start.z} ${core.end.x} ${core.end.y} ${core.end.z} command_block{CustomName:'${JSON.stringify(config.core.customName)}'}` const fillCommand = `minecraft:fill ${core.start.x} ${core.start.y} ${core.start.z} ${core.end.x} ${core.end.y} ${core.end.z} command_block{CustomName:'${JSON.stringify(config.core.customName)}'}`
const location = { x: Math.floor(bot.position.x), y: Math.floor(bot.position.y) - 1, z: Math.floor(bot.position.z) } const location = { x: Math.floor(bot.position.x), y: Math.floor(bot.position.y) - 1, z: Math.floor(bot.position.z) }
bot.write('set_creative_slot', { bot.write('set_creative_slot', {