worked like this:
const colors = [
"<color:#FF5733>", "<color:#33FF57>", "<color:#3357FF>", "<color:#FF33A1>",
"<color:#A133FF>", "<color:#33FFF5>", "<color:#F5FF33>", "<color:#FF8C33>",
"<color:#33FF8C>", "<color:#8C33FF>", "<color:#FF338C>", "<color:#338CFF>",
"<color:#33A1FF>", "<color:#A1FF33>", "<color:#FF33F5>", "<color:#F533FF>",
];
const randomColor = () => colors[Math.floor(Math.random() * colors.length)];
onEvent('player.logged_in', event => {
let playerData = event.player.persistentData;
if (playerData.colorSet === "yes") {
return;
}
const username = event.player.getName().getText();
const color = randomColor();
const command = `styled-nicknames set ${username} ${color}${username}</color>`;
Utils.server.runCommandSilent(command);
playerData.colorSet = "yes";
})
couldnt just use boolean as colorSet i guess there aint no such type in that mapping