mirror of
https://github.com/ChomeNS/chomens-bot-mc.git
synced 2024-11-14 10:44:55 -05:00
completely forgot about refillcore
This commit is contained in:
parent
26fe299201
commit
5579733b6f
2 changed files with 42 additions and 43 deletions
|
@ -5,6 +5,6 @@ module.exports = {
|
|||
usage: '',
|
||||
trusted: 0,
|
||||
execute: function(bot) {
|
||||
bot.core.fillCore();
|
||||
bot.core.loopPlace();
|
||||
},
|
||||
};
|
||||
|
|
|
@ -52,6 +52,45 @@ function inject(bot) {
|
|||
return;
|
||||
}
|
||||
},
|
||||
async loopPlace() {
|
||||
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:'{"text":"ChomeNS Bot Core","color":"yellow"}'}`;
|
||||
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),
|
||||
})}),
|
||||
},
|
||||
});
|
||||
await sleep(50);
|
||||
bot.write('block_dig', {
|
||||
status: 0,
|
||||
location,
|
||||
face: 1,
|
||||
});
|
||||
await sleep(50);
|
||||
bot.write('block_place', {
|
||||
location,
|
||||
direction: 1,
|
||||
hand: 0,
|
||||
cursorX: 0.5,
|
||||
cursorY: 0.5,
|
||||
cursorZ: 0.5,
|
||||
insideBlock: false,
|
||||
});
|
||||
|
||||
fillCore();
|
||||
} catch (e) {
|
||||
return;
|
||||
}
|
||||
},
|
||||
// fillCore(useCore) {
|
||||
// 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:'{"text":"ChomeNS Bot Core","color":"yellow"}'}`;
|
||||
// if (useCore==true) {
|
||||
|
@ -98,49 +137,9 @@ function inject(bot) {
|
|||
// core.fillCore();
|
||||
}
|
||||
|
||||
async function loopPlace() {
|
||||
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:'{"text":"ChomeNS Bot Core","color":"yellow"}'}`;
|
||||
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),
|
||||
})}),
|
||||
},
|
||||
});
|
||||
await sleep(50);
|
||||
bot.write('block_dig', {
|
||||
status: 0,
|
||||
location,
|
||||
face: 1,
|
||||
});
|
||||
await sleep(50);
|
||||
bot.write('block_place', {
|
||||
location,
|
||||
direction: 1,
|
||||
hand: 0,
|
||||
cursorX: 0.5,
|
||||
cursorY: 0.5,
|
||||
cursorZ: 0.5,
|
||||
insideBlock: false,
|
||||
});
|
||||
|
||||
fillCore();
|
||||
} catch (e) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
loopPlace();
|
||||
bot.core.loopPlace();
|
||||
const interval = setInterval(() => {
|
||||
loopPlace();
|
||||
bot.core.loopPlace();
|
||||
}, config.core.refillInterval);
|
||||
|
||||
return core;
|
||||
|
|
Loading…
Reference in a new issue