Closed nosefish closed 11 years ago
What would you think is appropriate to pass as the entity, the Ghast or its fireball? I'm thinking fireball, probably, because it may be possible to get the shooting Entity from it.
Actually, this would be a vanilla "bug". The OExplosion
is being created with null
as the causing entity, when an OEntityLargeFireball
hits. I'm in the process of finding out whether it would cause unintended side-effects if I'd pass the entity, otherwise I'll be adding that. Above question still remains in that case. In any case, it's still possible to get the Ghast from onProjectileHit
. This requires an entity to be hit though.
This cannot be added without rewriting major parts of our code. If anyone feels up to it, feel free to submit a pull request when finished, but for now this will not get fixed. You can check for null
and even (possibly) get the entity from the block coordinates if needed.
I should probably use block.Status to get the cause of the explosion anyway. I used entity.getName() as a workaround for the block.Status() documentation issue #143. It makes sense that there is no entity passed here, because the fireball gets destroyed in the explosion.
The onExplosion hook is called with a null BaseEntity on Ghast fireball explosions; Creepers, TNT, and Wither work as expected.