mirror of
https://github.com/ChomeNS/chomens-bot-mc.git
synced 2024-11-14 10:44:55 -05:00
*music list suggest_command clickEvent
This commit is contained in:
parent
0786d6c801
commit
48daabc64e
1 changed files with 8 additions and 8 deletions
|
@ -61,19 +61,19 @@ module.exports = {
|
|||
const absolutePath = await resolve(SONGS_PATH);
|
||||
const listed = await list(absolutePath);
|
||||
|
||||
let color = '§6';
|
||||
let message = '';
|
||||
let color = 'gold';
|
||||
const message = [];
|
||||
|
||||
listed.forEach((value) => {
|
||||
if (color==='§6') {
|
||||
color = '§e';
|
||||
} else if (color==='§e') {
|
||||
color = '§6';
|
||||
if (color==='gold') {
|
||||
color = 'yellow';
|
||||
} else if (color==='yellow') {
|
||||
color = 'gold';
|
||||
};
|
||||
message += color + value + ' ';
|
||||
message.push({text: value + ' ', color, clickEvent: {action: 'suggest_command', value: `*music play ${value}`}});
|
||||
});
|
||||
|
||||
bot.core.run('minecraft:tellraw @a ' + JSON.stringify({text: message, color: 'red'}));
|
||||
bot.core.run('minecraft:tellraw @a ' + JSON.stringify(message));
|
||||
};
|
||||
|
||||
if (args[0]==='play') {
|
||||
|
|
Loading…
Reference in a new issue