Paper icon indicating copy to clipboard operation
Paper copied to clipboard

Add EntityPushByExplodeEvent

Open yoyosource opened this issue 3 months ago • 4 comments

Add a way to check what Entity got pushed by an Explosion happening. This event is only called for non LivingEntities because there is the EntityKnockbackEvent for that already. I am using this on a server where I am a Developer already for cancelling specific Explosions knocking around other Entities.

yoyosource avatar Oct 29 '25 09:10 yoyosource

Yo, is this PR ready? Seems like it could fix the issue. @lynxplay https://github.com/PaperMC/Paper/issues/13326

Huge-mistake avatar Nov 26 '25 13:11 Huge-mistake

I have tested it and locally it works. I am just waiting on a second review from somebody or the first reviewer.

yoyosource avatar Nov 26 '25 15:11 yoyosource

https://github.com/yoyosource/Paper/blob/feature/EntityPushByExplodeEvent/paper-server/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java#L2074

May trigger NPE and requires a minor modification. event.setCancelled(legacyEvent != null && legacyEvent.isCancelled());

Huge-mistake avatar Nov 26 '25 19:11 Huge-mistake

Good catch. I will fix it later.

yoyosource avatar Nov 26 '25 20:11 yoyosource

@Huge-mistake would it be possible for you to fix this. I have some private stuff blocking me in general.

yoyosource avatar Dec 20 '25 13:12 yoyosource

If so I would add you to the my fork.

yoyosource avatar Dec 20 '25 13:12 yoyosource

@Huge-mistake would it be possible for you to fix this. I have some private stuff blocking me in general.

The solution I listed above is effective, so feel free to use it. event.setCancelled(legacyEvent != null && legacyEvent.isCancelled());

Huge-mistake avatar Dec 20 '25 14:12 Huge-mistake

@Huge-mistake can you have a quick check through this PR. I think I fixed it now.

yoyosource avatar Dec 20 '25 15:12 yoyosource