0x27 S27PacketExplosion
Server notifies the client of an explosion (TNT, creeper, bed in Nether/End, etc).
Fields
| Field | Type | Description |
|---|---|---|
| x/y/z | float | Explosion center |
| strength | float | Explosion power/strength |
| affectedBlockPositions | List<BlockPos> | Blocks destroyed by the explosion |
| motionX/Y/Z | float | Player knockback velocity from the explosion |
Wire Encoding
| Field | Type | Notes |
|---|---|---|
| X | float | |
| Y | float | |
| Z | float | |
| Radius | float | |
| Record Count | int | |
| Records | byte array | Relative positions of affected blocks |
| Player Motion X | float | |
| Player Motion Y | float | |
| Player Motion Z | float |
MCP References
MCP
NetHandlerPlayClient.handleExplosion()Handler Interface
HND
INetHandlerPlayClientNotes
Affected blocks are sent as byte triplets (x, y, z) relative to the explosion center. The client applies particle effects and knockback to the local player.
implementation Implementation Cases
Velocity
(Tenacity 5.1, Sigma 3.9, Raze v1.5b, Gugustus, Jello 0.1, Helium B41420)
Cancel or scale explosion velocity alongside S12PacketEntityVelocity.
// Cancel
if (event.getPacket() instanceof S27PacketExplosion) {
S27PacketExplosion s27 = (S27PacketExplosion) event.getPacket();
s27.motionX *= horizontal / 100.0;
s27.motionY *= vertical / 100.0;
s27.motionZ *= horizontal / 100.0;
}AntiKnockback
(Tenacity 5.1, Sigma 3.9, Raze v1.5b, Gugustus, Jello 0.1, Helium B41420)
Cancel or scale explosion velocity alongside S12PacketEntityVelocity.
// Cancel
if (event.getPacket() instanceof S27PacketExplosion) {
S27PacketExplosion s27 = (S27PacketExplosion) event.getPacket();
s27.motionX *= horizontal / 100.0;
s27.motionY *= vertical / 100.0;
s27.motionZ *= horizontal / 100.0;
}