This commit is contained in:
ChomeNS 2022-11-06 18:11:41 +07:00
parent a655752a50
commit 076ff7b966
2 changed files with 72 additions and 3 deletions

View file

@ -6,6 +6,29 @@ module.exports = {
usage: '',
trusted: 0,
execute: function(bot, username, usernameraw, sender, prefix, args) {
bot.core.run('minecraft:tellraw @a ' + JSON.stringify(['', {text: 'Your username is: ', color: 'white'}, {text: `${bot.getplayerusername[sender]}`, color: 'gold', clickEvent: {action: 'copy_to_clipboard', value: `${bot.getplayerusername[sender]}`}, hoverEvent: {action: 'show_text', contents: [{text: 'Click here to copy the username to your clipboard', color: 'green'}]}}] ));
bot.core.run('minecraft:tellraw @a ' + JSON.stringify(
[
{
text: 'Your username is: ',
color: 'white',
},
{
text: bot.getplayerusername[sender],
color: 'gold',
clickEvent: {
action: 'copy_to_clipboard',
value: bot.getplayerusername[sender],
},
hoverEvent: {
action: 'show_text',
contents: [
{
text: 'Click here to copy the username to your clipboard',
color: 'green',
},
],
},
},
]));
},
};

View file

@ -11,9 +11,55 @@ module.exports = {
const playername = args.join(' ');
const player = bot.playersAddedPlayers[playername];
if (player === undefined) throw new SyntaxError('Invalid Username');
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'}]}}]));
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'}]}}]));
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',
},
],
},
},
]));
}
},
discordExecute: function(bot, username, usernameraw, sender, prefix, args, channeldc, message) {