sry, i am first time try to using kubejs and i never use javascript before. And i wrote a code, that join player to a command when he connect to a server, but i cant understand how to get player name into string/how to get player name.
my crappy code:
PlayerEvents.loggedIn(e => { const player_name = event.player.name.getString();
if(!event.player.stages.has('command')) {
if(!event.player.stages.has('has_command'))
event.player.stages.add('has_command');
Utils.server.runCommandSilent('team join ' + player_name ' players');
} Utils.server.runCommandSilent('tell @a ' + player_name ' hi' ); // debug print
})```