Skip to content

Always load totalEntityAge#13918

Open
Rothes wants to merge 2 commits into
PaperMC:mainfrom
Rothes:totalEntityAge-loads
Open

Always load totalEntityAge#13918
Rothes wants to merge 2 commits into
PaperMC:mainfrom
Rothes:totalEntityAge-loads

Conversation

@Rothes
Copy link
Copy Markdown
Contributor

@Rothes Rothes commented May 29, 2026

This variable totalEntityAge seems always being saved, but only loads if entity is LivingEntity.

I believe there was a reason not to load it when it was tickCount, but since we have separated that, I don't see a reason why we don't load it anytime.

despawnTime could behave better on some projectiles (like wither skull) after this.

@Rothes Rothes requested a review from a team as a code owner May 29, 2026 05:43
@github-project-automation github-project-automation Bot moved this to Awaiting review in Paper PR Queue May 29, 2026
@Lulu13022002
Copy link
Copy Markdown
Contributor

It seems to have been done kinda on purpose in #12077 (comment) to not break the API, now this is indeed weird for the config value.
Also this is added code by us so can just remove the if statement here.

@Rothes
Copy link
Copy Markdown
Contributor Author

Rothes commented May 30, 2026

If statement is now removed.

I think we could keep the old API behavior.
bukkitEntity.getTicksLived now returns totalEntityAge , we can make it returns tickCount for non-LivingEntity.

However, I think a better approach, is to add new API, so dev can get both tickCount and totalEntityAge.
One for total age; One for ticked times since it's loaded.

( tickCount is also stored in some entities (AreaEffectCloud), so it will always return same value with totalEntityAge )

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Awaiting review

Development

Successfully merging this pull request may close these issues.

3 participants