Skip to content

Clarify mob persistence API - #14312

Open
TiggerTakkyTTT wants to merge 2 commits into
PaperMC:mainfrom
TiggerTakkyTTT:fix/13980-remove-when-far-away
Open

TiggerTakkyTTT wants to merge 2 commits into
PaperMC:mainfrom
TiggerTakkyTTT:fix/13980-remove-when-far-away

Conversation

@TiggerTakkyTTT

Copy link
Copy Markdown
Contributor

Fixes #13980

Adds isPersistenceRequired() and setPersistenceRequired() to Mob

@TiggerTakkyTTT
TiggerTakkyTTT requested a review from a team as a code owner September 27, 2026 08:34
@github-project-automation github-project-automation Bot moved this to Awaiting review in Paper PR Queue Sep 27, 2026
@masmc05

masmc05 commented Sep 27, 2026

Copy link
Copy Markdown
Contributor

The isPersistenceRequired() would definitely be confusing when there's already https://jd.papermc.io/paper/26.3/org/bukkit/entity/Entity.html#isPersistent()

@TiggerTakkyTTT

Copy link
Copy Markdown
Contributor Author

The isPersistenceRequired() would definitely be confusing when there's already https://jd.papermc.io/paper/26.3/org/bukkit/entity/Entity.html#isPersistent()

Yeah, good point. isPersistent() is for whether the entity gets saved, while this is the mob flag used for distance despawning, so the names would be pretty easy to confuse.

Do you have a name you’d prefer for this?

@masmc05

masmc05 commented Sep 27, 2026

Copy link
Copy Markdown
Contributor

Personally I don't think new methods are needed at all and just a few tweaks in javadocs would be enough. But that's for the maintainers to decide

@Doc94

Doc94 commented Oct 27, 2026

Copy link
Copy Markdown
Member

Hmmm the NMS method its not only used for distance... its used for normal despawn (ex: Skeleton Horse Trap when time pass)

but its true can be confusing with the Bukkit API for persistance... if others wanna give an opinion... for me feels fine add the new method but need a way for avoid confusing with the Bukkit method...

@papermc-projects papermc-projects Bot moved this from Awaiting review to Delayed approval in Paper PR Queue Oct 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Delayed approval

Development

Successfully merging this pull request may close these issues.

Ambiguity in LivingEntity.getRemoveWhenFarAway() documentation

3 participants