dragonfly icon indicating copy to clipboard operation
dragonfly copied to clipboard

Cannot set world spawn to Y>127 or Y<0 on default world

Open AkmalFairuz opened this issue 5 months ago • 1 comments

How to reproduce:

func main() {
	slog.SetLogLoggerLevel(slog.LevelDebug)
	chat.Global.Subscribe(chat.StdoutSubscriber{})
	conf, err := readConfig(slog.Default())
	if err != nil {
		panic(err)
	}

	srv := conf.New()
	srv.CloseOnProgramEnd()
        srv.World().SetSpawn(cube.Pos{0, 208, 0})
        time.Sleep(time.Second*2)
        fmt.Printf("Spawn: %v\n", srv.World().Spawn()) // magically changed
        
	srv.Listen()
	for p := range srv.Accept() {
		_ = p
	}
}

Causes

  • WorldProvider and WorldSettings are shared across all three worlds (srv.World(), srv.Nether(), and srv.End()). So, if the spawn position is invalid in any dimension, it will automatically correct itself during a tick.

AkmalFairuz avatar Jul 09 '25 22:07 AkmalFairuz

maybe we could avoid such behavior by ignoring other dimensions, cause nether does not really have spawn point (so we can just return 0 0 0) and the end dimension spawn is always 100 50 0

FDUTCH avatar Dec 08 '25 20:12 FDUTCH