Skip to content

Improvement to Vehicle damage events#13572

Open
Doc94 wants to merge 3 commits intoPaperMC:mainfrom
Doc94:feature/13571-vehicle-damages-damagesource
Open

Improvement to Vehicle damage events#13572
Doc94 wants to merge 3 commits intoPaperMC:mainfrom
Doc94:feature/13571-vehicle-damages-damagesource

Conversation

@Doc94
Copy link
Member

@Doc94 Doc94 commented Jan 20, 2026

Close #13571 by adding the DamageSource to the Vehicle events related to damage for allow check more details for the damage rather than just the entity who cause the damage also change the Attacker passed to events for include the internal event damager used in a few places if exists.

@Doc94 Doc94 requested a review from a team as a code owner January 20, 2026 13:18
@github-project-automation github-project-automation bot moved this to Awaiting review in Paper PR Queue Jan 20, 2026
@Lulu13022002
Copy link
Contributor

I don't mind exposing the damage source here but this doesn't solve the mentioned issue.

@Doc94
Copy link
Member Author

Doc94 commented Jan 21, 2026

I don't mind exposing the damage source here but this doesn't solve the mentioned issue.

oh.. i misread the issue then... the issue not talk about cases for the direct/causing entity? for that i suggest the damagesource for check all rather than change logic in the event or miss something?

@Owen1212055
Copy link
Member

Not 100% sure what you mean, but I do agree with exposing the whole damage source.

@Warriorrrr
Copy link
Member

I don't mind exposing the damage source here but this doesn't solve the mentioned issue.

oh.. i misread the issue then... the issue not talk about cases for the direct/causing entity? for that i suggest the damagesource for check all rather than change logic in the event or miss something?

The lightning bolt is passed as the eventEntityDamager instead of the causing/directEntity in the vanilla damagesource, meaning you still can't retrieve the lightning bolt entity from it as it is now.

@Doc94
Copy link
Member Author

Doc94 commented Feb 4, 2026

I don't mind exposing the damage source here but this doesn't solve the mentioned issue.

oh.. i misread the issue then... the issue not talk about cases for the direct/causing entity? for that i suggest the damagesource for check all rather than change logic in the event or miss something?

The lightning bolt is passed as the eventEntityDamager instead of the causing/directEntity in the vanilla damagesource, meaning you still can't retrieve the lightning bolt entity from it as it is now.

Ahhh that thing again... The issue is the DamageSource not expose that and when DamaSource api comes to paper the definition was separate the vanilla from events then... Maybe can be good a method in damagesource for get that? or pass again the causing entity to the events but using the event method from the craftdamagesource?

@Lulu13022002
Copy link
Contributor

I don't think it should be exposed on the damage source which represent the vanilla object. But it would make sense for getAttacker to behave like the EntityDamageByEntityEvent so plugins can get both information.

@Doc94
Copy link
Member Author

Doc94 commented Feb 4, 2026

I don't think it should be exposed on the damage source which represent the vanilla object. But it would make sense for getAttacker to behave like the EntityDamageByEntityEvent so plugins can get both information.

if the events implementation was in server its easy but for know just send the DamageSource and also the attacker again but using the event behaviour...

@Doc94 Doc94 force-pushed the feature/13571-vehicle-damages-damagesource branch from fb7df77 to 6c277ee Compare February 4, 2026 19:42
@Doc94 Doc94 changed the title Add DamageSource to Vehicle damage events Improvement to Vehicle damage events Feb 4, 2026
@Doc94
Copy link
Member Author

Doc94 commented Feb 4, 2026

I include a helper method in the CraftDamageSource for handle the same logic for get the damager used in other damage events (if is valid then in another PR can make the damage events use that helper method and not make the check of direct-event entity)

no absolutely not
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.

VehicleDamageEvent: Get Lightning Attacker

5 participants