Skip to content

Add combat tracker API#11853

Merged
lynxplay merged 11 commits into
PaperMC:mainfrom
SoSeDiK:combat-tracker
Apr 30, 2025
Merged

Add combat tracker API#11853
lynxplay merged 11 commits into
PaperMC:mainfrom
SoSeDiK:combat-tracker

Conversation

@SoSeDiK
Copy link
Copy Markdown
Contributor

@SoSeDiK SoSeDiK commented Dec 28, 2024

Adds LivingEntity#getCombatTracker to get entity's combat tracker that allows getting/setting combat history (list of damage entries during a combat session), recording new combat entries without causing actual damage, getting/resetting current combat state/session and getting a death message based on the present combat history.

FallLocationType represents a location from which the entity fell, and is used by vanilla to generate fall death messages.


API implementation is basically done, but definitely open to feedback. Javadocs & namings could use some love.

@SoSeDiK SoSeDiK requested a review from a team as a code owner December 28, 2024 21:46
Comment thread paper-api/src/main/java/io/papermc/paper/world/damagesource/CombatTracker.java Outdated
Comment thread paper-api/src/main/java/io/papermc/paper/world/damagesource/FallLocation.java Outdated
@SoSeDiK SoSeDiK requested a review from kennytv December 29, 2024 11:26
@NoahvdAa NoahvdAa added the type: feature Request for a new Feature. label Dec 30, 2024
Comment thread paper-api/src/main/java/io/papermc/paper/world/damagesource/CombatEntry.java Outdated
Comment thread paper-api/src/main/java/io/papermc/paper/world/damagesource/CombatTracker.java Outdated
Comment thread paper-server/src/main/java/io/papermc/paper/PaperServerInternalAPIBridge.java Outdated
Comment thread paper-api/src/main/java/io/papermc/paper/world/damagesource/FallLocationType.java Outdated
Comment thread paper-api/src/main/java/io/papermc/paper/world/damagesource/CombatEntry.java Outdated
Comment thread build-data/paper.at Outdated
@SoSeDiK SoSeDiK force-pushed the combat-tracker branch 2 times, most recently from 2b98777 to 404e6d6 Compare February 26, 2025 08:40
@SoSeDiK SoSeDiK requested a review from Lulu13022002 February 26, 2025 08:46
@github-project-automation github-project-automation Bot moved this from Awaiting review to Awaiting final testing in Paper PR Queue Feb 28, 2025
Comment thread paper-server/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java Outdated
@lynxplay lynxplay moved this from Awaiting final testing to PR Party candidate in Paper PR Queue Apr 30, 2025
@github-project-automation github-project-automation Bot moved this from PR Party candidate to Awaiting final testing in Paper PR Queue Apr 30, 2025
@lynxplay lynxplay merged commit e663f99 into PaperMC:main Apr 30, 2025
3 checks passed
@github-project-automation github-project-automation Bot moved this from Awaiting final testing to Merged in Paper PR Queue Apr 30, 2025
@SoSeDiK SoSeDiK deleted the combat-tracker branch March 7, 2026 11:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type: feature Request for a new Feature.

Projects

Status: Merged

Development

Successfully merging this pull request may close these issues.

6 participants