0x13 C13PacketPlayerAbilities
Player toggles flying state. Only sent for the flying flag change. The server controls all other ability flags via S39PacketPlayerAbilities.
Published 2026-06-18 · Updated 2026-10-14
Fields
| Field | Type | Description |
|---|---|---|
| invulnerable | boolean | Player is invulnerable (god mode) |
| isFlying | boolean | True if the player is currently flying |
| allowFlying | boolean | Whether player is allowed to fly |
| creativeMode | boolean | True if in creative mode |
| flySpeed | float | Flight speed multiplier |
| walkSpeed | float | Walk speed multiplier |
Wire Encoding
| Field | Type | Notes |
|---|---|---|
| Flags | byte (bitmask) | 0x01=invulnerable, 0x02=flying, 0x04=allowFlying, 0x08=creative |
| Fly Speed | float | Flight speed multiplier |
| Walk Speed | float | Walk speed multiplier |
MCP References
NetHandlerPlayServer.processPlayerAbilities()Handler Interface
INetHandlerPlayServerNotes
Vanilla 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 | |
| 93 | |
| 94 | |
| 95 | |
| 96 | |
| 97 | |
| 98 | |
| 99 | |
| 100 | |
| 101 | |
| 102 | |
| 103 | |
| 104 | |
| 105 | |
| 106 | |
| 107 | |
| 108 | |
| 109 | |
| 110 | |
| 111 | |
| 112 | |
| 113 | |
| 114 | |
| 115 | |
| 116 | |
| 117 | |
| 118 | |
| 119 | |
| 120 | |
| 121 | |
| 122 | |
| 123 | |
| 124 | |
| 125 | |
| 126 | |
| 127 | |
| 128 | |
| 129 | |
| 130 | |
| 131 | |
| 132 | |
| 133 | |
| 134 | |
| 135 | |
Deobfuscated MCP 1.8.9 source of C13PacketPlayerAbilities, fetched directly from Marcelektro/MavenMCP-1.8.9 (net/minecraft/network/play/client/C13PacketPlayerAbilities.java) at build time and verified present.
Deep Dive
Role in the protocol
C13 announces ability state changes: a 4-bit flag byte (invulnerable, flying, allowFlying, creative) plus fly and walk speed floats. Vanilla sends it only when the flying flag flips, from EntityPlayerSP.sendPlayerAbilities. Despite the full struct, the 1.8.9 server reads exactly one bit: it writes isFlying into the player's capabilities and discards everything else.
Vanilla handling
processPlayerAbilities is a single line: capabilities.isFlying = packetIn.isFlying() && capabilities.allowFlying. The server's own allowFlying flag, set exclusively via S39PacketPlayerAbilities, ANDs out any client claim of flight, which is the core reason ability spoofing is a dead end against vanilla. The float fields are not stored at all in 1.8.9, so a forged flySpeed or walkSpeed never reaches server math.
Why clients touch it
The 8 clients show four families. (1) Disabler modes: Memeware Watchdog sends C13 with NaN flySpeed on Hypixel, Rise 5.99's hypixelSlime and c13 modes send allowFlying/isFlying true, Spicy's Disabler sends creative flags. (2) Rise 6.x AbilitiesDisabler spams C13 every 5 ticks. (3) Flight movement: Spicy LongJump, Fly and BackupFly forge full PlayerCapabilities with random flySpeed. (4) Utility: Rise 6.x Nuker syncs the flying flag before teleport-nuking, and the script PacketAPI exposes sendAbilities. The two new research clients add two more. November Recode 2.0 only maps C13 to id 0x13 for its Lua scripting API, with no dedicated module. LiquidSense Dev declares isFlying on enable in LastestHypixelFly and Tp, and TeleportCommand spams absurd flySpeed and walkSpeed floats (1.0E8F and 1.0E8F minus 1) along its C04 teleport path.
Exploit surface
Because the server ANDs against its own allowFlying, the packet is the safest spoof in the protocol: a forged isFlying claim is dropped silently on any non-creative player, which is why disablers spam it freely. The NaN flySpeed in Memeware targets proxy and anti-cheat parsers that copy the float before the handler drops it. The real signal anti-cheats measure is not C13 but the motion that follows: clients that declare flying then move at fly speed without S39 authorization flag on movement checks, not on the packet itself.
Server-Side Handling
processPlayerAbilities writes capabilities.isFlying = packetIn.isFlying() && capabilities.allowFlying and nothing else. The invulnerable, allowFlying, creativeMode, flySpeed and walkSpeed fields are parsed from the wire and discarded. S39PacketPlayerAbilities is the only way the server-side allowFlying changes.
Protocol Analysis
Flag byte (0x01 invulnerable, 0x02 flying, 0x04 allowFlying, 0x08 creative) + two floats. Vanilla clients emit it on double-tap-space in creative; modules emit it on ticks, strafe events or module enable. The wire format accepts any float, including NaN and values far outside the 0..1 range.
Anti-Cheat Landscape
Anti-cheats treat C13 as a weak signal because vanilla discards most of it. NCP and Verus correlate declared flying with actual vertical motion; a client that spams isFlying=true but moves like a walker is suspicious, and one that moves like a flier without S39 authorization flags on motion. The NaN flySpeed trick only works against layers that deserialize the float before the vanilla handler.
implementation Implementation Cases
The ability-flag packet. The server keeps exactly one bit (isFlying, ANDed against server-side allowFlying); the 8 clients abuse it as a safe desync probe in disablers and as a client-side flight declaration in movement modules.
Send forged C13 payloads as part of anti-cheat disabler mode suites, usually alongside C0F and C00 manipulation.
Memeware's Watchdog mode sends C13 with isFlying=true and NaN flySpeed every 30 ticks on Hypixel. Rise 5.99's hypixelSlime mode sends isFlying=true when the server allows flying; its c13 mode sends a bare C13 with allowFlying and flying set. Spicy's Disabler sends creative-flag capabilities from its own mode logic.
// ===== FILE: Memeware 7.3, me/memewaredevs/client/module/exploit/Disabler.java =====
package me.memewaredevs.client.module.exploit;
import me.hippo.api.lwjeb.annotation.Handler;
import me.memewaredevs.client.event.events.PacketInEvent;
import me.memewaredevs.client.event.events.PacketOutEvent;
import me.memewaredevs.client.event.events.UpdateEvent;
import me.memewaredevs.client.module.Module;
import me.memewaredevs.client.util.ChatUtil;
import me.memewaredevs.client.util.misc.Timer;
import me.memewaredevs.client.util.packet.PacketUtil;
import net.minecraft.entity.player.PlayerCapabilities;
import net.minecraft.network.Packet;
import net.minecraft.network.play.client.*;
import net.minecraft.network.play.server.S08PacketPlayerPosLook;
import net.minecraft.network.play.server.S2APacketParticles;
import org.apache.commons.lang3.RandomUtils;
import java.util.Queue;
import java.util.concurrent.ConcurrentLinkedQueue;
import java.util.function.Consumer;
public class Disabler extends Module {
private static final int VERUS_DISABLE_AUTOBAN_CHANNEL = 65536;
private static final short VERUS_DISABLE_AUTOBAN_UID = 32767;
private final Queue<Packet> packetQueue = new ConcurrentLinkedQueue();
private final Timer timer = new Timer();
private final Timer timer1 = new Timer();
public Disabler(final String name, final int key, final Module.Category category) {
super(name, key, category);
this.addModes("Mineplex Combat", "Transaction", "Latest Verus", "PvPTemple", "OmegaCraft", "Timer", "AACv1.9.10", "Sloth", "Ghostly", "Watchdog", "Faithful Movement");
}
@Override
public void onDisable() {
packetQueue.clear();
}
@Override
public void onEnable() {
timer.reset();
}
@Handler
public Consumer<PacketInEvent> packetInEventConsumer = (event) -> {
if (isMode("Sloth")) {
if (event.getPacket() instanceof S08PacketPlayerPosLook) {
S08PacketPlayerPosLook playerPosLook = (S08PacketPlayerPosLook) event.getPacket();
/**
* Works alongside with the spigot exploit.
* Exploit PlayerData bug (Player data gets set to null if the previous event is cancelled, and y difference <= 1.0E-4)
*/
playerPosLook.y += 1.0E-4;
}
}
};
@Handler
public Consumer<UpdateEvent> eventConsumer = (event) -> {
if (isMode("Latest Verus")) {
if (timer.delay(490L)) {
if (!packetQueue.isEmpty()) {
PacketUtil.sendPacketSilent(packetQueue.poll());
}
timer.reset();
}
}
if (isMode("OmegaCraft")) {
PacketUtil.sendPacketSilent(new C0FPacketConfirmTransaction(VERUS_DISABLE_AUTOBAN_CHANNEL, VERUS_DISABLE_AUTOBAN_UID, true));
}
if (isMode("PvPTemple")) { // Added by Auth
event.setGround(false);
event.setY(event.getY() + 0.42);
event.setYaw(0);
event.setPitch(0);
}
if (isMode("Watchdog")) {
if (timer.delay(15000L)) {
if (!packetQueue.isEmpty()) {
PacketUtil.sendPacketSilent(packetQueue.poll());
}
timer.reset();
}
}
};
@Handler
public Consumer<PacketInEvent> eventConsumer0 = (event) -> {
if (event.getPacket() instanceof S2APacketParticles) {
event.cancel();
}
};
@Handler
public Consumer<PacketOutEvent> eventConsumer1 = (event) -> {
if (isMode("Mineplex Combat"))
if (event.getPacket() instanceof C00PacketKeepAlive) {
C00PacketKeepAlive packetKeepAlive = (C00PacketKeepAlive) event.getPacket();
packetKeepAlive.key -= RandomUtils.nextInt(3, 128);
}
if (isMode("OmegaCraft"))
if (event.getPacket() instanceof C0FPacketConfirmTransaction)
event.cancel();
if (isMode("Latest Verus")) {
if (event.getPacket() instanceof C0FPacketConfirmTransaction) {
C0FPacketConfirmTransaction c0fPacketConfirmTransaction = (C0FPacketConfirmTransaction) event.getPacket();
packetQueue.add(c0fPacketConfirmTransaction);
event.cancel();
}
if (event.getPacket() instanceof C03PacketPlayer) {
C03PacketPlayer c03 = (C03PacketPlayer) event.getPacket();
if (mc.thePlayer.ticksExisted % 33 == 0) {
c03.y = -0.911;
c03.onGround = false;
c03.field_149480_h = false;
}
}
if (mc.thePlayer != null && mc.thePlayer.ticksExisted <= 7) {
timer.reset();
packetQueue.clear();
}
}
if (isMode("Timer") && event.getPacket() instanceof C03PacketPlayer) {
if (mc.thePlayer.ticksExisted % 3 != 0) {
event.cancel();
}
}
if (isMode("AACv1.9.10")) {
if (event.getPacket() instanceof C03PacketPlayer) {
PacketUtil.sendPacketSilent(new C0CPacketInput());
C03PacketPlayer packetPlayer = (C03PacketPlayer) event.getPacket();
/**
* Resets all checks VL due to a bug in critical hit check
*/
packetPlayer.y += 7.0E-9D;
}
}
if (isMode("Sloth")) {
if (event.getPacket() instanceof C03PacketPlayer) {
C03PacketPlayer packetPlayer = (C03PacketPlayer) event.getPacket();
if (!timer.delay(1000L)) {
for (int i = 0; i < 10; ++i) {
double y = i > 2 && i < 8 ? 11 : 120;
PacketUtil.sendPacketSilent(new C03PacketPlayer.C04PacketPlayerPosition(mc.thePlayer.posX, mc.thePlayer.posY - y, mc.thePlayer.posZ, true));
}
} else {
//set to default jump value so viper can stop fucking value patching it
packetPlayer.y += 0.42F;
}
}
}
if (isMode("Faithful Movement")) {
if (mc.thePlayer != null && event.getPacket() instanceof C00PacketKeepAlive) {
C00PacketKeepAlive packetKeepAlive = (C00PacketKeepAlive) event.getPacket();
packetKeepAlive.key -= 31;
}
}
if (isMode("Ghostly")) { // Ghostly Disabler added by Auth
if (event.getPacket() instanceof C03PacketPlayer)
PacketUtil.sendPacketSilent(new C0CPacketInput());
if (event.getPacket() instanceof C0FPacketConfirmTransaction)
event.cancel();
}
if (isMode("Watchdog")) {
// PacketUtil.sendPacketSilent(new C0EPacketClickWindow());
if (mc.getCurrentServerData().serverIP.contains("hypixel.net")) {
if (mc.thePlayer.ticksExisted % 30 == 0) {
PlayerCapabilities pc = new PlayerCapabilities();
pc.isFlying = true;
pc.setFlySpeed(Float.NaN);
PacketUtil.sendPacketSilent(new C13PacketPlayerAbilities(pc));
}
System.out.println(event.getPacket());
if (event.getPacket() instanceof C0FPacketConfirmTransaction) {
event.setPacket(new C0FPacketConfirmTransaction(Integer.MIN_VALUE, Short.MAX_VALUE, true));
}
} else {
ChatUtil.printChat("You must be on Hypixel to use Watchdog Disabler!");
this.toggle();
}
}
};
}
// NOTE (AI): The C13 hit is in the Watchdog mode: on Hypixel, every 30 ticks the module builds a fresh PlayerCapabilities with isFlying=true and flySpeed set to Float.NaN and sends it via sendPacketSilent. The server's processPlayerAbilities only writes capabilities.isFlying = packetIn.isFlying() && capabilities.allowFlying, so the NaN flySpeed never reaches the server-side capabilities; the mode is aimed at the proxy/anti-cheat layer that parses the packet before the handler. The same mode corrupts C0F transaction keys with Integer.MIN_VALUE/Short.MAX_VALUE.Spam C13 with a fresh isFlying=true capabilities object to desynchronize anti-cheat ability tracking.
On StrafeEvent, every 5 ticks, builds a PlayerCapabilities (isFlying=true, allowFlying left false) and sends it through PacketUtil.send. Gated on the parent Disabler's deprecated setting.
// ===== FILE: Rise 6.2.4, Client-release2/Client/src/main/java/com/alan/clients/module/impl/exploit/disabler/AbilitiesDisabler.java =====
package com.alan.clients.module.impl.exploit.disabler;
import com.alan.clients.event.Listener;
import com.alan.clients.event.annotations.EventLink;
import com.alan.clients.event.impl.motion.StrafeEvent;
import com.alan.clients.module.impl.exploit.Disabler;
import com.alan.clients.util.packet.PacketUtil;
import com.alan.clients.value.Mode;
import net.minecraft.entity.player.PlayerCapabilities;
import net.minecraft.network.play.client.C13PacketPlayerAbilities;
public class AbilitiesDisabler extends Mode<Disabler> {
public AbilitiesDisabler(String name, Disabler parent) {
super(name, parent);
}
@EventLink
public final Listener<StrafeEvent> onStrafe = event -> {
if (!getParent().deprecated.getValue()) {
return;
}
if (mc.thePlayer.ticksExisted % 5 == 0) {
final PlayerCapabilities playerCapabilities = new PlayerCapabilities();
playerCapabilities.isFlying = true;
PacketUtil.send(new C13PacketPlayerAbilities(playerCapabilities));
}
};
}
// NOTE (AI): AbilitiesDisabler is a Mode of the Rise 6.x Disabler. Every 5 ticks on StrafeEvent it sends a C13 with a fresh PlayerCapabilities whose isFlying is true. The default constructor of PlayerCapabilities leaves allowFlying false, so the vanilla handler ANDs the flying bit out; the spam is aimed at anti-cheat layers that fingerprint the packet stream rather than the server state. It only runs while the parent Disabler's deprecated setting is enabled.Sync the server-side flying flag before teleport-nuking so airborne path movement is not treated as un-authorized flight.
In Teleport mode, when the player can fly but is not flagged flying, the module mutates the shared capabilities and sends C13 with isFlying=true via sendNoEvent, then path-teleports with C04 packets.
// ===== FILE: Rise 6.2.4, Client-release2/Client/src/main/java/com/alan/clients/module/impl/other/Nuker.java =====
package com.alan.clients.module.impl.other;
import com.alan.clients.component.impl.player.GUIDetectionComponent;
import com.alan.clients.event.Listener;
import com.alan.clients.event.annotations.EventLink;
import com.alan.clients.event.impl.motion.PreMotionEvent;
import com.alan.clients.event.impl.other.WorldChangeEvent;
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.packet.PacketUtil;
import com.alan.clients.util.pathfinding.unlegit.MainPathFinder;
import com.alan.clients.util.pathfinding.unlegit.Vec3;
import com.alan.clients.util.rotation.RotationUtil;
import com.alan.clients.util.vector.Vector2f;
import com.alan.clients.util.vector.Vector3d;
import com.alan.clients.value.impl.BooleanValue;
import com.alan.clients.value.impl.ModeValue;
import com.alan.clients.value.impl.NumberValue;
import com.alan.clients.value.impl.SubMode;
import net.minecraft.block.Block;
import net.minecraft.block.BlockAir;
import net.minecraft.entity.player.PlayerCapabilities;
import net.minecraft.network.Packet;
import net.minecraft.network.play.client.C03PacketPlayer;
import net.minecraft.network.play.client.C07PacketPlayerDigging;
import net.minecraft.network.play.client.C13PacketPlayerAbilities;
import net.minecraft.network.play.server.S02PacketChat;
import net.minecraft.util.BlockPos;
import net.minecraft.util.EnumFacing;
import rip.vantage.commons.util.time.StopWatch;
import java.util.Collections;
import java.util.List;
@ModuleInfo(aliases = {"module.other.nuker.name"}, description = "module.other.nuker.description", category = Category.PLAYER)
public final class Nuker extends Module {
private final ModeValue mode = new ModeValue("Mode", this)
.add(new SubMode("Nearby"))
.add(new SubMode("Teleport"))
.setDefault("Nearby");
private final NumberValue delay = new NumberValue("Delay", this, 150, 0, 5000, 50);
private final NumberValue range = new NumberValue("Range", this, 4, 1, 6, 0.5);
private final BooleanValue rotations = new BooleanValue("Rotations", this, false);
private final BooleanValue scatter = new BooleanValue("Scatter", this, false);
private final BooleanValue swing = new BooleanValue("Swing", this, false);
private final StopWatch stopWatch = new StopWatch();
@EventLink
public final Listener<PreMotionEvent> onPreMotionEvent = event -> {
if (GUIDetectionComponent.inGUI()) return;
final double range = this.range.getValue().doubleValue();
switch (mode.getValue().getName()) {
case "Nearby":
if (stopWatch.finished(delay.getValue().longValue())) {
new Thread(() -> nuke(range, event.getPosX(), event.getPosY(), event.getPosZ())).start();
stopWatch.reset();
}
break;
case "Teleport":
if (mc.gameSettings.keyBindUseItem.isKeyDown() && stopWatch.finished(delay.getValue().longValue())) {
final BlockPos target = mc.thePlayer.rayTrace(999, 1).getBlockPos();
if (mc.theWorld.getBlockState(target).getBlock() instanceof BlockAir) {
return;
}
if (mc.thePlayer.capabilities.allowFlying && !mc.thePlayer.capabilities.isFlying) {
final PlayerCapabilities capabilities = mc.thePlayer.capabilities;
capabilities.isFlying = true;
PacketUtil.sendNoEvent(new C13PacketPlayerAbilities(capabilities));
}
new Thread(() -> {
final List<Vec3> path = MainPathFinder.computePath(new Vec3(event.getPosX(), event.getPosY(), event.getPosZ()), new Vec3(target.getX(), target.getY(), target.getZ()), false);
if (path == null) {
return;
}
for (final Vec3 vec : path) {
PacketUtil.sendNoEvent(new C03PacketPlayer.C04PacketPlayerPosition(vec.getX(), vec.getY(), vec.getZ(), false));
}
nuke(range, target.getX(), target.getY(), target.getZ());
Collections.reverse(path);
for (final Vec3 vec : path) {
PacketUtil.sendNoEvent(new C03PacketPlayer.C04PacketPlayerPosition(vec.getX(), vec.getY(), vec.getZ(), false));
}
}).start();
stopWatch.reset();
}
break;
}
};
@EventLink
public final Listener<PacketReceiveEvent> onPacketReceiveEvent = event -> {
final Packet<?> p = event.getPacket();
if (p instanceof S02PacketChat) {
final S02PacketChat wrapper = (S02PacketChat) p;
if (!wrapper.isChat() && wrapper.getChatComponent().getUnformattedText().equals("You can't build outside the plot!")) {
event.setCancelled();
}
}
};
@EventLink
public final Listener<WorldChangeEvent> onWorldChange = event -> {
this.toggle();
};
private void nuke(final double range, final double x, final double y, final double z) {
for (double posX = -range; posX < range; posX++) {
for (double posY = range; posY > -range; posY--) {
for (double posZ = -range; posZ < range; posZ++) {
if (scatter.getValue() && !((mc.thePlayer.ticksExisted % 2 == 0 ? posX : posZ) % 2 == 0)) {
continue;
}
final BlockPos blockPos = new BlockPos(x + posX, y + posY, z + posZ);
final Block block = mc.theWorld.getBlockState(blockPos).getBlock();
if (block instanceof BlockAir) {
continue;
}
if (rotations.getValue()) {
final Vector2f rotations = RotationUtil.calculate(new Vector3d(blockPos.getX(), blockPos.getY(), blockPos.getZ()));
PacketUtil.sendNoEvent(new C03PacketPlayer.C05PacketPlayerLook(rotations.x, rotations.y, false));
}
PacketUtil.sendNoEvent(new C07PacketPlayerDigging(C07PacketPlayerDigging.Action.START_DESTROY_BLOCK, blockPos, EnumFacing.UP));
if (swing.getValue()) {
mc.thePlayer.swingItem();
}
}
}
}
// final BlockPos blockPos = new BlockPos(x, y, z);
// final Block block = mc.theWorld.getBlockState(blockPos).getBlock();
//
// if (block instanceof BlockAir) {
// return;
// }
//
// if (rotations.getValue()) {
// final Vector2f rotations = RotationUtil.calculate(new Vector3d(blockPos.getX(), blockPos.getY(), blockPos.getZ()));
// PacketUtil.sendNoEvent(new C03PacketPlayer.C05PacketPlayerLook(rotations.x, rotations.y, false));
// }
// PacketUtil.sendNoEvent(new C0BPacketEntityAction(mc.thePlayer, C0BPacketEntityAction.Action.START_SNEAKING));
// PacketUtil.sendNoEvent(new C08PacketPlayerBlockPlacement(blockPos, EnumFacing.UP.getIndex(), mc.thePlayer.getHeldItem(), 255, 255, 255));
// PacketUtil.sendNoEvent(new C0BPacketEntityAction(mc.thePlayer, C0BPacketEntityAction.Action.STOP_SNEAKING));
//
// if (swing.getValue()) {
// mc.thePlayer.swingItem();
// }
}
}
// NOTE (AI): The C13 hit is in the Teleport mode: before path-teleporting to the targeted block, the module checks the client-side capabilities and, if allowFlying is true but isFlying is false, mutates the shared capabilities object and sends C13 with isFlying=true. This synchronizes the server-side flying flag so the airborne C04 teleport path does not trigger fly kick or movement checks while the nuker walks the computed path.Declare flight abilities client-side and mirror the declaration to the server as part of Hypixel-targeted flight modules.
LongJump's onEnable forges PlayerCapabilities with isFlying, allowFlying, isCreativeMode and a random flySpeed 0.1..9.0 and sends via sendPacketNoEvent. Fly and BackupFly repeat the same construct at fixed points in their damage-fly sequences.
// ===== FILE: Spicy, info/spicyclient/modules/movement/LongJump.java =====
package info.spicyclient.modules.movement;
import org.lwjgl.input.Keyboard;
import info.spicyclient.SpicyClient;
import info.spicyclient.events.Event;
import info.spicyclient.events.listeners.EventMotion;
import info.spicyclient.events.listeners.EventUpdate;
import info.spicyclient.modules.Module;
import info.spicyclient.modules.Module.Category;
import info.spicyclient.util.MovementUtils;
import info.spicyclient.util.Timer;
import net.minecraft.entity.player.PlayerCapabilities;
import net.minecraft.network.play.client.C13PacketPlayerAbilities;
import net.minecraft.util.MathHelper;
public class LongJump extends Module {
public LongJump() {
super("Long Jump", Keyboard.KEY_NONE, Category.MOVEMENT);
}
public void onEnable() {
PlayerCapabilities playerCapabilities = new PlayerCapabilities();
playerCapabilities.isFlying = true;
playerCapabilities.allowFlying = true;
playerCapabilities.setFlySpeed((float) ((Math.random() * (9.0 - 0.1)) + 0.1));
playerCapabilities.isCreativeMode = true;
mc.getNetHandler().getNetworkManager().sendPacketNoEvent(new C13PacketPlayerAbilities(playerCapabilities));
}
public void onDisable() {
}
public static boolean jumped = false;
public static Timer timer = new Timer();
public void onEvent(Event e) {
if (e instanceof EventUpdate && e.isPre()) {
this.additionalInformation = "Hypixel";
}
if (e instanceof EventMotion) {
if (e.isPost()) {
if (jumped && mc.thePlayer.onGround) {
this.toggle();
jumped = false;
return;
}
mc.gameSettings.keyBindJump.pressed = false;
if (MovementUtils.isOnGround(0.000001)) {
MovementUtils.strafe((float) Math.sqrt(mc.thePlayer.motionX * mc.thePlayer.motionX + mc.thePlayer.motionZ * mc.thePlayer.motionZ) + 1.25f);
mc.thePlayer.jump();
e.setCanceled(true);
jumped = true;
}
mc.thePlayer.setSprinting(true);
}
}
}
}
// NOTE (AI): LongJump's onEnable forges a PlayerCapabilities with isFlying, allowFlying, isCreativeMode and a random flySpeed between 0.1 and 9.0, then sends it via sendPacketNoEvent. The vanilla server ignores allowFlying, creativeMode and flySpeed from C13 and only ANDs the isFlying bit against its own allowFlying, so this is a client-side state declaration for the movement code, with the packet doubling as a desync probe against servers that do read abilities.Expose C13 (and every other serverbound class) to Lua scripts as a numeric packet id plus direction.
A static map binds each packet class to its protocol id, C13 at 0x13; the LuaEventPacket constructor resolves the incoming EventPacket's class through the map and records 'out' for EventPacket.Out sends, 'in' otherwise. The @DontObfuscate annotation keeps the class name readable so the Lua runtime can reflect it.
// ===== FILE: November Recode 2.0, scripting/wrapper/event/LuaEventPacket.java =====
/* November.lol © 2023 */
package lol.november.scripting.wrapper.event;
import java.util.HashMap;
import java.util.Map;
import lol.november.listener.event.net.EventPacket;
import lol.november.protect.DontObfuscate;
import lombok.Getter;
import lombok.Setter;
import net.minecraft.network.Packet;
import net.minecraft.network.play.client.*;
/**
* @author Gavin
* @since 2.0.0
*/
@Getter
@Setter
@DontObfuscate
public class LuaEventPacket {
/**
* A map of each {@link Packet} to their id
*/
private static final Map<Class<? extends Packet<?>>, Integer> packetIds =
new HashMap<>();
static {
// you may ask: why not use reflection and just.. do a funny?
// obfuscation eventually happens so this aids has to happen
packetIds.put(C0APacketAnimation.class, 0x0A);
packetIds.put(C0BPacketEntityAction.class, 0x0B);
packetIds.put(C0CPacketInput.class, 0x0C);
packetIds.put(C0DPacketCloseWindow.class, 0x0D);
packetIds.put(C0EPacketClickWindow.class, 0x0E);
packetIds.put(C0FPacketConfirmTransaction.class, 0x0F);
packetIds.put(C00PacketKeepAlive.class, 0x00);
packetIds.put(C01PacketChatMessage.class, 0x01);
packetIds.put(C02PacketUseEntity.class, 0x02);
packetIds.put(C03PacketPlayer.class, 0x03);
packetIds.put(C03PacketPlayer.C04PacketPlayerPosition.class, 0x04);
packetIds.put(C03PacketPlayer.C05PacketPlayerLook.class, 0x05);
packetIds.put(C03PacketPlayer.C06PacketPlayerPosLook.class, 0x06);
packetIds.put(C07PacketPlayerDigging.class, 0x07);
packetIds.put(C08PacketPlayerBlockPlacement.class, 0x08);
packetIds.put(C09PacketHeldItemChange.class, 0x09);
packetIds.put(C10PacketCreativeInventoryAction.class, 0x10);
packetIds.put(C11PacketEnchantItem.class, 0x11);
packetIds.put(C12PacketUpdateSign.class, 0x12);
packetIds.put(C13PacketPlayerAbilities.class, 0x13);
packetIds.put(C14PacketTabComplete.class, 0x14);
packetIds.put(C15PacketClientSettings.class, 0x15);
packetIds.put(C16PacketClientStatus.class, 0x16);
packetIds.put(C17PacketCustomPayload.class, 0x17);
packetIds.put(C18PacketSpectate.class, 0x18);
packetIds.put(C19PacketResourcePackStatus.class, 0x19);
}
private final int packet;
private final String direction;
public LuaEventPacket(EventPacket event) {
packet = packetIds.getOrDefault(event.get().getClass(), -1);
direction = event.get() instanceof EventPacket.Out ? "out" : "in";
}
}
// NOTE (AI): The full scripting wrapper: a static map of every serverbound class to its protocol id (C13 at 0x13), resolved per EventPacket with an in/out direction. The comment explains why the map exists: obfuscation makes reflection-based id lookup unreliable.Declare isFlying to the server with a fresh PlayerCapabilities C13 on enable, and retract it on disable, as part of the Hypixel flight rig.
onEnable builds a PlayerCapabilities with isFlying true, queues C13 through addToSendQueue together with the C0F sentinel and two C04 hops at y+0.17 and y+0.06, then zeroes stepHeight and motion. onDisable sends a fresh C13 with isFlying false, restores stepHeight and sends a bare C04. The flight itself is client-side motion: UpdateEvent drives motionY, MoveEvent computes horizontal velocity, and the send handler cancels all C03 until the first S08 arrives (the go signal), toggling off on a late S08 as a setback.
// ===== FILE: LiquidSense Dev, me/AquaVit/liquidSense/modules/movement/LastestHypixelFly.java =====
package me.AquaVit.liquidSense.modules.movement;
import com.google.gson.JsonObject;
import io.netty.buffer.Unpooled;
import net.ccbluex.liquidbounce.Gui.Notifications.Notificationsn;
import net.ccbluex.liquidbounce.LiquidBounce;
import net.ccbluex.liquidbounce.event.EventTarget;
import net.ccbluex.liquidbounce.event.MoveEvent;
import net.ccbluex.liquidbounce.event.PacketEvent;
import net.ccbluex.liquidbounce.event.UpdateEvent;
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.features.module.modules.movement.Speed;
import net.ccbluex.liquidbounce.features.module.modules.render.HUD;
import net.ccbluex.liquidbounce.utils.ChatUtil;
import net.ccbluex.liquidbounce.utils.ClientUtils;
import net.ccbluex.liquidbounce.utils.timer.MSTimer;
import net.ccbluex.liquidbounce.value.FloatValue;
import net.minecraft.entity.player.PlayerCapabilities;
import net.minecraft.network.PacketBuffer;
import net.minecraft.network.play.client.C03PacketPlayer;
import net.minecraft.network.play.client.C0FPacketConfirmTransaction;
import net.minecraft.network.play.client.C13PacketPlayerAbilities;
import net.minecraft.network.play.client.C17PacketCustomPayload;
import net.minecraft.network.play.server.S08PacketPlayerPosLook;
import net.minecraft.util.ChatComponentText;
@ModuleInfo(name = "LastestHypixelFly",description = "Allows you to Fly.", category = ModuleCategory.MOVEMENT)
public class LastestHypixelFly extends Module {
boolean tp;
private final FloatValue motionSpeedValue = new FloatValue("Speed", 5F, 0F, 5F);
private final MSTimer s08 = new MSTimer();
HUD hd = (HUD)LiquidBounce.moduleManager.getModule("HUD");
@Override
public void onEnable() {
if (mc.thePlayer == null)
return;
tp = false;
s08.reset();
mc.thePlayer.addChatMessage(new ChatComponentText("§8[§9§l" + LiquidBounce.CLIENT_NAME+ "§8] §3"+ "Now Disabler!"));
if(hd.no.get()){
ChatUtil.sendClientMessage("Now disabler!", Notificationsn.Type.INFO);
}
PlayerCapabilities playerCapabilities = new PlayerCapabilities();
playerCapabilities.isFlying = true;
mc.getNetHandler().addToSendQueue(new C0FPacketConfirmTransaction(0, (short)(-1), false));
mc.getNetHandler().addToSendQueue(new C13PacketPlayerAbilities(playerCapabilities));
mc.getNetHandler().addToSendQueue(new C03PacketPlayer.C04PacketPlayerPosition(mc.thePlayer.posX,
mc.thePlayer.posY + 0.17, mc.thePlayer.posZ, true));
mc.getNetHandler().addToSendQueue(new C03PacketPlayer.C04PacketPlayerPosition(mc.thePlayer.posX,
mc.thePlayer.posY + 0.06, mc.thePlayer.posZ, true));
mc.thePlayer.stepHeight = 0.0f;
mc.thePlayer.motionX = 0.0;
mc.thePlayer.motionZ = 0.0;
}
@Override
public void onDisable() {
s08.reset();
PlayerCapabilities playerCapabilities = new PlayerCapabilities();
playerCapabilities.isFlying = false;
mc.thePlayer.onGround = true;
mc.getNetHandler().addToSendQueue(new C13PacketPlayerAbilities(playerCapabilities));
mc.timer.timerSpeed = 1.0f;
mc.thePlayer.stepHeight = 0.625f;
mc.thePlayer.motionX = 0.0;
mc.thePlayer.motionZ = 0.0;
mc.getNetHandler().addToSendQueue(new C03PacketPlayer.C04PacketPlayerPosition(mc.thePlayer.posX, mc.thePlayer.posY, mc.thePlayer.posZ, true));
}
@EventTarget
public void onUpdate(final UpdateEvent event){
mc.thePlayer.onGround = false;
if (mc.thePlayer.movementInput.jump) {
mc.thePlayer.motionY = 1.5;
} else if (mc.thePlayer.movementInput.sneak) {
mc.thePlayer.motionY = -1.5;
} else {
mc.thePlayer.motionY = 0;
}
}
@EventTarget
public void onMove(MoveEvent event) {
if (!tp) {
event.cancelEvent();
}
if(tp){
double speed = motionSpeedValue.get();
double forward = mc.thePlayer.movementInput.moveForward;
double strafe = mc.thePlayer.movementInput.moveStrafe;
float yawm = mc.thePlayer.rotationYaw;
if ((forward == 0.0D) && (strafe == 0.0D)) {
event.setX(0.0D);
event.setZ(0.0D);
} else {
if (forward != 0.0D) {
if (strafe > 0.0D) {
yawm += (forward > 0.0D ? -45 : 45);
} else if (strafe < 0.0D) {
yawm += (forward > 0.0D ? 45 : -45);
}
strafe = 0.0D;
if (forward > 0.0D) {
forward = 1;
} else if (forward < 0.0D) {
forward = -1;
}
}
event.setX(forward * speed * Math.cos(Math.toRadians(yawm + 90.0F))
+ strafe * speed * Math.sin(Math.toRadians(yawm + 90.0F)));
event.setZ(forward * speed * Math.sin(Math.toRadians(yawm + 90.0F))
- strafe * speed * Math.cos(Math.toRadians(yawm + 90.0F)));
}
}
}
@EventTarget
public final void onSendPacket(PacketEvent event) {
if (!tp && event.getPacket() instanceof C03PacketPlayer) {
event.cancelEvent();
}
if (event.getPacket() instanceof S08PacketPlayerPosLook) {
if (!this.tp) {
s08.reset();
this.tp = true;
mc.thePlayer.addChatMessage(new ChatComponentText("§8[§9§l" + LiquidBounce.CLIENT_NAME+ "§8] §3"+ "Fly Now!"));
if(hd.no.get()) {
ChatUtil.sendClientMessage("Now u can fly!", Notificationsn.Type.SUCCESS);
}
}
}
if (this.tp){
if(s08.hasTimePassed(1500)){
if (event.getPacket() instanceof S08PacketPlayerPosLook) {
ClientUtils.displayChatMessage("§8[§c§lDisablerHypixel-§a§lFly§8] §cSetback detected.");
s08.reset();
toggle();
}
}
}
}
}
// NOTE (AI): The full LastestHypixelFly module: onEnable sends the C13 isFlying declaration with the C0F sentinel and two C04 hops, onDisable retracts it, and the send handler cancels all C03 until the first S08 authorizes the position. The LiquidBounce Fly Zoom mode sends the same C13 before its blink-buffer flush.Send C13 ability packets as part of the path-teleport rig: an isFlying declaration on enable, and per-node ability spam along the C04 path.
Tp's onEnable declares isFlying true (with the C0F sentinel and two C04 hops), then on the first S08 it walks a pathfinding route emitting C04 packets (fall-distance hops of 0.0601, 5.0E-4 and 0.00499999...) plus a C0C input, then snaps the player to the destination. The TeleportCommand twin sends a C13 per path node inside its teleport thread: invulnerable, creative, flying and allowFlying all false, flySpeed 1.0E8F and walkSpeed 1.0E8F minus 1F, absurd values aimed at parsers that read the floats before the vanilla handler discards them.
// ===== FILE: LiquidSense Dev, net/ccbluex/liquidbounce/features/command/commands/TeleportCommand.java =====
package net.ccbluex.liquidbounce.features.command.commands;
import com.google.gson.JsonObject;
import com.google.gson.JsonParser;
import me.AquaVit.liquidSense.modules.world.LightningCheck;
import me.AquaVit.liquidSense.modules.world.LookTp;
import net.ccbluex.liquidbounce.LiquidBounce;
import net.ccbluex.liquidbounce.event.EventTarget;
import net.ccbluex.liquidbounce.event.MotionEvent;
import net.ccbluex.liquidbounce.event.MoveEvent;
import net.ccbluex.liquidbounce.event.PacketEvent;
import net.ccbluex.liquidbounce.features.command.Command;
import net.ccbluex.liquidbounce.features.module.modules.render.Rotations;
import net.ccbluex.liquidbounce.utils.AStarCustomPathFinder;
import net.ccbluex.liquidbounce.utils.ClientUtils;
import net.ccbluex.liquidbounce.utils.CustomVec3;
import net.ccbluex.liquidbounce.utils.MovementUtils;
import net.ccbluex.liquidbounce.utils.timer.TimeUtils;
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.command.CommandException;
import net.minecraft.entity.Entity;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.init.Blocks;
import net.minecraft.network.play.client.C03PacketPlayer;
import net.minecraft.network.play.client.C13PacketPlayerAbilities;
import net.minecraft.network.play.server.S08PacketPlayerPosLook;
import net.minecraft.util.BlockPos;
import net.minecraft.util.Vec3;
import org.jetbrains.annotations.NotNull;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.net.HttpURLConnection;
import java.net.URL;
import java.util.ArrayList;
public class TeleportCommand extends Command {
public static BlockPos target;
public Entity targetEntity;
public TimeUtils timer = new TimeUtils();
public TimeUtils tpreset = new TimeUtils();
public boolean tp;
int PlayerY;
private ArrayList<CustomVec3> path = new ArrayList<>();
private boolean tryCancelPacket;
public TeleportCommand() {
super("tp", new String[0]);
}
@Override
public void execute(@NotNull String[] args) {
if (args.length == 0) {
ClientUtils.displayChatMessage("[Teleport] Please type X Y Z");
}
try {
timer.reset();
tp = false;
targetEntity = null;
target = null;
if (args.length == 3) {
target = new BlockPos(Integer.parseInt(args[0]), Integer.parseInt(args[1]), Integer.parseInt(args[2]));
} else if (args.length == 2) {
if (!args[0].contains("LN")) {
for (Entity entity : mc.theWorld.loadedEntityList) {
if (entity instanceof EntityPlayer && mc.thePlayer != entity) {
if (entity.getName().equalsIgnoreCase(args[0])) {
targetEntity = entity;
PlayerY = Integer.parseInt(args[1]);
break;
}
}
}
if (targetEntity == null) {
ClientUtils.displayChatMessage("Can not locate " + args[0]);
return;
} else {
ClientUtils.displayChatMessage("Located Player " + targetEntity.getName() + "And Pos Y Added " + PlayerY + " !");
}
}
} else if (args.length == 1) {
if (args[0].contains("FN")) {
target = new BlockPos(LightningCheck.x, LightningCheck.y, LightningCheck.z);
ClientUtils.displayChatMessage("Located Lighting " + "!");
}
/*
if (args[0].contains("TCK")) {
target = new BlockPos(LookTp., ClickTP.y_new, ClickTP.z_new);
ClientUtils.displayChatMessage("Located Click Point " + "!");
}
*/
if (!args[0].contains("LN") && !args[0].contains("TCK")) {
for (Entity entity : mc.theWorld.loadedEntityList) {
if (entity instanceof EntityPlayer && mc.thePlayer != entity) {
if (entity.getName().equalsIgnoreCase(args[0])) {
targetEntity = entity;
PlayerY = 0;
break;
}
}
}
if (targetEntity == null) {
ClientUtils.displayChatMessage("Can not locate " + args[0]);
return;
} else {
ClientUtils.displayChatMessage("Located Player " + targetEntity.getName() + "And Pos Y Added " + PlayerY + " !");
}
}
}
mc.getNetHandler().addToSendQueue(new C03PacketPlayer.C06PacketPlayerPosLook(mc.thePlayer.posX, mc.thePlayer.posY + 0.41999998688697815, mc.thePlayer.posZ, mc.thePlayer.rotationYaw, mc.thePlayer.rotationPitch, false));
mc.getNetHandler().addToSendQueue(new C03PacketPlayer.C06PacketPlayerPosLook(mc.thePlayer.posX, mc.thePlayer.posY + 0.675319998688697815, mc.thePlayer.posZ, mc.thePlayer.rotationYaw, mc.thePlayer.rotationPitch, false));
tryCancelPacket = true;
} catch (Exception e) {
// TODO: handle exception
}
}
@EventTarget
public void onMove(MoveEvent e) {
if (tryCancelPacket) {
e.cancelEvent();
}
}
@EventTarget
public void onPacket(PacketEvent e) {
if (tryCancelPacket && (e.getPacket() instanceof C03PacketPlayer.C04PacketPlayerPosition || e.getPacket() instanceof C03PacketPlayer.C06PacketPlayerPosLook || e.getPacket() instanceof C03PacketPlayer.C05PacketPlayerLook)) {
e.cancelEvent();
}
if (e.getPacket() instanceof S08PacketPlayerPosLook) {
S08PacketPlayerPosLook packet = (S08PacketPlayerPosLook) e.getPacket();
packet.pitch = mc.thePlayer.rotationPitch;
packet.yaw = mc.thePlayer.rotationYaw;
tryCancelPacket = false;
if (e.getPacket() instanceof S08PacketPlayerPosLook) {
if (!tp) {
ClientUtils.displayChatMessage("暂时绕过反作弊!");
tp = true;
e.cancelEvent();
}
}
}
}
@EventTarget
private void onUpdate(MotionEvent event) {
if (timer.hasReached(8500)) {
ClientUtils.displayChatMessage("Failed to teleport.");
}
if (tp) {
tp = false;
CustomVec3 topFrom = new CustomVec3(mc.thePlayer.posX, mc.thePlayer.posY, mc.thePlayer.posZ);
if (target == null)
target = new BlockPos(targetEntity.posX, targetEntity.posY + PlayerY, targetEntity.posZ);
CustomVec3 to = new CustomVec3(target.getX(), target.getY(), target.getZ());
path = computePath(topFrom, to);
tpreset.reset();
ClientUtils.displayChatMessage("Teleporting to X:" + target.getX() + " Y:" + target.getY() + " Z:" + target.getZ());
new Thread() {
@Override
public void run() {
try {
sleep(1000);
} catch (InterruptedException interruptedException) {
interruptedException.printStackTrace();
}
for (CustomVec3 pathElm : path) {
mc.thePlayer.sendQueue.getNetworkManager().sendPacket(new C03PacketPlayer.C04PacketPlayerPosition(pathElm.getX(), pathElm.getY(), pathElm.getZ(), true));
C13PacketPlayerAbilities packet = new C13PacketPlayerAbilities();
packet.setInvulnerable(false);
packet.setCreativeMode(false);
packet.setFlying(false);
packet.setAllowFlying(false);
packet.setFlySpeed(1.0E8F);
packet.setWalkSpeed(1.0E8F - 1F);
mc.getNetHandler().getNetworkManager().sendPacket(packet);
}
mc.thePlayer.sendQueue.getNetworkManager().sendPacket(new C03PacketPlayer.C04PacketPlayerPosition(target.getX(), target.getY(), target.getZ(), mc.thePlayer.onGround));
mc.thePlayer.setPosition(target.getX(), target.getY(), target.getZ());
mc.thePlayer.sendQueue.getNetworkManager().sendPacket(new C03PacketPlayer.C04PacketPlayerPosition(target.getX(), target.getY() - MovementUtils.getDistanceToGround(mc.thePlayer), target.getZ(), mc.thePlayer.onGround));
mc.thePlayer.setPosition(target.getX(), target.getY() - MovementUtils.getDistanceToGround(mc.thePlayer), target.getZ());
ClientUtils.displayChatMessage("Teleported!");
}
}.start();
}
}
private ArrayList<CustomVec3> computePath(CustomVec3 topFrom, CustomVec3 to) {
if (!canPassThrow(new BlockPos(topFrom.mc()))) {
topFrom = topFrom.addVector(0, 1, 0);
}
AStarCustomPathFinder pathfinder = new AStarCustomPathFinder(topFrom, to);
pathfinder.compute();
int i = 0;
CustomVec3 lastLoc = null;
CustomVec3 lastDashLoc = null;
ArrayList<CustomVec3> path = new ArrayList<CustomVec3>();
ArrayList<CustomVec3> pathFinderPath = pathfinder.getPath();
for (CustomVec3 pathElm : pathFinderPath) {
if (i == 0 || i == pathFinderPath.size() - 1) {
if (lastLoc != null) {
path.add(lastLoc.addVector(0.5, 0, 0.5));
}
path.add(pathElm.addVector(0.5, 0, 0.5));
lastDashLoc = pathElm;
} else {
boolean canContinue = true;
if (pathElm.squareDistanceTo(lastDashLoc) > 5 * 5) {
canContinue = false;
} else {
double smallX = Math.min(lastDashLoc.getX(), pathElm.getX());
double smallY = Math.min(lastDashLoc.getY(), pathElm.getY());
double smallZ = Math.min(lastDashLoc.getZ(), pathElm.getZ());
double bigX = Math.max(lastDashLoc.getX(), pathElm.getX());
double bigY = Math.max(lastDashLoc.getY(), pathElm.getY());
double bigZ = Math.max(lastDashLoc.getZ(), pathElm.getZ());
cordsLoop:
for (int x = (int) smallX; x <= bigX; x++) {
for (int y = (int) smallY; y <= bigY; y++) {
for (int z = (int) smallZ; z <= bigZ; z++) {
if (!AStarCustomPathFinder.checkPositionValidity(x, y, z, false)) {
canContinue = false;
break cordsLoop;
}
}
}
}
}
if (!canContinue) {
path.add(lastLoc.addVector(0.5, 0, 0.5));
lastDashLoc = lastLoc;
}
}
lastLoc = pathElm;
i++;
}
return path;
}
private boolean canPassThrow(BlockPos pos) {
Block block = mc.theWorld.getBlockState(new net.minecraft.util.BlockPos(pos.getX(), pos.getY(), pos.getZ())).getBlock();
return block.getMaterial() == Material.air || block.getMaterial() == Material.plants || block.getMaterial() == Material.vine || block == Blocks.ladder || block == Blocks.water || block == Blocks.flowing_water || block == Blocks.wall_sign || block == Blocks.standing_sign;
}
}
// NOTE (AI): The full TeleportCommand: the teleport thread walks the computed path, sending C04 per node and a C13 with flySpeed 1.0E8F and walkSpeed 1.0E8F minus 1F on every node, then snaps the player to the target and drops to the ground. The absurd floats are the corpus hit; the Tp module's onEnable uses the same declaration style.anticheat Anti-Cheat Checks
The abilities packet carries the client's fly toggle and speed multipliers, but the vanilla server ignores every flag except isFlying. Server-side anticheats therefore treat C13 as a state signal: it tells them when the player believes they are allowed to fly, which they must reconcile against the abilities the server actually granted. Movement checks such as creative fly, nofall and vertical speed use this state to decide which physics model applies. Because the client can send the toggle out of order relative to the server abilities packet, modern anticheats confirm the state change with a transaction before trusting it.
Reconciles the client's fly toggle with the server's granted abilities and punishes players who keep flying after the server revoked flight.
Listens for both the inbound PLAYER_ABILITIES packet and the outbound server abilities packet. On the inbound side it sets the player's isFlying flag only if the server allows flight, so a spoofed toggle cannot enable flight. On the outbound side it sends a transaction, and when the server revokes flight it schedules a netty task: if the client has not confirmed the transaction within maxFlyingPing (default 1000 ms), the player is set back for still flying. The comment in the file explains that ability packets can arrive out of order, so the state change is applied on a later tick.
// ===== FILE: GrimAnticheat-Grim, common/src/main/java/ac/grim/grimac/events/packets/PacketPlayerAbilities.java =====
package ac.grim.grimac.events.packets;
import ac.grim.grimac.api.config.ConfigManager;
import ac.grim.grimac.checks.Check;
import ac.grim.grimac.checks.type.PacketReceiveListener;
import ac.grim.grimac.checks.type.PacketSendListener;
import ac.grim.grimac.player.GrimPlayer;
import com.github.retrooper.packetevents.event.PacketReceiveEvent;
import com.github.retrooper.packetevents.event.PacketSendEvent;
import com.github.retrooper.packetevents.protocol.packettype.PacketType;
import com.github.retrooper.packetevents.wrapper.play.client.WrapperPlayClientPlayerAbilities;
import com.github.retrooper.packetevents.wrapper.play.server.WrapperPlayServerPlayerAbilities;
import org.jetbrains.annotations.NotNull;
// The client can send ability packets out of order due to Mojang's excellent netcode design.
// We must delay the second ability packet until the tick after the first is received
// Else the player will fly for a tick, and we won't know about it, which is bad.
public class PacketPlayerAbilities extends Check implements PacketReceiveListener, PacketSendListener {
private boolean lastSentPlayerCanFly = false;
private int maxFlyingPing = 1000;
public PacketPlayerAbilities(GrimPlayer player) {
super(player);
}
@Override
public void onPacketReceive(PacketReceiveEvent event) {
if (event.getPacketType() == PacketType.Play.Client.PLAYER_ABILITIES) {
WrapperPlayClientPlayerAbilities abilities = new WrapperPlayClientPlayerAbilities(event);
player.isFlying = abilities.isFlying() && player.canFly;
}
}
@Override
public void onPacketSend(PacketSendEvent event) {
if (event.getPacketType() == PacketType.Play.Server.PLAYER_ABILITIES) {
WrapperPlayServerPlayerAbilities abilities = new WrapperPlayServerPlayerAbilities(event);
player.sendTransaction();
if (lastSentPlayerCanFly && !abilities.isFlightAllowed()) {
int noFlying = player.lastTransactionSent.get();
if (maxFlyingPing != -1) {
player.runNettyTaskInMs(() -> {
if (player.lastTransactionReceived.get() < noFlying) {
player.getSetbackTeleportUtil().executeViolationSetback();
}
}, maxFlyingPing);
}
}
lastSentPlayerCanFly = abilities.isFlightAllowed();
player.latencyUtils.addRealTimeTask(player.lastTransactionSent.get(), () -> {
player.canFly = abilities.isFlightAllowed();
player.isFlying = abilities.isFlying();
});
}
}
@Override
public void onReload(@NotNull ConfigManager config) {
maxFlyingPing = config.getIntElse("max-ping-out-of-flying", 1000);
}
}
// NOTE (AI): This handler is a state manager rather than a flagging check; the transaction timeout is the enforcement mechanism. It was included because it is the only anticheat file in the corpus dedicated to the abilities packet itself.Vertical and horizontal envelope check for creative and spectator players, where flying is legal and the survival flight model does not apply.
Runs on every move while the player is in creative or spectator mode or is flying. It builds a ModelFlying from the move data, computes a horizontal limit from the fly speed attribute, the flySpeed sent in the abilities packet, sprint modifiers and air friction, and a vertical limit per direction: ascend, descend and hold altitude. Distance beyond the limits accumulates creativeFlyVL; queued velocity can consume the violation. On cancel it returns a setback location, corrected if it exceeds the world height.
// ===== FILE: Updated-NoCheatPlus-NoCheatPlus, NCPCore/src/main/java/fr/neatmonster/nocheatplus/checks/moving/player/CreativeFly.java =====
/*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package fr.neatmonster.nocheatplus.checks.moving.player;
import java.util.LinkedList;
import java.util.List;
import java.util.Locale;
import org.bukkit.GameMode;
import org.bukkit.Location;
import org.bukkit.World;
import org.bukkit.entity.Player;
import fr.neatmonster.nocheatplus.NCPAPIProvider;
import fr.neatmonster.nocheatplus.actions.ParameterName;
import fr.neatmonster.nocheatplus.checks.Check;
import fr.neatmonster.nocheatplus.checks.CheckType;
import fr.neatmonster.nocheatplus.checks.ViolationData;
import fr.neatmonster.nocheatplus.checks.moving.MovingConfig;
import fr.neatmonster.nocheatplus.checks.moving.MovingData;
import fr.neatmonster.nocheatplus.checks.moving.envelope.workaround.LostGround;
import fr.neatmonster.nocheatplus.checks.moving.model.LiftOffEnvelope;
import fr.neatmonster.nocheatplus.checks.moving.model.ModelFlying;
import fr.neatmonster.nocheatplus.checks.moving.model.PlayerMoveData;
import fr.neatmonster.nocheatplus.compat.BridgeMisc;
import fr.neatmonster.nocheatplus.compat.blocks.changetracker.BlockChangeTracker;
import fr.neatmonster.nocheatplus.components.modifier.IAttributeAccess;
import fr.neatmonster.nocheatplus.components.registry.event.IGenericInstanceHandle;
import fr.neatmonster.nocheatplus.players.IPlayerData;
import fr.neatmonster.nocheatplus.utilities.StringUtil;
import fr.neatmonster.nocheatplus.utilities.location.PlayerLocation;
import fr.neatmonster.nocheatplus.utilities.math.TrigUtil;
import fr.neatmonster.nocheatplus.utilities.moving.Magic;
import fr.neatmonster.nocheatplus.utilities.moving.MovingUtil;
/**
* A check designed for players that are either in Creative or Spectator mode
*/
public class CreativeFly extends Check {
private final List<String> tags = new LinkedList<String>();
private final BlockChangeTracker blockChangeTracker;
private final IGenericInstanceHandle<IAttributeAccess> attributeAccess = NCPAPIProvider.getNoCheatPlusAPI().getGenericInstanceHandle(IAttributeAccess.class);
/**
* Instantiates a new creative fly check.
*/
public CreativeFly() {
super(CheckType.MOVING_CREATIVEFLY);
blockChangeTracker = NCPAPIProvider.getNoCheatPlusAPI().getBlockChangeTracker();
}
/**
* Checks a player
*
* @param player
* @param from
* @param to
* @param data
* @param cc
* @param time Milliseconds.
* @return
*/
public Location check(final Player player, final PlayerLocation from, final PlayerLocation to,
final MovingData data, final MovingConfig cc, final IPlayerData pData,
final long time, final int tick,
final boolean useBlockChangeTracker) {
// Reset tags, just in case.
tags.clear();
final boolean debug = pData.isDebugActive(type);
final GameMode gameMode = player.getGameMode();
final PlayerMoveData thisMove = data.playerMoves.getCurrentMove();
final PlayerMoveData lastMove = data.playerMoves.getFirstPastMove();
final ModelFlying model = thisMove.modelFlying;
final double yDistance = thisMove.yDistance;
final double hDistance = thisMove.hDistance;
final boolean flying = gameMode == BridgeMisc.GAME_MODE_SPECTATOR || player.isFlying();
final boolean sprinting = player.isSprinting();
// Lost ground, if set so.
if (model.getGround()) {
MovingUtil.prepareFullCheck(from, to, thisMove, Math.max(cc.yOnGround, cc.noFallyOnGround));
LostGround.runLostGroundChecks(player, from, to, hDistance, yDistance, lastMove, data, cc, useBlockChangeTracker ? blockChangeTracker : null, tags);
}
//////////////////////////
// Horizontal move.
//////////////////////////
double[] resH = hDist(player, from, to, hDistance, yDistance, sprinting, flying, thisMove, lastMove, time, model, data, cc);
double limitH = resH[0];
double resultH = resH[1];
// Check velocity.
//TODO: Add velocity
// if (resultH > 0) {
// double hFreedom = data.getHorizontalFreedom();
// if (hFreedom < resultH) {
// // Use queued velocity if possible.
// hFreedom += data.useHorizontalVelocity(resultH - hFreedom);
// }
// if (hFreedom > 0.0) {
// resultH = Math.max(0.0, resultH - hFreedom);
// if (resultH <= 0.0) {
// limitH = hDistance;
// }
// tags.add("hvel");
// }
// }
// else {
// data.clearActiveHorVel(); // TODO: test/check !
// }
resultH *= 100.0; // Normalize to % of a block.
if (resultH > 0.0) {
tags.add("hdist");
}
//////////////////////////
// Vertical move.
//////////////////////////
double limitV = 0.0; // Limit. For debug only, violation handle on resultV
double resultV = 0.0; // Violation (normalized to 100 * 1 block, applies if > 0.0).
// Distinguish checking method by y-direction of the move:
// Ascend.
if (yDistance > 0.0) {
double[] res = vDistAscend(from, to, yDistance, flying, thisMove, lastMove, model, data, cc, debug);
resultV = Math.max(resultV, res[1]);
limitV = res[0];
}
// Descend.
else if (yDistance < 0.0) {
double[] res = vDistDescend(from, to, yDistance, flying, thisMove, lastMove, model, data, cc);
resultV = Math.max(resultV, res[1]);
limitV = res[0];
}
// Keep altitude.
else {
double[] res = vDistZero();
resultV = Math.max(resultV, res[1]);
limitV = res[0];
}
// Velocity.
if (resultV > 0.0 && (!thisMove.verVelUsed.isEmpty() || !data.getOrUseVerticalVelocity(yDistance).isEmpty())) {
resultV = 0.0;
tags.add("vvel");
}
// Add tag for maximum height check (silent set back).
// TODO: Allow use velocity there (would need a flag to signal the actual check below)?
final double maximumHeight = model.getMaxHeight() + player.getWorld().getMaxHeight();
if (to.getY() > maximumHeight) {
tags.add("maxheight");
}
resultV *= 100.0; // Normalize to % of a block.
if (resultV > 0.0) {
tags.add("vdist");
}
final double result = Math.max(0.0, resultH) + Math.max(0.0, resultV);
//////////////////////////
// Output debug
//////////////////////////
if (debug) {
outpuDebugMove(player, hDistance, limitH, yDistance, limitV, model, tags, data);
}
///////////////////////
// Violation handling
///////////////////////
Location setBack = null; // Might get altered below.
if (result > 0.0) {
data.creativeFlyVL += result;
// Execute whatever actions are associated with this check and the violation level and find out if we
// should cancel the event.
final ViolationData vd = new ViolationData(this, player, data.creativeFlyVL, result, cc.creativeFlyActions);
if (vd.needsParameters()) {
vd.setParameter(ParameterName.LOCATION_FROM, String.format(Locale.US, "%.2f, %.2f, %.2f", from.getX(), from.getY(), from.getZ()));
vd.setParameter(ParameterName.LOCATION_TO, String.format(Locale.US, "%.2f, %.2f, %.2f", to.getX(), to.getY(), to.getZ()));
vd.setParameter(ParameterName.DISTANCE, String.format(Locale.US, "%.2f", TrigUtil.distance(from, to)));
if (model != null) {
vd.setParameter(ParameterName.MODEL, model.getId().toString());
}
if (!tags.isEmpty()) {
vd.setParameter(ParameterName.TAGS, StringUtil.join(tags, "+"));
}
}
if (executeActions(vd).willCancel()) {
// Compose a new location based on coordinates of "newTo" and viewing direction of "event.getTo()"
// to allow the player to look somewhere else despite getting pulled back by NoCheatPlus.
setBack = data.getSetBack(to); // (OK)
}
}
else {
// Maximum height check (silent set back).
if (to.getY() > maximumHeight) {
setBack = data.getSetBack(to); // (OK)
if (debug) {
debug(player, "Maximum height exceeded, silent set-back.");
}
}
if (setBack == null) {
// Slowly reduce the violation level with each event.
data.creativeFlyVL *= 0.97;
}
}
// Return setBack, if set.
if (setBack != null) {
// Check for max height of the set back.
if (setBack.getY() > maximumHeight) {
// Correct the y position.
setBack.setY(getCorrectedHeight(maximumHeight, setBack.getWorld()));
if (debug) {
debug(player, "Maximum height exceeded by set back, correct to: " + setBack.getY());
}
}
data.sfJumpPhase = 0;
return setBack;
}
else {
// Adjust the set back and other last distances.
data.setSetBack(to);
// Adjust jump phase.
if (!thisMove.from.onGroundOrResetCond && !thisMove.to.onGroundOrResetCond) {
data.sfJumpPhase ++;
}
else if (thisMove.touchedGround && !thisMove.to.onGroundOrResetCond) {
data.sfJumpPhase = 1;
}
else {
data.sfJumpPhase = 0;
}
return null;
}
}
/**
* Horizontal distance checking.
* @param player
* @param from
* @param to
* @param hDistance
* @param yDistance
* @param flying
* @param lastMove
* @param time
* @param model
* @param data
* @param cc
* @return limitH, resultH (not normalized).
*/
private double[] hDist(final Player player, final PlayerLocation from, final PlayerLocation to, final double hDistance,
final double yDistance, final boolean sprinting, final boolean flying, final PlayerMoveData thisMove,
final PlayerMoveData lastMove, final long time, final ModelFlying model, final MovingData data, final MovingConfig cc) {
// Modifiers.
double fSpeed;
// TODO: Make this configurable ! [Speed effect should not affect flying if not on ground.]
if (model.getApplyModifiers()) {
final double speedModifier = mcAccess.getHandle().getFasterMovementAmplifier(player);
if (Double.isInfinite(speedModifier)) fSpeed = 1.0;
else fSpeed = 1.0 + 0.2 * (speedModifier + 1.0);
if (flying) {
// TODO: Consider mechanics for flying backwards.
fSpeed *= data.flySpeed / Magic.DEFAULT_FLYSPEED;
if (sprinting) {
// TODO: Prevent for pre-1.8?
fSpeed *= model.getHorizontalModSprint();
tags.add("sprint");
}
tags.add("flying");
}
// else {
// // (Ignore sprinting here).
// final double attrMod = attributeAccess.getHandle().getSpeedAttributeMultiplier(player);
// if (attrMod != Double.MAX_VALUE) fSpeed *= attrMod;
// fSpeed *= data.walkSpeed / Magic.CB_DEFAULT_WALKSPEED;
// }
}
else fSpeed = 1.0;
// The horizontal limit is now set.
double limitH = model.getHorizontalModSpeed() / 100.0 * ModelFlying.HORIZONTAL_SPEED * fSpeed;
// Ordinary friction
// TODO: Use last friction (as well)?
// TODO: Test/adjust more.
// it doesn't really make much sense checking for friction as well...
if (lastMove.toIsValid) {
double frictionDist = lastMove.hDistance * Magic.FRICTION_MEDIUM_AIR;
limitH = Math.max(frictionDist, limitH);
tags.add("hfrict");
}
// Finally, determine how far the player went beyond the set limits.
double resultH = Math.max(0.0, hDistance - limitH);
if (model.getApplyModifiers()) {
data.jumpDelay--;
//TODO: Remove this useless shit.
if (!flying && resultH > 0 && resultH < 0.3) {
// 0: yDistance envelope
if (yDistance >= 0.0 &&
(
// 1: Normal jumping.
yDistance > 0.0
&& yDistance > LiftOffEnvelope.NORMAL.getJumpGain(data.jumpAmplifier) - Magic.GRAVITY_SPAN
// 1: Too short with head obstructed.
|| thisMove.headObstructed || lastMove.toIsValid && lastMove.headObstructed && lastMove.yDistance <= 0.0
// 1: Hop without y distance increase at moderate h-speed.
// TODO: 2nd below: demand next move to jump. Relate to stored past moves.
// TODO: Ensure the gain can only be used once per so and so.
//|| (cc.sfGroundHop || yDistance == 0.0 && !lastMove.touchedGroundWorkaround && !lastMove.from.onGround)
//&& limitH > 0.0 && hDistance / limitH < 1.5
//&& (hDistance / lastMove.hDistance < 1.35
// || hDistance / limitH < 1.35)
)
// 0: Ground + jump phase conditions.
&& (data.sfJumpPhase <= 1 && (thisMove.touchedGroundWorkaround ||
lastMove.touchedGround && !lastMove.bunnyHop))
// 0: Don't allow bunny to run out of liquid.
&& (!from.isResetCond() && !to.isResetCond()) // TODO: !to.isResetCond() should be reviewed.
) {
tags.add("bunnyhop");
data.jumpDelay = 9;
thisMove.bunnyHop = true;
resultH = 0.0;
}
else if (data.jumpDelay <= 0) {
resultH = 0.0;
tags.add("bunnyhop");
}
}
}
return new double[] {limitH, resultH};
}
/**
* Ascending (yDistance > 0.0) check.
* @param from
* @param to
* @param yDistance
* @param flying
* @param lastMove
* @param model
* @param data
* @param cc
* @return limitV, resultV (not normalized).
*/
private double[] vDistAscend(final PlayerLocation from, final PlayerLocation to, final double yDistance,
final boolean flying, final PlayerMoveData thisMove, final PlayerMoveData lastMove,
final ModelFlying model, final MovingData data, final MovingConfig cc, final boolean debug) {
// Set the vertical limit.
double limitV = model.getVerticalAscendModSpeed() / 100.0 * ModelFlying.VERTICAL_ASCEND_SPEED;
double resultV = 0.0;
// Let fly speed apply with moving upwards.
if (model.getApplyModifiers() && flying && yDistance > 0.0) {
limitV *= data.flySpeed / Magic.DEFAULT_FLYSPEED;
}
// Friction with gravity.
if (model.getGravity()) {
if (yDistance > limitV && lastMove.toIsValid) {
// (Disregard gravity.)
// TODO: Use last friction (as well)?
double frictionDist = lastMove.yDistance * Magic.FRICTION_MEDIUM_AIR;
if (!flying) {
frictionDist -= 0.019;
}
if (frictionDist > limitV) {
limitV = frictionDist;
tags.add("vfrict_g");
}
}
}
if (model.getGround()) {
// Jump lift off gain.
// NOTE: This assumes SurvivalFly busies about moves with from.onGroundOrResetCond.
if (yDistance > limitV && !thisMove.to.onGroundOrResetCond && !thisMove.from.onGroundOrResetCond && (
// Last move touched ground.
lastMove.toIsValid && lastMove.touchedGround &&
(lastMove.yDistance <= 0.0 || lastMove.to.extraPropertiesValid && lastMove.to.onGround)
// This move touched ground by a workaround.
|| thisMove.touchedGroundWorkaround
)) {
// Allow normal jumping.
final double maxGain = LiftOffEnvelope.NORMAL.getJumpGain(data.jumpAmplifier);
if (maxGain > limitV) {
limitV = maxGain;
tags.add("jump_gain");
}
}
}
// Ordinary step up.
// TODO: Might be within a 'if (model.ground)' block?
// TODO: sfStepHeight should be a common modeling parameter?
if (yDistance > limitV && yDistance <= cc.sfStepHeight
&& (lastMove.toIsValid && lastMove.yDistance < 0.0 || from.isOnGroundOrResetCond() || thisMove.touchedGroundWorkaround)
&& to.isOnGround()) {
// (Jump effect not checked yet.)
limitV = cc.sfStepHeight;
tags.add("step_up");
}
// Determine violation amount.
resultV = Math.max(0.0, yDistance - limitV);
// Post-violation recovery.
return new double[] {limitV, resultV};
}
/**
* Descending phase vDist check
* @param from
* @param to
* @param yDistance
* @param flying
* @param thisMove
* @param lastMove
* @param model
* @param data
* @param cc
* @return limitV, resultV
*/
private double[] vDistDescend(final PlayerLocation from, final PlayerLocation to, final double yDistance, final boolean flying,
final PlayerMoveData thisMove, final PlayerMoveData lastMove, final ModelFlying model,
final MovingData data, final MovingConfig cc) {
double limitV = 0.0;
double resultV = 0.0;
// Note that 'extreme moves' are covered by the extreme move check.
// TODO: if gravity: friction + gravity.
// TODO: ordinary flying (flying: enforce maximum speed at least)
return new double[] {limitV, resultV};
}
/**
* Keep the altitude
*
* @return limitV, resultV
*/
private double[] vDistZero() {
double limitV = 0.0;
double resultV = 0.0;
return new double[] {limitV, resultV};
}
/**
*
* @param maximumHeight
* @param world
* @return
*/
private double getCorrectedHeight(final double maximumHeight, final World world) {
return Math.max(maximumHeight - 10.0, world.getMaxHeight());
}
/**
* Output debug
* @param player
* @param hDistance
* @param limitH
* @param yDistance
* @param limitV
* @param model
* @param tags
* @param data
* @return
*/
private void outpuDebugMove(final Player player, final double hDistance, final double limitH,
final double yDistance, final double limitV, final ModelFlying model, final List<String> tags,
final MovingData data) {
final PlayerMoveData lastMove = data.playerMoves.getFirstPastMove();
StringBuilder builder = new StringBuilder(350);
final String dHDist = lastMove.toIsValid ? " (" + StringUtil.formatDiff(hDistance, lastMove.hDistance) + ")" : "";
final String dYDist = lastMove.toIsValid ? " (" + StringUtil.formatDiff(yDistance, lastMove.yDistance)+ ")" : "";
builder.append("hDist: " + hDistance + dHDist + " / " + limitH + " , vDist: " + yDistance + dYDist + " / " + limitV);
final PlayerMoveData thisMove = data.playerMoves.getCurrentMove();
if (lastMove.toIsValid) {
builder.append(" , fdsq: " + StringUtil.fdec3.format(thisMove.distanceSquared / lastMove.distanceSquared));
}
if (thisMove.verVelUsed != null) {
builder.append(" , vVelUsed: " + thisMove.verVelUsed);
}
builder.append(" , model: " + model.getId());
if (!tags.isEmpty()) {
builder.append(" , tags: ");
builder.append(StringUtil.join(tags, "+"));
}
builder.append(" , jumpphase: " + data.sfJumpPhase);
thisMove.addExtraProperties(builder, " , ");
debug(player, builder.toString());
}
}
// NOTE (AI): The abilities packet is not read here directly; the flying flag and flySpeed it carries arrive through the MovingFlying adapter that prepares the PlayerMoveData model. The file is included as the canonical creative-fly envelope check.Lag-compensated copy of the client's ability flags used by Hydro's movement and emulation checks.
A small plain class holding godMode, flying, flightAllowed, creativeMode, walkSpeed and flySpeed. Hydro stores a ConfirmedAbilities instance in the packet state, updates it from the inbound abilities packet, and clones it when the server sends abilities so checks read what the client believes its abilities are at a given tick. The clone method lets the emulation engine snapshot state before applying a move.
// ===== FILE: Incognitolol-Hydro, src/main/java/integral/studios/hydro/util/lag/ConfirmedAbilities.java =====
package integral.studios.hydro.util.lag;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.Setter;
@Getter
@Setter
@AllArgsConstructor
public class ConfirmedAbilities {
private boolean godMode, flying, flightAllowed, creativeMode;
private float walkSpeed, flySpeed;
public ConfirmedAbilities() {
this(
false,
false,
false,
false,
0.1F,
0.05F
);
}
public ConfirmedAbilities clone() {
return new ConfirmedAbilities(godMode, flying, flightAllowed, creativeMode, walkSpeed, flySpeed);
}
}
// NOTE (AI): This is a data holder without timing logic; the default constructor matches vanilla ability defaults (0.1 walk speed, 0.05 fly speed).Tracks the abilities state server-side so the movement simulator knows whether flight is legal for the player.
Registers receiveAbilities and sentAbilities handlers. On the inbound abilities packet it stores the requested flying flag and, only if the server had allowed flying, sets the player's flying state; otherwise it records disabledFlying. The sentAbilities side compares the new server state against the previous one and, when flight is revoked, requires the player to confirm the teleport rate limit before treating the player as grounded again. The tracker is consumed by the Physics simulation checks.
// ===== FILE: intave-intave, src/main/java/de/jpx3/intave/module/tracker/player/AbilityTracker.java =====
package de.jpx3.intave.module.tracker.player;
import com.comphenix.protocol.events.PacketEvent;
import de.jpx3.intave.IntavePlugin;
import de.jpx3.intave.executor.Synchronizer;
import de.jpx3.intave.module.Module;
import de.jpx3.intave.module.Modules;
import de.jpx3.intave.module.linker.packet.ListenerPriority;
import de.jpx3.intave.module.linker.packet.PacketId;
import de.jpx3.intave.module.linker.packet.PacketSubscription;
import de.jpx3.intave.packet.reader.AbilityInReader;
import de.jpx3.intave.packet.reader.AbilityOutReader;
import de.jpx3.intave.packet.reader.EntityReader;
import de.jpx3.intave.packet.reader.GameStateChangeReader;
import de.jpx3.intave.share.Motion;
import de.jpx3.intave.user.MessageChannel;
import de.jpx3.intave.user.User;
import de.jpx3.intave.user.meta.AbilityMetadata;
import de.jpx3.intave.user.meta.MetadataBundle;
import de.jpx3.intave.user.meta.MovementMetadata;
import org.bukkit.ChatColor;
import org.bukkit.Location;
import org.bukkit.entity.Player;
import static de.jpx3.intave.module.linker.packet.PacketId.Client.*;
import static de.jpx3.intave.module.linker.packet.PacketId.Server.*;
import static de.jpx3.intave.packet.reader.GameStateChangeReader.GameState.CHANGE_GAME_MODE;
public final class AbilityTracker extends Module {
@PacketSubscription(packetsOut = CAMERA)
public void receiveCamera(User user, EntityReader reader) {
int entityId = reader.entityId();
user.tickFeedback(() -> synchronizedCameraUpdate(user, entityId));
}
private void synchronizedCameraUpdate(User user, int entityId) {
AbilityMetadata abilityData = user.meta().abilities();
abilityData.hasViewEntity = entityId != user.player().getEntityId();
}
@PacketSubscription(
priority = ListenerPriority.HIGH,
packetsIn = {ABILITIES_IN}
)
public void receiveAbilities(User user, AbilityInReader reader) {
AbilityMetadata abilityData = user.meta().abilities();
MovementMetadata movementData = user.meta().movement();
boolean flying = reader.requestedFlying();
if (abilityData.allowFlying()) {
if (flying) {
abilityData.setFlying(true);
} else {
abilityData.disabledFlying = true;
}
}
}
@PacketSubscription(
priority = ListenerPriority.HIGH,
packetsOut = {
ABILITIES_OUT
}
)
public void sentAbilities(User user, AbilityOutReader reader, PacketEvent event) {
MetadataBundle meta = user.meta();
MovementMetadata movement = meta.movement();
AbilityMetadata abilityData = meta.abilities();
float flyingSpeed = reader.flyingSpeed();
float walkingSpeed = reader.walkingSpeed();
boolean allowedFlight = reader.flyingAllowed();
boolean critical = abilityData.allowFlying() && !allowedFlight && movement.criticalTeleportRateLimiter.tryAcquire();
if (critical /*&& movement.lastTeleport < 20*/) {
// Teleport again to force transaction synchronization
Synchronizer.synchronizeDelayed(() -> {
MovementMetadata moovement = user.meta().movement();
if (moovement.criticalFlyingDisallowStacks > 0) {
Location position = moovement.verifiedLocation().clone();
Player player = user.player();
position.setWorld(player.getWorld());
player.teleport(position);
moovement.criticalFlyingBlockMovementStacks++;
if (user.receives(MessageChannel.DEBUG_TELEPORT)) {
player.sendMessage(IntavePlugin.prefix() + "Teleport to " + player.getLocation().getBlockX() + " " + player.getLocation().getBlockY() + " " + player.getLocation().getBlockZ() + " " + " as " + ChatColor.RED + " not responding to critical flight disallow");
}
}
}, 20);
}
if (critical) {
if (movement.criticalFlyingDisallowStacks++ == 0) {
movement.criticalEnterPosX = movement.verifiedLastPositionX;
movement.criticalEnterPosY = movement.verifiedLastPositionY;
movement.criticalEnterPosZ = movement.verifiedLastPositionZ;
}
}
user.packetTickFeedback(event, () -> {
abilityData.setWalkSpeed(walkingSpeed);
abilityData.setFlySpeed(flyingSpeed);
abilityData.setAllowFlying(allowedFlight);
if (critical) {
if (movement.criticalFlyingDisallowStacks > 0) {
movement.criticalFlyingDisallowStacks--;
}
movement.criticalFlyingBlockMovementStacks = 0;
}
});
}
@PacketSubscription(
priority = ListenerPriority.HIGH,
packetsIn = {FLYING, PacketId.Client.POSITION, LOOK, POSITION_LOOK}
)
public void incomingFlyingUpdate(User user, Player player) {
MovementMetadata movementData = user.meta().movement();
if (movementData.criticalFlyingDisallowStacks > 0 &&
!movementData.criticalFlyingDisallowWasTeleported
) {
double deltaX = movementData.verifiedLastPositionX - movementData.criticalEnterPosX;
double deltaY = movementData.verifiedLastPositionY - movementData.criticalEnterPosY;
double deltaZ = movementData.verifiedLastPositionZ - movementData.criticalEnterPosZ;
double distance = Math.sqrt(deltaX * deltaX + deltaY * deltaY + deltaZ * deltaZ);
if (distance > 3 && movementData.criticalTeleportRateLimiter.tryAcquire()) {
Modules.mitigate().movement().emulationSetBack(player, Motion.newEmpty(), 3, 2, false);
if (user.receives(MessageChannel.DEBUG_TELEPORT)) {
player.sendMessage(IntavePlugin.prefix() + "Teleport to " + player.getLocation().getBlockX() + " " + player.getLocation().getBlockY() + " " + player.getLocation().getBlockZ() + " " + " for " + ChatColor.RED + " critical flying disallow protection");
}
movementData.criticalFlyingDisallowStacks = 0;
}
} else if (movementData.criticalFlyingBlockMovementStacks > 0 && movementData.criticalTeleportRateLimiter.tryAcquire()) {
Synchronizer.synchronize(() -> {
player.teleport(player.getLocation());
});
if (user.receives(MessageChannel.DEBUG_TELEPORT)) {
player.sendMessage(IntavePlugin.prefix() + "Teleport to " + player.getLocation().getBlockX() + " " + player.getLocation().getBlockY() + " " + player.getLocation().getBlockZ() + " " + " for " + ChatColor.RED + " critical flying disallow protection (movement block)");
}
}
}
@PacketSubscription(
packetsOut = PacketId.Server.POSITION
)
public void outgoingPositionUpdate(User user) {
MovementMetadata movementData = user.meta().movement();
movementData.criticalFlyingDisallowWasTeleported = movementData.criticalFlyingDisallowStacks == 1;
}
@PacketSubscription(
priority = ListenerPriority.NORMAL,
packetsOut = {
GAME_STATE_CHANGE
}
)
public void outgoingGameModeUpdate(
User user, GameStateChangeReader reader
) {
if (reader.type() != CHANGE_GAME_MODE) {
return;
}
GameMode gameMode = gameModeOf(reader.valueAsInt());
AbilityMetadata abilityData = user.meta().abilities();
abilityData.setPendingGameMode(gameMode);
user.tickFeedback(() -> abilityData.setGameMode(gameMode));
}
private GameMode gameModeOf(int id) {
for (GameMode value : GameMode.values()) {
if (value.id == id) {
return value;
}
}
throw new IllegalStateException("Unable to resolve gamemode with id " + id);
}
public enum GameMode {
NOT_SET(-1),
SURVIVAL(0),
CREATIVE(1),
ADVENTURE(2),
SPECTATOR(3);
private final int id;
GameMode(int id) {
this.id = id;
}
public static GameMode fromBukkit(org.bukkit.GameMode gameMode) {
switch (gameMode) {
case SURVIVAL:
return SURVIVAL;
case CREATIVE:
return CREATIVE;
case ADVENTURE:
return ADVENTURE;
case SPECTATOR:
return SPECTATOR;
default:
throw new IllegalArgumentException("Unable to resolve game mode " + gameMode);
}
}
public int id() {
return id;
}
}
}
// NOTE (AI): Intave is a closed-source anticheat; this file is from the public repository snapshot and is licensed under the PolyForm Perimeter license as stated in its header.Related Packets
Wiki Cross-Reference
Flag byte 0x01 invulnerable, 0x02 flying, 0x04 allowFlying, 0x08 creative, then float flySpeed and walkSpeed.
Vanilla sends it when the flying flag flips; 1.8.9 server keeps isFlying AND server allowFlying only.
Other flags and both floats are parsed then discarded, so forged speeds never reach server physics.
MCP 1.8.9 C13PacketPlayerAbilities implements Packet
1.8.9 callers: EntityPlayerSP.sendPlayerAbilities sends new C13PacketPlayerAbilities (line 396): https://github.com/Marcelektro/MavenMCP-1.8.9/blob/master/src/main/java/net/minecraft/client/entity/EntityPlayerSP.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.
Module Analyses Using C13PacketPlayerAbilities
Full source walkthroughs of the modules and anti-cheats that use this packet.