// priority: 0

// Visit the wiki for more info - https://kubejs.com/

// made by blueversal

ServerEvents.loaded(event => {
  const data = event.server.persistentData
  if (!data.spawnSet) {
    event.server.runCommandSilent('setworldspawn 0 80 0')
    data.spawnSet = true
  }
})
PlayerEvents.loggedIn(event => {
  const data = event.player.persistentData
  if (!data.firstSpawnSet) {
    event.server.runCommandSilent(`spawnpoint ${event.player.name.string} 0 80 0`)
    data.firstSpawnSet = true
  }
})

PlayerEvents.loggedIn(event => {
  console.info("PLAYER JOINED:", event.player.name.string)
})