-
-
Notifications
You must be signed in to change notification settings - Fork 3.3k
Description
Is your feature request related to a problem?
Animals or mobs may be riding the vehicle. When lightning—either summoned by a player's trident or generated naturally by weather—strikes a creature on the vehicle, the vehicle will be damaged/destroyed by the lightning, yet VehicleDamageEvent.getAttacker() will return null in such cases.
When a vehicle is damaged by cacti or lava, VehicleDamageEvent.getAttacker() also returns null.(Do not want to fully cancel the VehicleDamageEvent)
Area protection plugins expect VehicleDamageEvent.getAttacker() to retrieve the lightning entity that damages the vehicle, and subsequently obtain the player who summoned the lightning via LightningStrike for more granular protection checks.
Describe the solution you'd like.
VehicleDamageEvent.getAttacker() can retrieve the lightning entity.
Describe alternatives you've considered.
When the EntityZapEvent is cancelled, the struck entity will be immune to lightning damage.
This method seems better: when any entity is struck by lightning and the event is cancelled, the damage event can be cancelled as well.
Other
No response