Skip to content

Add getLastDamageTime method to Combat Tracker API#13854

Open
mcmdev wants to merge 1 commit intoPaperMC:mainfrom
mcmdev:last-damage-time
Open

Add getLastDamageTime method to Combat Tracker API#13854
mcmdev wants to merge 1 commit intoPaperMC:mainfrom
mcmdev:last-damage-time

Conversation

@mcmdev
Copy link
Copy Markdown
Contributor

@mcmdev mcmdev commented May 2, 2026

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
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.

2 participants