mirror of
https://github.com/ChomeNS/chomens-bot-mc.git
synced 2024-11-23 23:57:57 -05:00
18 lines
1.1 KiB
JavaScript
18 lines
1.1 KiB
JavaScript
/* eslint-disable max-len */
|
|
module.exports = {
|
|
name: 'uuid',
|
|
alias: [],
|
|
description: 'Gets the UUID of a player. If no player specified it will show your UUID instead',
|
|
usage: '',
|
|
trusted: 0,
|
|
execute: function(bot, username, usernameraw, sender, prefix, args) {
|
|
if (args[0]!=undefined) {
|
|
const playername = args.join(' ');
|
|
const player = bot.playersAddedPlayers[playername];
|
|
if (player===undefined) throw new SyntaxError('Invalid UUID');
|
|
bot.core.run('minecraft:tellraw @a ' + JSON.stringify(['', {text: `${playername}'s uuid: `, color: 'green'}, {text: `${player}`, color: 'aqua', clickEvent: {action: 'copy_to_clipboard', value: `${player}`}, hoverEvent: {action: 'show_text', contents: [{text: 'Click here to copy the uuid to your clipboard', color: 'green'}]}}]));
|
|
} else {
|
|
bot.core.run('minecraft:tellraw @a ' + JSON.stringify(['', {text: `Your uuid: `, color: 'green'}, {text: `${sender}`, color: 'aqua', clickEvent: {action: 'copy_to_clipboard', value: `${sender}`}, hoverEvent: {action: 'show_text', contents: [{text: 'Click here to copy the uuid to your clipboard', color: 'green'}]}}]));
|
|
}
|
|
},
|
|
};
|