0x2C S2CPacketSpawnGlobalEntity
Spawns a global entity visible to all players (lightning bolt).
Published 2026-06-18 · Updated 2026-10-14
Fields
| Field | Type | Description |
|---|---|---|
| entityId | VarInt | Entity ID |
| x/y/z | fixed-point int | Position × 32 |
| type | byte | Entity type (1=lightning) |
Wire Encoding
| Field | Type | Notes |
|---|---|---|
| Entity ID | VarInt | |
| X | Int | x*32 |
| Y | Int | y*32 |
| Z | Int | z*32 |
| Type | byte | 1=lightning |
MCP References
NetHandlerPlayClient.handleSpawnGlobalEntity()Handler Interface
INetHandlerPlayClientVanilla Source
| 1 | |
| 2 | |
| 3 | |
| 4 | |
| 5 | |
| 6 | |
| 7 | |
| 8 | |
| 9 | |
| 10 | |
| 11 | |
| 12 | |
| 13 | |
| 14 | |
| 15 | |
| 16 | |
| 17 | |
| 18 | |
| 19 | |
| 20 | |
| 21 | |
| 22 | |
| 23 | |
| 24 | |
| 25 | |
| 26 | |
| 27 | |
| 28 | |
| 29 | |
| 30 | |
| 31 | |
| 32 | |
| 33 | |
| 34 | |
| 35 | |
| 36 | |
| 37 | |
| 38 | |
| 39 | |
| 40 | |
| 41 | |
| 42 | |
| 43 | |
| 44 | |
| 45 | |
| 46 | |
| 47 | |
| 48 | |
| 49 | |
| 50 | |
| 51 | |
| 52 | |
| 53 | |
| 54 | |
| 55 | |
| 56 | |
| 57 | |
| 58 | |
| 59 | |
| 60 | |
| 61 | |
| 62 | |
| 63 | |
| 64 | |
| 65 | |
| 66 | |
| 67 | |
| 68 | |
| 69 | |
| 70 | |
| 71 | |
| 72 | |
| 73 | |
| 74 | |
| 75 | |
| 76 | |
| 77 | |
| 78 | |
| 79 | |
| 80 | |
| 81 | |
| 82 | |
| 83 | |
| 84 | |
| 85 | |
| 86 | |
| 87 | |
| 88 | |
| 89 | |
| 90 | |
| 91 | |
| 92 | |
Deobfuscated MCP 1.8.9 source of S2CPacketSpawnGlobalEntity, fetched directly from Marcelektro/MavenMCP-1.8.9 (net/minecraft/network/play/server/S2CPacketSpawnGlobalEntity.java) at build time and verified present.
Deep Dive
Role in the protocol
Spawns a globally visible entity, in 1.8.9 exclusively the lightning bolt. The server broadcasts it to every player within 512 blocks of the strike (WorldServer.addWeatherEffect via sendToAllNear). The client handler converts the x32 fixed-point coordinates and, when the type byte is 1, instantiates an EntityLightningBolt in the client world. Because the entity is server-created and broadcast, it is the only lightning representation the client ever sees.
Vanilla handling
NetHandlerPlayClient.handleSpawnGlobalEntity divides each coordinate by 32.0D and builds an EntityLightningBolt only when the type byte equals 1; any other type yields a null entity and is dropped. The bolt is then added to the client world, which drives its ambient light flash and thunder sound. Server-side the packet constructor derives entityId, coordinates and type from the Entity argument passed in by WorldServer.
Why clients touch it
Two module-grade consumers in the corpus. Rise 6.1.30 and 6.2.4 ship LightningTracker, an exploit-category module that prints the strike coordinates and distance to chat on every type-1 packet. LiquidSense Dev ships LightningCheck, a world-category module with the same read pattern: it divides the fixed-point coordinates back to blocks and posts them to chat, while also storing them in static x/y/z fields that other modules can read. Both are informational, not ESP. The remaining seven client dirs (Memeware, Nekoware, Rise 5.99, Sigma, Spicy, Tenacity, November Recode 2.0) reference the packet only through vanilla NetHandlerPlayClient.
Exploit surface
The packet is a broadcast with a server-chosen entityId and position, so a malicious server can spam it to fake lightning at arbitrary coordinates; there is no client-side validation beyond the type check. The 512-block broadcast radius means a strike far outside the client's render distance still spawns an entity. No client in the corpus abuses this for teleport hacks or lightning-based exploits, and none uses it for anti-cheat purposes.
Server-Side Handling
WorldServer.addWeatherEffect calls ConfigurationManager.sendToAllNear with a 512.0D radius on the strike position, same dimension, constructing S2CPacketSpawnGlobalEntity from the EntityLightningBolt. The packet's constructor copies entityId, x*32, y*32, z*32 and type (1 for lightning) from the entity. NetHandlerPlayClient only materializes the bolt when type == 1, ignoring the entityId for lookup since the client creates the entity fresh.
Protocol Analysis
Encoding: VarInt entityId, int x*32, int y*32, int z*32, byte type. Coordinates are fixed-point at 1/32 block resolution, finer than S29's 1/8. The type byte is the only discriminator; in 1.8.9 only 1 (lightning) is ever sent. The packet predates the generic Packet<T> signature in the older clients (raw Packet with double dispatch) while Rise 6.x uses Packet<INetHandlerPlayClient>.
Anti-Cheat Landscape
No anti-cheat touches this packet. Lightning is ambient weather; there is no cheat surface to measure. The only observable abuse would be server-side strike spam to distract or desync clients, which no module in the corpus defends against. The 512-block radius is worth noting for anyone building lightning-based radar: strikes beyond render distance still arrive.
implementation Implementation Cases
The lightning broadcast packet. Rise 6.x LightningTracker and LiquidSense Dev LightningCheck both print strike coordinates to chat on type-1 packets; LiquidSense additionally caches the coordinates in static fields. No ESP, no weather control, no exploit use: the 10 clients confirm this packet is near-invisible to module authors.
Print a chat message with the coordinates and distance of every lightning strike.
A PacketReceiveEvent listener. For each S2C it divides the x32 coordinates back to blocks, rounds to two decimals, and when the type byte is 1 calls ChatUtil.display with the position and the player's distance to the strike. It is an exploit-category module but performs no world manipulation.
// ===== FILE: Rise 6.2.4, Client-release2/Client/src/main/java/com/alan/clients/module/impl/exploit/LightningTracker.java =====
package com.alan.clients.module.impl.exploit;
import com.alan.clients.event.Listener;
import com.alan.clients.event.annotations.EventLink;
import com.alan.clients.event.impl.packet.PacketReceiveEvent;
import com.alan.clients.module.Module;
import com.alan.clients.module.api.Category;
import com.alan.clients.module.api.ModuleInfo;
import com.alan.clients.util.chat.ChatUtil;
import net.minecraft.network.Packet;
import net.minecraft.network.play.server.S2CPacketSpawnGlobalEntity;
@ModuleInfo(aliases = {"module.combat.lightningtracker.name"}, description = "module.exploit.lightningtracker.description", category = Category.EXPLOIT)
public class LightningTracker extends Module {
@EventLink
public final Listener<PacketReceiveEvent> onPacketReceiveEvent = event -> {
final Packet<?> p = event.getPacket();
if (p instanceof S2CPacketSpawnGlobalEntity) {
final S2CPacketSpawnGlobalEntity wrapper = (S2CPacketSpawnGlobalEntity) p;
final int x = (int) (Math.round((wrapper.func_149051_d() / 32.0D) * 100) / 100.0F);
final int y = (int) (Math.round((wrapper.func_149050_e() / 32.0D) * 100) / 100.0F);
final int z = (int) (Math.round((wrapper.func_149049_f() / 32.0D) * 100) / 100.0F);
if (wrapper.func_149053_g() == 1) {
ChatUtil.display("Lightning struck at " + x + ", " + y + ", " + z + " (" + (int) mc.thePlayer.getDistance(x, y, z) + " blocks away)");
}
}
};
}
// NOTE (AI): The rounding (Math.round(v / 32.0 * 100) / 100.0) recovers block coordinates from the fixed-point encoding. The type guard func_149053_g() == 1 restricts output to real lightning.Report lightning strikes to chat and expose their coordinates in static fields for other modules.
An @EventTarget onPacket handler on the LiquidBounce PacketEvent bus. For each S2CPacketSpawnGlobalEntity whose type byte is 1 it divides the x32 fixed-point coordinates by 32.0D, stores them in public static x/y/z fields, and prints a prefixed chat line with the strike position. The unused C07PacketPlayerDigging import is dead weight carried over from a copy-paste skeleton.
// ===== FILE: LiquidSense Dev, me/AquaVit/liquidSense/modules/world/LightningCheck.java =====
package me.AquaVit.liquidSense.modules.world;
import net.ccbluex.liquidbounce.LiquidBounce;
import net.ccbluex.liquidbounce.event.EventTarget;
import net.ccbluex.liquidbounce.event.PacketEvent;
import net.ccbluex.liquidbounce.features.module.Module;
import net.ccbluex.liquidbounce.features.module.ModuleCategory;
import net.ccbluex.liquidbounce.features.module.ModuleInfo;
import net.ccbluex.liquidbounce.utils.ClientUtils;
import net.minecraft.network.Packet;
import net.minecraft.network.play.client.C07PacketPlayerDigging;
import net.minecraft.network.play.server.S2CPacketSpawnGlobalEntity;
import net.minecraft.util.ChatComponentText;
@ModuleInfo(name = "LightningCheck", description = "Lightning x y z", category = ModuleCategory.WORLD)
public class LightningCheck extends Module {
public static int x;
public static int y;
public static int z;
@EventTarget
public void onPacket(PacketEvent event) {
final Packet<?> packet = event.getPacket();
if(packet instanceof S2CPacketSpawnGlobalEntity) {
S2CPacketSpawnGlobalEntity sb = (S2CPacketSpawnGlobalEntity)packet;
if(sb.func_149053_g() == 1) {
x = (int) ((double) sb.func_149051_d() / 32.0D);
y = (int) ((double) sb.func_149050_e() / 32.0D);
z = (int) ((double) sb.func_149049_f() / 32.0D);
mc.thePlayer.addChatMessage(new ChatComponentText("§8[§9§l" + LiquidBounce.CLIENT_NAME+ "§8] §3"+ "Found Lightning X:" + x + " -Y:" + y + " -Z:" + z));
}
}
}
}
// NOTE (AI): The static x/y/z fields are the module's real payload: they let other modules read the last strike position without hooking the packet themselves. The chat line is a side effect of the same handler.anticheat Anti-Cheat Checks
No anticheat in the 50-repo corpus runs a check on the global-entity (lightning) packet. The only genuine packet references are framework registrations: Artemis wraps PacketPlayOutSpawnEntityWeather as GPacketPlayServerSpawnEntityWeather and registers it at SERVER_PLAY + 69, and Negativity lists the packet in its PacketType enum. Every other corpus hit is keyword noise from the search term Lightning: strikeLightningEffect ban-punishment visuals in PeyangSuperbAntiCheat KickUtil, TruthfulAC Check and SafeguardAC ViolationHandler, and lightning-rod block-shape comments in NoCheatPlus. Lightning is ambient server weather with no client-trust signal, so nothing measures it.
Related Packets
Wiki Cross-Reference
Clientbound 0x2C: VarInt entityId, byte type, then X Y Z ints at times 32.
Type is always 1 in 1.8.9, meaning lightning bolt; other types are dropped.
Broadcast to players within 512 blocks of the strike position.
MCP 1.8.9 S2CPacketSpawnGlobalEntity implements Packet
1.8.9 callers: WorldServer.addWeatherEffect sends new S2CPacketSpawnGlobalEntity (line 984): https://github.com/Marcelektro/MavenMCP-1.8.9/blob/master/src/main/java/net/minecraft/world/WorldServer.java
Cross-checked against minecraft.wiki (CC BY-SA 3.0) for 1.8.9 accuracy.
Vanilla Internals
Full 1.8.9 logic-class sources that send or handle this packet, stored verbatim.