Skip to content

Add getLastDamageTime method to Combat Tracker API - #13854

Merged
Doc94 merged 2 commits into
PaperMC:mainfrom
mcmdev:last-damage-time
Aug 2, 2026
Merged

Add getLastDamageTime method to Combat Tracker API#13854
Doc94 merged 2 commits into
PaperMC:mainfrom
mcmdev:last-damage-time

Conversation

@mcmdev

@mcmdev mcmdev commented May 2, 2026

Copy link
Copy Markdown
Contributor

This PR adds a method to get the time since damage was last taken as an extension to the Combat Tracker API.

I decided to calculate the time relative to the entity's tickCount, since the tickCount currently isn't exposed in the API, which would have made the value returned from this new method unfit for further calculations. In most cases, the user would want to calculate the ticks from the current time anyway.

The last damage time could obviously also be calculated using a damage listener, but that would add unnecessary overhead for calculating a value that is already tracked by the server, in my opinion

@mcmdev
mcmdev requested a review from a team as a code owner May 2, 2026 15:44
@github-project-automation github-project-automation Bot moved this to Awaiting review in Paper PR Queue May 2, 2026
@papermc-projects papermc-projects Bot moved this from Awaiting review to Delayed approval in Paper PR Queue Jul 28, 2026
@papermc-projects papermc-projects Bot moved this from Delayed approval to Full approval in Paper PR Queue Jul 29, 2026
@Doc94
Doc94 merged commit c692832 into PaperMC:main Aug 2, 2026
4 checks passed
@github-project-automation github-project-automation Bot moved this from Full approval to Merged in Paper PR Queue Aug 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Merged

Development

Successfully merging this pull request may close these issues.

4 participants