*music list suggest_command clickEvent

This commit is contained in:
ChomeNS 2022-10-19 08:58:34 +07:00
parent 0786d6c801
commit 48daabc64e

View file

@ -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') {