entity not block Real
This commit is contained in:
ChomeNS 2022-08-26 17:28:45 +07:00
parent 3922aa5765
commit 12979437b5

View file

@ -8,8 +8,8 @@ module.exports = {
trusted: 0, trusted: 0,
execute: function(bot, username, usernameraw, sender, prefix, args) { execute: function(bot, username, usernameraw, sender, prefix, args) {
if (!args[0]) return; if (!args[0]) return;
const entity = mcData.blocksByName[args[0]]; const entity = mcData.entitiesByName[args[0]];
if (!entity) throw new SyntaxError('Invalid block'); if (!entity) throw new SyntaxError('Invalid entity');
if (!args[1]) { 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: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'}])); bot.core.run('minecraft:tellraw @a ' + JSON.stringify(['', {text: 'Entity ', color: 'white'}, {text: `"${entity.displayName}" `, color: 'green'}, {text: 'spawning at everyone...', color: 'white'}]));