PocketMine-MP
PocketMine-MP copied to clipboard
Ways to get cause for EntityCombustEvent
Description
Add a new EntityIgniteEvent called when an entity is being ignited by something, e.g by the player or TNT.
Justification
With the current API, there is no way to know who/which player/thing caused the entity to be ignited.
The following class added: EntityIgniteEvent
EntityIgniteEvent->getCause() : ?Entity: Returns an entity that caused this entity to be ignited.
Thing to consider
Make this event Cancellable:
- After this event, events such as
EntityExplodeEvent/ExplosionPrimeEventwill be called anyway, so I don't think this event need to be cancellable, instead, we could just cancel exploding inEntityExplodeEvent/ExplosionPrimeEvent
Alternative methods
N/A
After this event, events such as EntityExplodeEvent/ExplosionPrimeEvent will be called anyway, so I don't think this event need to be cancellable
This depends on the behaviour of the entity when ignited.
We could also use EntityCombustEvent for the same purpose.