Skip to content

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

@AkmalFairuz

Description

@AkmalFairuz

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions