mirror of
https://github.com/kolbytn/mindcraft.git
synced 2025-08-30 19:03:03 +02:00
Merge branch 'main' into join-auto-detect
This commit is contained in:
commit
e68069542b
3 changed files with 12 additions and 1 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -1,4 +1,5 @@
|
||||||
.vscode/
|
.vscode/
|
||||||
|
.idea/
|
||||||
node_modules/
|
node_modules/
|
||||||
package-lock.json
|
package-lock.json
|
||||||
code_records/
|
code_records/
|
||||||
|
|
|
@ -91,6 +91,12 @@ export class Agent {
|
||||||
|
|
||||||
this.bot.on('login', () => {
|
this.bot.on('login', () => {
|
||||||
console.log('Logged in!');
|
console.log('Logged in!');
|
||||||
|
|
||||||
|
// Set skin for profile, requires Fabric Tailor. (https://modrinth.com/mod/fabrictailor)
|
||||||
|
if (this.prompter.profile.skin)
|
||||||
|
this.bot.chat(`/skin set URL ${this.prompter.profile.skin.model} ${this.prompter.profile.skin.path}`);
|
||||||
|
else
|
||||||
|
this.bot.chat(`/skin clear`);
|
||||||
});
|
});
|
||||||
|
|
||||||
this.bot.once('spawn', async () => {
|
this.bot.once('spawn', async () => {
|
||||||
|
@ -100,7 +106,7 @@ export class Agent {
|
||||||
|
|
||||||
// wait for a bit so stats are not undefined
|
// wait for a bit so stats are not undefined
|
||||||
await new Promise((resolve) => setTimeout(resolve, 1000));
|
await new Promise((resolve) => setTimeout(resolve, 1000));
|
||||||
|
|
||||||
console.log(`${this.name} spawned.`);
|
console.log(`${this.name} spawned.`);
|
||||||
this.clearBotLogs();
|
this.clearBotLogs();
|
||||||
|
|
||||||
|
|
|
@ -41,6 +41,10 @@ class MinecraftData {
|
||||||
bot.loadPlugin(collectblock);
|
bot.loadPlugin(collectblock);
|
||||||
bot.loadPlugin(autoEat);
|
bot.loadPlugin(autoEat);
|
||||||
bot.loadPlugin(armorManager); // auto equip armor
|
bot.loadPlugin(armorManager); // auto equip armor
|
||||||
|
bot.once('resourcePack', () => {
|
||||||
|
bot.acceptResourcePack();
|
||||||
|
});
|
||||||
|
|
||||||
return bot;
|
return bot;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue