#world spawn being weird (sharedSpawnPos)
8 messages · Page 1 of 1 (latest)
Once your ticket has been resolved, please close it with </ticket close:1054771505520717835> command!
ServerEvents.loaded(event => {
const { server , server: { persistentData } } = event
console.log(persistentData.firstload)
if(!persistentData.firstload) {
let overworld = server.overworld()
let spawnPos = overworld.sharedSpawnPos.offset(0, 1, 0)
server.gameRules.set('spawnRadius', 0)
const { x, y, z } = spawnPos
console.log(`place template toastech_datapack:global_recall ${Math.floor(x-3)} ${Math.floor(y-2)} ${Math.floor(z-3)}`)
server.runCommandSilent(`place template toastech_datapack:global_recall ${Math.floor(x-3)} ${Math.floor(y-2)} ${Math.floor(z-3)}`)
console.log(persistentData.firstload)
persistentData.firstload = true
}
})```
There probably is a more elegant solution to this... but... maybe just try teleporting the player a couple blocks down?
so just add this?
PlayerEvents.loggedIn(event => {
const { player , player: { persistentData } } = event
if(!persistentData.firstjoin) {
persistentData.firstjoin = true
const playerName = player.getName().getString()
player.runCommandSilent(`tp ${playerName} ~ ~-7 ~`)
}
})```
probably.
it seems to work!
Please close your ticket (with </ticket close:1054771505520717835> or the button atop this thread) once you resolved your issue! This also helps others that would like to help out, as they don't have to look into this thread to check if it has been resolved by now.
Do you have any other questions regarding your issue? Feel free to ask!
Note: You generally should create a new post for unrelated issues.