Skip to content

Restore entities from snapshots with //restore -e - #3054

Merged
me4502 merged 2 commits into
EngineHub:masterfrom
Mikeym41:entity-restore
Nov 16, 2026
Merged

me4502 merged 2 commits into
EngineHub:masterfrom
Mikeym41:entity-restore

Conversation

@Mikeym41

@Mikeym41 Mikeym41 commented Nov 7, 2026

Copy link
Copy Markdown

Closes #1749

Hey, I put together entity support for //restore. If you use //restore -e it'll now bring back entities like item frames, paintings, and armor stands from the snapshot along with the blocks.

How it works:

  • Added a getEntityTags method to Snapshot. FolderSnapshot reads the entities from the "entities" folder next to "region" (since 1.17)
  • SnapshotRestore then creates each entity from the snapshot that's inside the selection.
  • I went with -e so it matches copy/paste like you mentioned. It only adds entities and doesn't remove any, so if the entities are still there you'll get duplicates, same as //paste -e. If you'd rather it work differently just let me know and I can change it.

What I tested on Paper 26.3:

  • //restore -e brought back the item frames (with the items still in them) and an armor stand
  • plain //restore still only restores blocks like before
  • running //restore -e twice gives duplicates, same as //paste -e

Stuff I Noted:

  • Worlds older than 1.17 keep entities inside the chunk data and this doesn't read those yet.
  • While testing I noticed snapshots of 26.x worlds aren't found at all, since the region folder is now under dimensions/minecraft/overworld/region. I had to move the folders around to test it. I figured that's a separate issue so I left it out of this PR. Figured it was worth mentioning

Add method to read entities from snapshots
@Mikeym41
Mikeym41 requested a review from a team as a code owner November 7, 2026 18:49
@me4502
me4502 enabled auto-merge November 16, 2026 11:58
@me4502
me4502 added this pull request to the merge queue Nov 16, 2026
Merged via the queue into EngineHub:master with commit 0725e85 Nov 16, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants