remove pig and cow + *entity uses minecraft-data

real!11!1
This commit is contained in:
ChomeNS 2022-08-26 17:13:00 +07:00
parent 4c12832347
commit 458e5a7cd5
6 changed files with 13 additions and 46 deletions

View file

@ -1,5 +1,4 @@
[
"Better auto refill on core break (instead of clooping fill core command in the core)",
"*music list colors",
"Better *list"
"Remove pig and cow command",
"*entity now uses minecraft-data"
]

View file

@ -1,18 +0,0 @@
/* eslint-disable max-len */
module.exports = {
name: 'cow',
alias: [],
description: 'Summon cows at everyone',
usage: '[specific] <player>',
trusted: 0,
execute: function(bot, username, usernameraw, sender, prefix, args) {
if (args[0]==='specific') {
const specific = args[1];
bot.core.run(`minecraft:execute unless entity @s[name= run ] run execute as @a at ${specific} run summon cow`);
bot.core.run('minecraft:tellraw @a ' + JSON.stringify(['', {'text': 'Cows ', 'color': '#FCA6A6'}, {'text': 'spawning at ' + `${specific}`, 'color': 'white'}]));
} else {
bot.core.run('minecraft:execute unless entity @s[name= run ] run execute as @a at @r[\'limit\'=10] run summon cow');
bot.core.run('minecraft:tellraw @a ["",{"text":"Cows ","color":"white"},{"text":"spawned at everyone","color":"white"}]');
}
},
};

View file

@ -6,14 +6,15 @@ module.exports = {
usage: '[specific] <player>',
trusted: 0,
execute: function(bot, username, usernameraw, sender, prefix, args) {
if (typeof args[0]==='undefined') return;
const entity = args[0];
if (typeof args[1]==='undefined') {
bot.core.run('minecraft:execute unless entity @s[name= run ] run execute as @a at @r[\'limit\'=10] run summon ' + entity);
bot.core.run('minecraft:tellraw @a ' + JSON.stringify(['', {text: 'Entity ', color: 'white'}, {text: `"${entity}" `, color: 'green'}, {text: 'spawning at everyone...', color: 'white'}]));
} else if (args[1]==='specific' && typeof args[2]!=='undefined') {
if (!args[0]) return;
const entity = bot.mcData.blocksByName[args[0]];
if (!entity) throw new SyntaxError('Invalid block');
if (!args[1]) {
bot.core.run('minecraft:execute unless entity @s[name= run ] run execute as @a at @r[\'limit\'=10] run summon minecraft:' + entity.name);
bot.core.run('minecraft:tellraw @a ' + JSON.stringify(['', {text: 'Entity ', color: 'white'}, {text: `"${entity.displayName}" `, color: 'green'}, {text: 'spawning at everyone...', color: 'white'}]));
} else if (args[1]==='specific' && args[2]) {
bot.core.run('minecraft:execute unless entity @s[name= run ] run execute as @a at ' + args[2] + ' run summon ' + entity);
bot.core.run('minecraft:tellraw @a ' + JSON.stringify(['', {text: `Entity `, color: 'white'}, {text: `"${entity}" `, color: 'green'}, {text: 'spawning at ', color: 'white'}, {text: `${args[2]}`, color: 'aqua'}]));
bot.core.run('minecraft:tellraw @a ' + JSON.stringify(['', {text: `Entity `, color: 'white'}, {text: `"${entity.displayName}" `, color: 'green'}, {text: 'spawning at ', color: 'white'}, {text: `${args[2]}`, color: 'aqua'}]));
}
},
};

View file

@ -1,18 +0,0 @@
/* eslint-disable max-len */
module.exports = {
name: 'pig',
alias: [],
description: 'Summon pigs at everyone',
usage: '[specific] <player>',
trusted: 0,
execute: function(bot, username, usernameraw, sender, prefix, args) {
if (args[0]==='specific') {
const specific = args[1];
bot.core.run(`minecraft:execute unless entity @s[name= run ] run execute as @a at ${specific} run summon pig`);
bot.core.run('minecraft:tellraw @a ' + JSON.stringify(['', {'text': 'Pigs ', 'color': 'white'}, {'text': 'spawning at ' + `${specific}`, 'color': 'white'}]));
} else {
bot.core.run('minecraft:execute unless entity @s[name= run ] run execute as @a at @r[\'limit\'=10] run summon pig');
bot.core.run('minecraft:tellraw @a ["",{"text":"Pigs ","color":"#FCA6A6"},{"text":"spawned at everyone","color":"white"}]');
}
},
};

View file

@ -263,6 +263,8 @@ function main() {
};
bot.vm = new VM(bot.vmoptions);
bot.mcData = require('minecraft-data')('1.18.2');
loginfinish = true;
await sleep(1400);
bot.core.run('minecraft:tellraw @a ' + JSON.stringify([{text: 'ChomeNS Bot', color: 'yellow'}, {text: ' - a bot made by ', color: 'gray'}, {text: 'chayapak', color: 'gold'}]));

View file

@ -23,6 +23,7 @@
"electron": "^20.1.0",
"express": "^4.18.1",
"flying-squid": "^1.5.0",
"minecraft-data": "^3.11.0",
"mineflayer": "^4.3.0",
"moment": "^2.29.3",
"moment-timezone": "^0.5.34",