Skip to content

feat: preserve PersistenceRequired and add forceMobPersistence#105

Open
terbin wants to merge 1 commit into
Avanatiker:1.21.4from
terbin:feat/force-mob-persistence
Open

feat: preserve PersistenceRequired and add forceMobPersistence#105
terbin wants to merge 1 commit into
Avanatiker:1.21.4from
terbin:feat/force-mob-persistence

Conversation

@terbin
Copy link
Copy Markdown

@terbin terbin commented May 19, 2026

Vanilla persistence semantics state that a mob with a custom name should survive chunk unload (PersistenceRequired = true on the NBT). Captures were emitting these mobs without the flag, so loading a captured world and walking out of view caused the mob to despawn, which players reasonably treated as a capture bug.

Always set PersistenceRequired on name-tagged mobs at capture time, matching vanilla expectations. Expose forceMobPersistence (default off) for users who want the same guarantee extended to every captured mob, at the cost of vanilla despawn behaviour across the whole capture.

Verification

26 / 26 name-tagged entities in server capture capture have PersistenceRequired = 1 after the fix.

Note

Adds a config flag and one lang key in en_us.

Vanilla persistence semantics state that a mob with a custom name should survive chunk unload (PersistenceRequired = true on the NBT). Captures were emitting these mobs without the flag, so loading a captured world and walking out of view caused the mob to despawn, which players reasonably treated as a capture bug.

Always set PersistenceRequired on name-tagged mobs at capture time, matching vanilla expectations. Expose forceMobPersistence (default off) for users who want the same guarantee extended to every captured mob, at the cost of vanilla despawn behaviour across the whole capture.
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.

1 participant