[SPIGOT-6371] Bed explosion bug with BlockExplodeEvent Created: 19/Feb/21 Updated: 29/Apr/24 Resolved: 29/Apr/24 |
|
Status: | Resolved |
Project: | Spigot |
Component/s: | None |
Affects Version/s: | None |
Fix Version/s: | None |
Type: | Bug | Priority: | Minor |
Reporter: | Frank van der Heijden | Assignee: | Unassigned |
Resolution: | Done | Votes: | 1 |
Labels: | None |
Issue Links: |
|
||||||||
Version: | 3013-Spigot-73fb609-0cd8f19 (MC: 1.16.5) | ||||||||
Guidelines Read: | Yes |
Description |
Whenever a bed is exploded in the nether, the block thats included in the BlockExplodeEvent is AIR. It's possible to get the block anyway by checking the PlayerInteractEvent & caching the location of a bed right click from the nether. |
Comments |
Comment by md_5 [ 29/Apr/24 ] |
I think |
Comment by Michael Botsko [ 03/Jun/22 ] |
I'd like to add that this is inconsistent with how EntityExplodeEvent works. event.getEntity() returns the entity, TNT, Creeper, etc. |
Comment by Michael Botsko [ 03/Jun/22 ] |
This used to work, I have a plugin that relied on it but am noticing it no longer works. There's no easy way to identify the "cause" of the explosion if the getBlock is always AIR. There's no indication if it was a bed, respawn anchor, etc. Maybe the change was intentional, but it's not ideal it can't tell me what the original block was. |
Comment by Martoph [ 02/May/21 ] |
I believe you're describing intended behavior. If you prime and explode TNT, the TNT entity and block goes away. If you want to prevent this, just cancel the interact event. Why should this work differently with a bed? |
Comment by Julian v.d Berkmortel [ 10/Apr/21 ] |
Inside "net.minecraft.world.level.block.BlockBed#explodeBed" the block which is the bed is set to air before the explosion is actually created, keeping it from even being destroyed by the explosion and thus appear in the list of blocks passed to the event. I moved the explosion to the beginning of the method, before any block is set to air and I also removed the code which set the block to air in the first place. I came up with the questions below which should be answered before a solution can be thought of.
|