diff --git a/plugins/core.js b/plugins/core.js index fcbf100..baf7a16 100644 --- a/plugins/core.js +++ b/plugins/core.js @@ -1,7 +1,6 @@ /* eslint-disable max-len */ /* eslint-disable require-jsdoc */ const nbt = require('prismarine-nbt'); -const sleep = require('sleep-promise'); const Vec3 = require('vec3'); const relativePosition = new Vec3(0, 0, 0); @@ -58,26 +57,29 @@ function inject(bot, dcclient, config) { 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 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', { slot: 36, item: { present: true, itemId: mcData.itemsByName['repeating_command_block'].id, itemCount: 64, - nbtData: nbt.comp({BlockEntityTag: nbt.comp({ - Command: nbt.string(fillCommand), - auto: nbt.byte(1), - TrackOutput: nbt.byte(0), - })}), + nbtData: nbt.comp({ + BlockEntityTag: nbt.comp({ + Command: nbt.string(fillCommand), + auto: nbt.byte(1), + TrackOutput: nbt.byte(0), + }), + }), }, }); - await sleep(50); + bot.write('block_dig', { status: 0, location, face: 1, }); - await sleep(50); + bot.write('block_place', { location, direction: 1,