[GH-ISSUE #4846] Dedicated server world saves overwrite player data and remove saved position #1468

Closed
opened 2026-11-02 15:47:11 +07:00 by bsakaguchi · 1 comment
Owner

Originally created by @Iam-Sanja on GitHub (Oct 31, 2026).
Original GitHub issue: https://github.com/horizon-rust/horizon/issues/4846

Originally assigned to: @Iam-Sanja on GitHub.

Bug description

On a Minecraft 26.3 dedicated Horizon server, player positions can be lost after saving the world. Players reconnect at the world spawn instead of their last saved position.

Steps to reproduce

  1. Join a dedicated Horizon server.
  2. Move away from the world spawn and disconnect.
  3. Confirm that world/players/data/<uuid>.dat contains the correct Pos field.
  4. Reconnect and trigger a world save.
  5. Observe that the Pos field can disappear from the player file.
  6. After reconnecting again, the player may appear at the world spawn.

Root cause

Level::write() writes both world metadata and a player file using singleplayer_uuid.

On dedicated servers, this UUID can match a real player's UUID. Consequently, saving world metadata can overwrite separately managed player data with an incomplete player state, removing the Pos field.

Environment

  • Minecraft Java Edition 26.3
  • Horizon Nightly 1da354b67
  • Linux dedicated server

Proposed fix

Dedicated world metadata saves should not overwrite player files managed by the dedicated server.

A tested fix and regression test are available in the branch fix/dedicated-playerdata-overwrite.

Originally created by @Iam-Sanja on GitHub (Oct 31, 2026). Original GitHub issue: https://github.com/horizon-rust/horizon/issues/4846 Originally assigned to: @Iam-Sanja on GitHub. ## Bug description On a Minecraft 26.3 dedicated Horizon server, player positions can be lost after saving the world. Players reconnect at the world spawn instead of their last saved position. ## Steps to reproduce 1. Join a dedicated Horizon server. 2. Move away from the world spawn and disconnect. 3. Confirm that `world/players/data/<uuid>.dat` contains the correct `Pos` field. 4. Reconnect and trigger a world save. 5. Observe that the `Pos` field can disappear from the player file. 6. After reconnecting again, the player may appear at the world spawn. ## Root cause `Level::write()` writes both world metadata and a player file using `singleplayer_uuid`. On dedicated servers, this UUID can match a real player's UUID. Consequently, saving world metadata can overwrite separately managed player data with an incomplete player state, removing the `Pos` field. ## Environment - Minecraft Java Edition 26.3 - Horizon Nightly `1da354b67` - Linux dedicated server ## Proposed fix Dedicated world metadata saves should not overwrite player files managed by the dedicated server. A tested fix and regression test are available in the branch `fix/dedicated-playerdata-overwrite`.
Author
Owner

@Iam-Sanja commented on GitHub (Oct 31, 2026):

/claim

<!-- gh-comment-id:6536646280 --> @Iam-Sanja commented on GitHub (Oct 31, 2026): /claim
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
horizon-rust/horizon#1468
No description provided.