0x19 C19PacketResourcePackStatus
Client reports the resource pack load status to the server. Sent after S48PacketResourcePackSend.
Published 2026-06-18 · Updated 2026-10-14
Fields
| Field | Type | Description |
|---|---|---|
| hash | String | SHA-1 hash of the resource pack (from S48) |
| status | VarInt Enum | 0=loaded, 1=declined, 2=failedDownload, 3=accepted |
Wire Encoding
| Field | Type | Notes |
|---|---|---|
| Hash | String | SHA-1 hash of the pack |
| Result | VarInt Enum | 0=loaded, 1=declined, 2=failedDownload, 3=accepted |
MCP References
NetHandlerPlayServer.processResourcePackStatus()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 | |
Deobfuscated MCP 1.8.9 source of C19PacketResourcePackStatus, fetched directly from Marcelektro/MavenMCP-1.8.9 (net/minecraft/network/play/client/C19PacketResourcePackStatus.java) at build time and verified present.
Deep Dive
Role in the protocol
C19 is the client's reply to S48PacketResourcePackSend: a hash String plus an Action enum (SUCCESSFULLY_LOADED, DECLINED, FAILED_DOWNLOAD, ACCEPTED). Vanilla sends ACCEPTED when the user confirms the download prompt, then SUCCESSFULLY_LOADED or FAILED_DOWNLOAD after the download resolves. Servers that require a pack gate features or membership on the ACCEPTED reply.
Vanilla handling
The bundled 1.8.9 server handler, handleResourcePackStatus, is an empty method; decline kicks and pack-required logic are plugin territory. Client-side, NetHandlerPlayClient.handleResourcePackSend downloads the pack and reports the outcome through C19, and the download itself is a URL fetch with no scheme validation in vanilla, which is the hole the security modules patch.
Why clients touch it
Two families. (1) Security: Rise 6.x ResourcePackCheck (a SecurityFeature) and Tenacity's AntiExploit module and Enhancements utility intercept S48, validate the URL scheme, block level:// traversal and non-http hosts, and answer C19 with FAILED_DOWNLOAD so the server's state machine stays consistent. (2) Disabler: Rise 5.99's c19 mode sends C19 with an empty hash and ACCEPTED to unlock pack-gated features without downloading. LiquidSense Dev adds a third family: a mixin on NetHandlerPlayClient's handleResourcePack performs the same scheme guard as family (1), answering C19 with FAILED_DOWNLOAD and the real hash. November Recode 2.0 only registers C19 in its Lua scripting id map (0x19).
Exploit surface
The level:// protocol reads files from the server's save directory; a malicious pack URL with path traversal is a server-to-client file disclosure vector, which is exactly what both security implementations check for. The empty-hash ACCEPTED spoof exploits plugins that match the hash against the last S48; a strict plugin sees the mismatch, a sloppy one unlocks the feature. Because the vanilla server handler is empty, declined packs never kick in vanilla; the whole battlefield is plugin-side.
Server-Side Handling
handleResourcePackStatus is an empty no-op in the bundled 1.8.9 sources; pack-required kicks and feature gating live in plugins that read the Action. The client handler performs an unvalidated URL fetch, making S48 the disclosure vector and C19 the acknowledgment channel.
Protocol Analysis
String hash + VarInt enum action. The hash must echo the one from the triggering S48 for strict plugins. The enum order on the wire is SUCCESSFULLY_LOADED=0, DECLINED=1, FAILED_DOWNLOAD=2, ACCEPTED=3. C19 is only meaningful after an S48; a serverbound C19 with a hash the server never sent is the spoof signature.
Anti-Cheat Landscape
No anti-cheat measures C19. Anti-exploit plugins validate pack URLs server-side and match C19 hashes against their own S48 log; an empty-hash ACCEPTED or a FAILED_DOWNLOAD for a pack the server never sent is the detectable pattern. The security modules' FAILED_DOWNLOAD replies are indistinguishable from a genuine failed download, which is what makes them stealthy.
implementation Implementation Cases
The resource-pack handshake reply. Security layers in Rise 6.x and Tenacity block malicious pack URLs and answer FAILED_DOWNLOAD, while Rise 5.99's Disabler spoofs ACCEPTED with an empty hash to unlock pack-gated features without downloading anything. LiquidSense Dev ships the same scheme guard as a mixin on the vanilla handler.
Block malicious level:// resource packs and reply FAILED_DOWNLOAD to keep the server state machine consistent.
As a SecurityFeature it intercepts S48, validates scheme and path (no traversal, must end in /resources.zip), and on violation sends C19 FAILED_DOWNLOAD via sendNoEvent and cancels the pack.
// ===== FILE: Rise 6.2.4, Client-release2/Client/src/main/java/com/alan/clients/security/impl/ResourcePackCheck.java =====
package com.alan.clients.security.impl;
import com.alan.clients.security.SecurityFeature;
import com.alan.clients.util.packet.PacketUtil;
import net.minecraft.network.Packet;
import net.minecraft.network.play.client.C19PacketResourcePackStatus;
import net.minecraft.network.play.server.S48PacketResourcePackSend;
import java.net.URI;
import java.net.URISyntaxException;
import java.net.URLDecoder;
import java.nio.charset.StandardCharsets;
public final class ResourcePackCheck extends SecurityFeature {
public ResourcePackCheck() {
super("Resource Pack Check", "Server attempted to view files on the computer");
}
@Override
public boolean handle(final Packet<?> packet) {
if (packet instanceof S48PacketResourcePackSend) {
final S48PacketResourcePackSend wrapper = ((S48PacketResourcePackSend) packet);
final String url = wrapper.getURL();
final String hash = wrapper.getHash();
if (url.toLowerCase().startsWith("level://")) {
return check(url, hash);
}
}
return false;
}
private boolean check(String url, final String hash) {
try {
final URI uri = new URI(url);
final String scheme = uri.getScheme();
final boolean isLevelProtocol = "level".equals(scheme);
if (!("http".equals(scheme) || "https".equals(scheme) || isLevelProtocol)) {
throw new URISyntaxException(url, "Wrong protocol");
}
url = URLDecoder.decode(url.substring("level://".length()), StandardCharsets.UTF_8.toString());
if (isLevelProtocol && (url.contains("..") || !url.endsWith("/resources.zip"))) {
System.out.println("Server tried to access the path: " + url);
throw new URISyntaxException(url, "Invalid levelstorage resource pack path");
}
return false;
} catch (final Exception e) {
PacketUtil.sendNoEvent(new C19PacketResourcePackStatus(hash, C19PacketResourcePackStatus.Action.FAILED_DOWNLOAD));
return true;
}
}
}
// NOTE (AI): ResourcePackCheck is a Rise 6.x SecurityFeature, not a module. It intercepts S48PacketResourcePackSend and only inspects level:// URLs, which is the protocol that reads files from the server's world save directory. The check validates the scheme (http/https/level only), URL-decodes the level path, and rejects traversal (..) or any path not ending in /resources.zip. On any violation it replies C19 with FAILED_DOWNLOAD and cancels the pack, keeping the server's resource-pack state machine consistent.Block malicious resource packs (and other exploit packets) at the receive layer, answering C19 FAILED_DOWNLOAD for blocked packs.
The PacketReceiveEvent handler rejects non-http/https/level schemes and level:// URLs with traversal or a missing /resources.zip suffix, cancels the S48 and replies C19 with the pack's real hash.
// ===== FILE: Tenacity 6.0, dev/tenacity/module/impl/misc/AntiExploit.java =====
package dev.tenacity.module.impl.misc;
import dev.tenacity.event.IEventListener;
import dev.tenacity.event.impl.packet.PacketReceiveEvent;
import dev.tenacity.module.Module;
import dev.tenacity.module.ModuleCategory;
import dev.tenacity.util.misc.ChatUtil;
import net.minecraft.network.Packet;
import net.minecraft.network.play.client.C19PacketResourcePackStatus;
import net.minecraft.network.play.server.*;
import java.net.URI;
import java.net.URISyntaxException;
public class AntiExploit extends Module {
private long lastExplosion = 0, lastExperience = 0;
private int invalidExperience = 0;
final int PACKET_THRESHOLD = 100;
final long CHECK_INTERVAL = 1000;
int packetCount = 0;
public AntiExploit() {
super("AntiExploit", "Prevents server exploits", ModuleCategory.MISC);
}
private final IEventListener<PacketReceiveEvent> onReceivePacket = event -> {
Packet<?> packet = event.getPacket();
handlePacketCount();
if(packet instanceof S48PacketResourcePackSend) {
S48PacketResourcePackSend resourcePack = (S48PacketResourcePackSend) packet;
try {
URI uri = new URI(resourcePack.getURL());
String scheme = uri.getScheme();
boolean isLevelProtocol = scheme.equalsIgnoreCase("level");
boolean isHttpProtocol = scheme.equalsIgnoreCase("http");
boolean isHttpsProtocol = scheme.equalsIgnoreCase("https");
if(!isHttpProtocol && !isHttpsProtocol && !isLevelProtocol) {
ChatUtil.print("§cBlocked Exploit: Resource Pack");
event.cancel();
} else if(isLevelProtocol && (resourcePack.getURL().contains("..") || !((S48PacketResourcePackSend) packet).getURL().endsWith("/resources.zip"))) {
ChatUtil.print("§cBlocked Exploit: File Access");
event.cancel();
mc.getNetHandler().addToSendQueue(new C19PacketResourcePackStatus(((S48PacketResourcePackSend) packet).getHash(), C19PacketResourcePackStatus.Action.FAILED_DOWNLOAD));
}
} catch (URISyntaxException exception) {
ChatUtil.print("§cBlocked Exploit: Resource Pack");
event.cancel();
mc.getNetHandler().addToSendQueue(new C19PacketResourcePackStatus(((S48PacketResourcePackSend) packet).getHash(), C19PacketResourcePackStatus.Action.FAILED_DOWNLOAD));
}
} else if(packet instanceof S43PacketCamera && !mc.thePlayer.isSpectator()) {
ChatUtil.print("§cBlocked Exploit: Crash");
event.cancel();
} else if(packet instanceof S2APacketParticles) {
S2APacketParticles particles = (S2APacketParticles) packet;
if(Math.abs(particles.getParticleSpeed()) >= 1) {
ChatUtil.print("§cBlocked Exploit: Particles");
event.cancel();
} else if(((S2APacketParticles) packet).getParticleCount() > 1) {
ChatUtil.print("§cBlocked Exploit: Crash");
event.cancel();
}
} else if(packet instanceof S27PacketExplosion) {
S27PacketExplosion explosion = (S27PacketExplosion) packet;
if(Math.abs(explosion.getStrength()) > 1) {
ChatUtil.print("§cBlocked Exploit: Crash");
event.cancel();
} else if(System.currentTimeMillis() - lastExplosion <= 1) {
ChatUtil.print("§cBlocked Exploit: Crash");
event.cancel();
} else if(packet instanceof S2APacketParticles) {
S2APacketParticles particles = (S2APacketParticles) packet;
if(Math.abs(particles.getParticleSpeed()) > 1) {
ChatUtil.print("§cBlocked Exploit: Particles");
event.cancel();
} else if(particles.getParticleCount() >= 1) {
ChatUtil.print("§cBlocked Exploit: Crash");
event.cancel();
}
}
lastExplosion = System.currentTimeMillis();
} else if(packet instanceof S18PacketEntityTeleport) {
S18PacketEntityTeleport teleport = (S18PacketEntityTeleport) packet;
double packetX = Math.abs(teleport.getX());
double packetY = Math.abs(teleport.getY());
double packetZ = Math.abs(teleport.getZ());
if(packetX > 30000000 || packetY > 30000000 || packetZ > 30000000) {
ChatUtil.print("§cBlocked Exploit: Teleport");
event.cancel();
}
} else if(packet instanceof S11PacketSpawnExperienceOrb) {
if(System.currentTimeMillis() - lastExperience <= 1) {
invalidExperience++;
if(invalidExperience >= 2) {
ChatUtil.print("§cBlocked Exploit: Crash");
event.cancel();
}
} else {
invalidExperience = 0;
}
lastExperience = System.currentTimeMillis();
}
};
private void triggerKick() {
ChatUtil.print("§cAbnormal packet activity detected. Kicking player...");
}
private void handlePacketCount() {
long currentTime = System.currentTimeMillis();
long lastPacketCheckTime = 0;
if (currentTime - lastPacketCheckTime > CHECK_INTERVAL) {
packetCount = 0;
lastPacketCheckTime = currentTime;
}
packetCount++;
if (packetCount > PACKET_THRESHOLD) {
triggerKick();
packetCount = 0;
}
}
}
// NOTE (AI): AntiExploit's packet receive handler blocks malicious S48 resource packs: non-http/https/level schemes are cancelled with a chat warning, and level:// URLs that contain '..' or do not end in /resources.zip are cancelled and answered with C19 FAILED_DOWNLOAD using the packet's hash. The same handler also blocks S43PacketCamera for non-spectators and particle floods, which is why the module name is broader than resource packs.Spoof a resource-pack acceptance with an empty hash to unlock pack-gated server features.
The c19 disabler mode sends C19 with an empty hash string and ACCEPTED via sendPacketWithoutEvent.
// ===== FILE: Rise 5.99, dev/rise/module/impl/other/Disabler.java =====
/*
Copyright Alan Wood 2021
None of this code to be reused without my written permission
Intellectual Rights owned by Alan Wood
*/
package dev.rise.module.impl.other;
import de.gerrygames.viarewind.utils.ChatUtil;
import dev.rise.Rise;
import dev.rise.event.impl.motion.PreMotionEvent;
import dev.rise.event.impl.motion.TeleportEvent;
import dev.rise.event.impl.other.AttackEvent;
import dev.rise.event.impl.other.StrafeEvent;
import dev.rise.event.impl.other.WorldChangedEvent;
import dev.rise.event.impl.packet.PacketReceiveEvent;
import dev.rise.event.impl.packet.PacketSendEvent;
import dev.rise.module.Module;
import dev.rise.module.api.ModuleInfo;
import dev.rise.module.enums.Category;
import dev.rise.module.impl.movement.Fly;
import dev.rise.module.impl.movement.LongJump;
import dev.rise.module.impl.player.Scaffold;
import dev.rise.notifications.NotificationType;
import dev.rise.setting.Setting;
import dev.rise.setting.impl.BooleanSetting;
import dev.rise.setting.impl.NoteSetting;
import dev.rise.util.math.MathUtil;
import dev.rise.util.math.TimeUtil;
import dev.rise.util.pathfinding.MainPathFinder;
import dev.rise.util.player.MoveUtil;
import dev.rise.util.player.PacketUtil;
import dev.rise.util.player.PlayerUtil;
import io.netty.buffer.Unpooled;
import net.minecraft.client.entity.EntityPlayerSP;
import net.minecraft.entity.player.PlayerCapabilities;
import net.minecraft.network.Packet;
import net.minecraft.network.PacketBuffer;
import net.minecraft.network.play.client.*;
import net.minecraft.network.play.server.*;
import net.minecraft.util.*;
import org.apache.commons.lang3.RandomUtils;
import java.util.*;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ConcurrentLinkedDeque;
import java.util.concurrent.ConcurrentLinkedQueue;
/**
* This module is designed to disable an anticheat or some of its checks
* in order to make bypassing easier/having extreme bypasses.
*/
@ModuleInfo(name = "Disabler", description = "Disables some servers AntiCheats", category = Category.OTHER)
public final class Disabler extends Module {
private final NoteSetting modeSettings = new NoteSetting("Mode Settings", this);
private final BooleanSetting hypixel = new BooleanSetting("Hypixel", this, false);
private final BooleanSetting mineland = new BooleanSetting("Mineland", this, false);
private final BooleanSetting mmcKeepSprint = new BooleanSetting("Minemenclub Keepsprint Check", this, false);
private final BooleanSetting mmcReach = new BooleanSetting("Minemenclub Reach Semi", this, false);
private final BooleanSetting hypixelSlime = new BooleanSetting("Hypixel Slime", this, false);
private final BooleanSetting dynamicPvP = new BooleanSetting("Dynamic PvP", this, false);
private final BooleanSetting ghostlyCombat = new BooleanSetting("Ghostly Combat", this, false);
private final BooleanSetting ghostly = new BooleanSetting("Ghostly", this, false);
private final BooleanSetting lunar = new BooleanSetting("Lunar", this, false);
private final BooleanSetting position = new BooleanSetting("Position Edit", this, false);
private final BooleanSetting vulcanCombat = new BooleanSetting("Vulcan Reach A", this, false);
private final BooleanSetting verusCombat = new BooleanSetting("Verus Combat", this, false);
private final BooleanSetting verus = new BooleanSetting("Verus", this, false);
private final BooleanSetting blocksMC = new BooleanSetting("BlocksMC", this, false);
private final BooleanSetting sentinel = new BooleanSetting("Sentinel", this, false);
private final BooleanSetting shartemis = new BooleanSetting("Shartemis Movement", this, false);
//Any disabler after this line will be hidden if this is true
private final BooleanSetting hideOldDisablers = new BooleanSetting("Hide Old Disablers", this, true);
private final NoteSetting oldModeSettings = new NoteSetting("Old Mode Settings", this);
private final BooleanSetting verusOld = new BooleanSetting("Verus Old", this, false);
private final BooleanSetting spartan = new BooleanSetting("Spartan", this, false);
private final BooleanSetting voidTp = new BooleanSetting("Void TP", this, false);
private final BooleanSetting clip = new BooleanSetting("Clip", this, false);
private final BooleanSetting tecnioRaper = new BooleanSetting("Tecnio AC Disabler", this, false);
private final BooleanSetting convertMovingPackets = new BooleanSetting("Covert Moving Packets", this, false);
private final BooleanSetting reverseConvertMovingPackets = new BooleanSetting("Reverse Covert Moving Packets", this, false);
private final BooleanSetting funnyCraft = new BooleanSetting("Funcraft", this, false);
private final BooleanSetting oxygen = new BooleanSetting("Oxygen", this, false);
private final NoteSetting packetSettings = new NoteSetting("Packet Settings", this);
private final BooleanSetting coc = new BooleanSetting("PacketInput", this, false);
private final BooleanSetting c0f = new BooleanSetting("ConfirmTransaction", this, false);
private final BooleanSetting c00 = new BooleanSetting("PacketKeepAlive", this, false);
private final BooleanSetting c08 = new BooleanSetting("PacketPlayerBlockPlacement", this, false);
private final BooleanSetting c13 = new BooleanSetting("PacketPlayerAbilities", this, false);
private final BooleanSetting c16 = new BooleanSetting("PacketClientStatus", this, false);
private final BooleanSetting c18 = new BooleanSetting("PacketSpectate", this, false);
private final BooleanSetting c19 = new BooleanSetting("PacketResourcePacketStatus", this, false);
private final ConcurrentLinkedQueue<Packet<?>> packetList = new ConcurrentLinkedQueue<>();
private final ConcurrentLinkedQueue<Packet<?>> packetList2 = new ConcurrentLinkedQueue<>();
private final ConcurrentHashMap<Packet<?>, Long> packetHashMap = new ConcurrentHashMap<>();
private final ConcurrentLinkedQueue<Packet<?>> transactions = new ConcurrentLinkedQueue<>();
private final ConcurrentLinkedQueue<Packet<?>> keepAlives = new ConcurrentLinkedQueue<>();
public static final ConcurrentLinkedQueue<PacketUtil.TimedPacket> packets = new ConcurrentLinkedQueue<>();
public static boolean spoofing;
private int ticksSinceTeleport;
private long currentDelay;
private final TimeUtil timer = new TimeUtil();
private long nextSend;
private boolean teleported;
private boolean exempt;
private float previousYaw, previousPitch;
@Override
public void onAttackEvent(final AttackEvent event) {
if (event.getTarget() != null) {
if (ghostlyCombat.isEnabled()) {
final double distance = mc.thePlayer.getDistanceToEntity(event.getTarget()) - 0.5657;
if (distance > 2.9) {
if (mc.thePlayer.canEntityBeSeen(event.getTarget()))
PacketUtil.sendPacket(new C03PacketPlayer.C04PacketPlayerPosition(event.getTarget().posX, event.getTarget().posY, event.getTarget().posZ, false));
else
event.setCancelled(true);
}
}
}
}
@Override
public void onUpdateAlwaysInGui() {
boolean hideAllAfter = false;
for (final Setting setting : getSettings()) {
setting.hidden = hideAllAfter;
if (hideOldDisablers == setting && hideOldDisablers.isEnabled()) {
hideAllAfter = true;
}
}
}
@Override
protected void onEnable() {
if (mc.isIntegratedServerRunning())
return;
if (hypixel.isEnabled()) {
final ChatComponentText chatcomponenttext = new ChatComponentText("Rejoin");
mc.getNetHandler().getNetworkManager().closeChannel(chatcomponenttext);
}
if (mmcReach.isEnabled()) {
Rise.INSTANCE.getNotificationManager().registerNotification("You need low ping for this disabler to not kick.", NotificationType.WARNING);
}
transactions.clear();
keepAlives.clear();
teleported = false;
timer.reset();
}
@Override
protected void onDisable() {
packetList.forEach(PacketUtil::sendPacketWithoutEvent);
packetList.clear();
spoofing = false;
packetList2.forEach(PacketUtil::sendPacketWithoutEvent);
packetList2.clear();
transactions.clear();
keepAlives.clear();
packetHashMap.clear();
mc.timer.timerSpeed = 1;
}
@Override
public void onPreMotion(final PreMotionEvent event) {
if (mc.isIntegratedServerRunning())
return;
if (hypixel.isEnabled() && PlayerUtil.isOnServer("Hypixel")) {
spoofing = true;
for (final PacketUtil.TimedPacket p : packets) {
if (System.currentTimeMillis() > p.getTime() + currentDelay) {
PacketUtil.sendPacketWithoutEvent(p.getPacket());
packets.remove(p);
this.currentDelay = Math.round(MathUtil.getRandom(200,250));
}
}
}
if (verusOld.isEnabled()) {
PacketUtil.sendPacketWithoutEvent(new C0CPacketInput());
PacketUtil.sendPacketWithoutEvent(new C18PacketSpectate(UUID.randomUUID()));
}
if (blocksMC.isEnabled()) {
if (mc.thePlayer.ticksExisted % 100 == 0) {
PacketUtil.sendPacketWithoutEvent(new C03PacketPlayer.C04PacketPlayerPosition(mc.thePlayer.posX, mc.thePlayer.posY, mc.thePlayer.posZ, mc.thePlayer.onGround));
PacketUtil.sendPacketWithoutEvent(new C03PacketPlayer.C04PacketPlayerPosition(mc.thePlayer.posX, -0.015625, mc.thePlayer.posZ, false));
PacketUtil.sendPacketWithoutEvent(new C03PacketPlayer.C04PacketPlayerPosition(mc.thePlayer.posX, mc.thePlayer.posY, mc.thePlayer.posZ, mc.thePlayer.onGround));
teleported = true;
}
if (timer.hasReached(500L) && !transactions.isEmpty()) {
PacketUtil.sendPacketWithoutEvent(transactions.poll());
timer.reset();
}
if (timer.hasReached(400L) && !keepAlives.isEmpty()) {
PacketUtil.sendPacketWithoutEvent(keepAlives.poll());
timer.reset();
}
}
if (hypixelSlime.isEnabled() && mc.thePlayer.capabilities.allowFlying) {
if (PlayerUtil.isOnServer("Hypixel")) {
final PlayerCapabilities playerCapabilities = new PlayerCapabilities();
playerCapabilities.isFlying = true;
PacketUtil.sendPacket(new C13PacketPlayerAbilities(playerCapabilities));
} else
PacketUtil.sendPacket(new C0BPacketEntityAction(mc.thePlayer, C0BPacketEntityAction.Action.RIDING_JUMP));
}
if (vulcanCombat.isEnabled()) {
if (timer.hasReached((long) (5000 + (Math.random() * 1000)))) {
packetList2.forEach(PacketUtil::sendPacketWithoutEvent);
packetList2.clear();
timer.reset();
}
}
if (sentinel.isEnabled()) {
for (final Iterator<Map.Entry<Packet<?>, Long>> iterator = packetHashMap.entrySet().iterator(); iterator.hasNext(); ) {
final Map.Entry<Packet<?>, Long> entry = iterator.next();
if (entry.getValue() < System.currentTimeMillis()) {
PacketUtil.sendPacket(entry.getKey());
iterator.remove();
}
}
}
if (mmcReach.isEnabled()) {
if (timer.hasReached((long) (500 + (Math.random() * 600)))) {
packetList.forEach(PacketUtil::sendPacketWithoutEvent);
packetList.clear();
timer.reset();
}
}
if (oxygen.isEnabled() && mc.thePlayer.onGround) {
event.setY(event.getY() + 0.42F);
event.setGround(false);
}
if (voidTp.isEnabled() && mc.thePlayer.ticksExisted % 20 == 0)
event.setY(event.getY() - 20 - Math.random());
if (clip.isEnabled()) {
if (mc.thePlayer.ticksExisted % 20 == 0) {
event.setY(event.getY() - 0.42);
event.setGround(false);
}
}
if (coc.isEnabled()) {
PacketUtil.sendPacketWithoutEvent(new C0CPacketInput(0.98F, 0.0F, false, false));
}
if (c08.isEnabled()) {
PacketUtil.sendPacketWithoutEvent(new C08PacketPlayerBlockPlacement(mc.thePlayer.getHeldItem()));
}
if (c13.isEnabled() || shartemis.isEnabled()) {
final C13PacketPlayerAbilities abilities = new C13PacketPlayerAbilities();
abilities.setAllowFlying(true);
abilities.setFlying(true);
PacketUtil.sendPacketWithoutEvent(abilities);
}
if (c16.isEnabled() || shartemis.isEnabled()) {
PacketUtil.sendPacketWithoutEvent(new C16PacketClientStatus(C16PacketClientStatus.EnumState.PERFORM_RESPAWN));
}
if (c18.isEnabled() || shartemis.isEnabled()) {
PacketUtil.sendPacketWithoutEvent(new C18PacketSpectate(mc.thePlayer.getUniqueID()));
}
if (c19.isEnabled()) {
PacketUtil.sendPacketWithoutEvent(new C19PacketResourcePackStatus("", C19PacketResourcePackStatus.Action.ACCEPTED));
}
if (tecnioRaper.isEnabled()) {
for (int i = 0; i < 10; i++) {
PacketUtil.sendPacketWithoutEvent(new C03PacketPlayer.C06PacketPlayerPosLook(
mc.thePlayer.posX, mc.thePlayer.posY, Double.MAX_VALUE, 0.0F, 0.0F, true
));
}
for (int i = 0; i < 40; i++) {
PacketUtil.sendPacketWithoutEvent(new C03PacketPlayer.C06PacketPlayerPosLook(
Double.MAX_VALUE, mc.thePlayer.posY, mc.thePlayer.posZ, 0.0F, 0.0F, true
));
}
PacketUtil.sendPacketWithoutEvent(new C03PacketPlayer(true));
PacketUtil.sendPacketWithoutEvent(new C03PacketPlayer(true));
tecnioRaper.setEnabled(false);
}
if (funnyCraft.isEnabled()) {
if (mc.thePlayer.ticksExisted % 4 == 0) {
PacketUtil.sendPacketWithoutEvent(new C0CPacketInput(Float.MAX_VALUE, Float.MAX_VALUE, false, false));
}
}
}
@Override
public void onTeleportEvent(final TeleportEvent event) {
if (blocksMC.isEnabled()) {
if (teleported) {
event.setCancelled(true);
}
teleported = false;
}
if(hypixel.isEnabled() && PlayerUtil.isOnServer("Hypixel")){
if (mc.thePlayer.ticksExisted < 100) {
event.setCancelled(true);
return;
}
this.ticksSinceTeleport = 0;
}
// if (mc.thePlayer.getDistance(event.getPosX(), event.getPosY(), event.getPosZ()) <= 9.5) {
// PacketUtil.sendPacketWithoutEvent(new C03PacketPlayer.C06PacketPlayerPosLook(event.getPosX(), event.getPosY(), event.getPosZ(), event.getYaw(), event.getPitch(), false));
// event.setCancelled(true);
// }
// teleported = false;
}
@Override
public void onPacketReceive(final PacketReceiveEvent event) {
if (mc.isIntegratedServerRunning()) return;
final Packet<?> p = event.getPacket();
if (hypixel.isEnabled()) {
final Packet<?> packet = event.getPacket();
if (packet instanceof S08PacketPlayerPosLook) {
nextSend = 0;
}
}
if (hypixelSlime.isEnabled()) {
if (p instanceof S02PacketChat) {
final S02PacketChat chatMessage = (S02PacketChat) event.getPacket();
if (chatMessage.getType() == 2 && chatMessage.getChatComponent().getUnformattedText().contains("UNAVAILABLE")) {
chatMessage.chatComponent = new ChatComponentText("§aDOUBLE JUMP AVAILABLE§r");
}
}
if (p instanceof S29PacketSoundEffect) {
final S29PacketSoundEffect packetSoundEffect = (S29PacketSoundEffect) event.getPacket();
if (packetSoundEffect.getSoundName().equals("mob.slime.big")) {
event.setCancelled(true);
}
}
if (p instanceof S2APacketParticles) {
final S2APacketParticles particle = (S2APacketParticles) event.getPacket();
if (particle.getParticleType() == EnumParticleTypes.SLIME) {
event.setCancelled(true);
}
}
if (p instanceof S1FPacketSetExperience) {
event.setCancelled(true);
}
}
if (verus.isEnabled()) {
if (p instanceof S08PacketPlayerPosLook && timer.hasReached(1000)) {
final S08PacketPlayerPosLook packet = (S08PacketPlayerPosLook) p;
if (mc.thePlayer.getDistanceSq(packet.x, packet.y, packet.z) <= 9.5) {
PacketUtil.sendPacketWithoutEvent(new C03PacketPlayer.C06PacketPlayerPosLook(packet.x, packet.y, packet.z, packet.yaw, packet.pitch, false));
event.setCancelled(true);
}
teleported = false;
timer.reset();
}
}
}
@Override
public void onPacketSend(final PacketSendEvent event) {
if (mc.isIntegratedServerRunning())
return;
final Packet<?> packet = event.getPacket();
if (hypixel.isEnabled() && PlayerUtil.isOnServer("Hypixel")) {
if (packet instanceof C03PacketPlayer) {
final C03PacketPlayer wrapper = (C03PacketPlayer) packet;
if (wrapper instanceof C03PacketPlayer.C06PacketPlayerPosLook && ticksSinceTeleport <= 50 && mc.thePlayer.sendQueue.doneLoadingTerrain) {
event.setPacket(new C03PacketPlayer.C04PacketPlayerPosition(wrapper.x + Double.MIN_NORMAL, wrapper.y, wrapper.z - Double.MIN_NORMAL, ((C03PacketPlayer.C06PacketPlayerPosLook) wrapper).isOnGround()));
}
}
ticksSinceTeleport++;
if (mc.thePlayer == null || !mc.thePlayer.sendQueue.doneLoadingTerrain) {
packets.clear();
return;
}
if (mc.thePlayer.isDead || mc.isSingleplayer()) {
packets.forEach(p -> PacketUtil.sendPacketWithoutEvent(p.getPacket()));
packets.clear();
return;
}
if (spoofing) {
if (packet instanceof C0FPacketConfirmTransaction || packet instanceof C00PacketKeepAlive) {
packets.add(new PacketUtil.TimedPacket(packet, System.currentTimeMillis()));
event.setCancelled(true);
}
} else if (packet instanceof C03PacketPlayer) {
packets.forEach(p -> PacketUtil.sendPacketWithoutEvent(p.getPacket()));
packets.clear();
}
}
if (vulcanCombat.isEnabled() && packet instanceof C0FPacketConfirmTransaction) {
packetList2.add(packet);
event.setCancelled(true);
}
if (mineland.isEnabled()) {
if (event.getPacket() instanceof C03PacketPlayer && !mc.thePlayer.isSwingInProgress && !mc.thePlayer.isUsingItem() && !((C03PacketPlayer) event.getPacket()).isMoving()) {
event.setCancelled(true);
}
}
if (blocksMC.isEnabled()) {
if (packet instanceof C0FPacketConfirmTransaction) {
transactions.add(packet);
event.setCancelled(true);
if (transactions.size() > 300) {
PacketUtil.sendPacketWithoutEvent(transactions.poll());
}
}
if (packet instanceof C00PacketKeepAlive) {
final C00PacketKeepAlive c00 = (C00PacketKeepAlive) packet;
c00.key -= 30;
keepAlives.add(c00);
event.setCancelled(true);
}
if (packet instanceof C0BPacketEntityAction) {
final C0BPacketEntityAction c0B = (C0BPacketEntityAction) packet;
if (c0B.getAction().equals(C0BPacketEntityAction.Action.START_SPRINTING)) {
if (mc.thePlayer.serverSprintState) {
PacketUtil.sendPacketWithoutEvent(new C0BPacketEntityAction(mc.thePlayer, C0BPacketEntityAction.Action.STOP_SPRINTING));
mc.thePlayer.serverSprintState = false;
}
event.setCancelled(true);
}
if (c0B.getAction().equals(C0BPacketEntityAction.Action.STOP_SPRINTING)) {
event.setCancelled(true);
}
}
if (packet instanceof C03PacketPlayer && !mc.thePlayer.isSwingInProgress &&
!mc.thePlayer.isUsingItem() && !((C03PacketPlayer) packet).isMoving()) {
event.setCancelled(true);
}
}
if (verus.isEnabled()) {
if (packet instanceof C0BPacketEntityAction) {
final C0BPacketEntityAction c0B = (C0BPacketEntityAction) packet;
if (c0B.getAction().equals(C0BPacketEntityAction.Action.START_SPRINTING)) {
if (EntityPlayerSP.serverSprintState) {
PacketUtil.sendPacketWithoutEvent(new C0BPacketEntityAction(mc.thePlayer, C0BPacketEntityAction.Action.STOP_SPRINTING));
EntityPlayerSP.serverSprintState = false;
}
event.setCancelled(true);
}
if (c0B.getAction().equals(C0BPacketEntityAction.Action.STOP_SPRINTING)) {
event.setCancelled(true);
}
}
if (packet instanceof C00PacketKeepAlive) {
final C00PacketKeepAlive c00 = (C00PacketKeepAlive) packet;
c00.key = -c00.key;
}
if (packet instanceof C03PacketPlayer) {
final C03PacketPlayer c03 = (C03PacketPlayer) packet;
mc.timer.timerSpeed = 0.75F;
if (c03.y % 0.015625 == 0)
c03.setOnGround(true);
if (timer.hasReached(1000) && !teleported) {
PacketUtil.sendPacketWithoutEvent(new C03PacketPlayer.C04PacketPlayerPosition());
teleported = true;
}
if (mc.thePlayer.ticksExisted % 100 == 0)
teleported = false;
}
}
if (verusCombat.isEnabled() && mc.thePlayer.ticksExisted > 20 && !mc.thePlayer.capabilities.allowFlying) {
if (packet instanceof C0FPacketConfirmTransaction)
event.setCancelled(true);
}
if (position.isEnabled() && packet instanceof C03PacketPlayer) {
final C03PacketPlayer c03 = (C03PacketPlayer) event.getPacket();
c03.setY(c03.getY() + 0.015625);
}
if (ghostly.isEnabled()) {
if (packet instanceof C03PacketPlayer) {
PacketUtil.sendPacketWithoutEvent(new C0CPacketInput());
C03PacketPlayer c03PacketPlayer = ((C03PacketPlayer) packet);
double mathGround = Math.round(c03PacketPlayer.y / 0.015625) * 0.015625;
c03PacketPlayer.y = mathGround;
c03PacketPlayer.setOnGround(true);
event.setPacket(c03PacketPlayer);
}
if (packet instanceof C0BPacketEntityAction) {
final C0BPacketEntityAction c0B = (C0BPacketEntityAction) packet;
if (c0B.getAction().equals(C0BPacketEntityAction.Action.START_SPRINTING)) {
if (EntityPlayerSP.serverSprintState) {
PacketUtil.sendPacketWithoutEvent(new C0BPacketEntityAction(mc.thePlayer, C0BPacketEntityAction.Action.STOP_SPRINTING));
EntityPlayerSP.serverSprintState = false;
}
event.setCancelled(true);
}
if (c0B.getAction().equals(C0BPacketEntityAction.Action.STOP_SPRINTING)) {
event.setCancelled(true);
}
}
}
if (dynamicPvP.isEnabled()) {
if (packet instanceof C03PacketPlayer) {
if (mc.thePlayer.ticksExisted % 3 == 0)
event.setCancelled(true);
final C03PacketPlayer packetPlayer = (C03PacketPlayer) event.getPacket();
double x = mc.thePlayer.posX, y = mc.thePlayer.posY, z = mc.thePlayer.posZ;
if (packetPlayer.isMoving()) {
x = packetPlayer.getPositionX();
y = packetPlayer.getPositionY();
z = packetPlayer.getPositionZ();
}
if (mc.thePlayer.ticksExisted % 20 == 0)
PacketUtil.sendPacketWithoutEvent(new C03PacketPlayer.C04PacketPlayerPosition(x, y, z, packetPlayer.isOnGround()));
event.setPacket(new C03PacketPlayer.C06PacketPlayerPosLook(x, y, z, mc.thePlayer.rotationYaw, mc.thePlayer.rotationPitch, packetPlayer.isOnGround()));
}
if (packet instanceof C0FPacketConfirmTransaction || packet instanceof C00PacketKeepAlive)
event.setCancelled(true);
if (packet instanceof C0BPacketEntityAction) {
final C0BPacketEntityAction c0B = (C0BPacketEntityAction) packet;
if (c0B.getAction().equals(C0BPacketEntityAction.Action.START_SPRINTING)) {
if (EntityPlayerSP.serverSprintState) {
PacketUtil.sendPacketWithoutEvent(new C0BPacketEntityAction(mc.thePlayer, C0BPacketEntityAction.Action.STOP_SPRINTING));
EntityPlayerSP.serverSprintState = false;
}
event.setCancelled(true);
}
if (c0B.getAction().equals(C0BPacketEntityAction.Action.STOP_SPRINTING)) {
event.setCancelled(true);
}
}
}
if (spartan.isEnabled()) {
PacketUtil.sendPacketWithoutEvent(new C03PacketPlayer.C06PacketPlayerPosLook(mc.thePlayer.posX, mc.thePlayer.posY, mc.thePlayer.posZ, mc.thePlayer.rotationYaw, 91, mc.thePlayer.onGround));
}
if (sentinel.isEnabled()) {
if (packet instanceof C0FPacketConfirmTransaction || packet instanceof C00PacketKeepAlive) {
// packetHashMap.put(p, System.currentTimeMillis() + RandomUtils.nextLong(15000, 25000));
event.setCancelled(true);
}
if (packet instanceof C03PacketPlayer.C04PacketPlayerPosition) {
final C03PacketPlayer.C04PacketPlayerPosition packetPlayerPosition = (C03PacketPlayer.C04PacketPlayerPosition) packet;
event.setPacket(new C03PacketPlayer.C06PacketPlayerPosLook(packetPlayerPosition.getX(), packetPlayerPosition.getY(), packetPlayerPosition.getZ(), mc.thePlayer.rotationYaw + (mc.thePlayer.ticksExisted % 2 == 0 ? RandomUtils.nextFloat(0.05F, 0.1F) : -RandomUtils.nextFloat(0.05F, 0.1F)), mc.thePlayer.rotationPitch, packetPlayerPosition.isOnGround()));
}
}
if (c0f.isEnabled() || shartemis.isEnabled()) {
if (packet instanceof C0FPacketConfirmTransaction)
event.setCancelled(true);
}
if (c00.isEnabled()) {
if (packet instanceof C00PacketKeepAlive)
event.setCancelled(true);
}
if (lunar.isEnabled()) {
if (packet instanceof C0FPacketConfirmTransaction || packet instanceof C00PacketKeepAlive)
event.setCancelled(true);
if (packet instanceof C0BPacketEntityAction) {
final C0BPacketEntityAction c0B = (C0BPacketEntityAction) packet;
if (c0B.getAction().equals(C0BPacketEntityAction.Action.START_SPRINTING)) {
if (EntityPlayerSP.serverSprintState) {
PacketUtil.sendPacketWithoutEvent(new C0BPacketEntityAction(mc.thePlayer, C0BPacketEntityAction.Action.STOP_SPRINTING));
EntityPlayerSP.serverSprintState = false;
}
event.setCancelled(true);
}
if (c0B.getAction().equals(C0BPacketEntityAction.Action.STOP_SPRINTING)) {
event.setCancelled(true);
}
}
if (packet instanceof C03PacketPlayer.C04PacketPlayerPosition) {
final C03PacketPlayer.C04PacketPlayerPosition packetPlayerPosition = (C03PacketPlayer.C04PacketPlayerPosition) packet;
event.setPacket(new C03PacketPlayer.C06PacketPlayerPosLook(packetPlayerPosition.getX(), packetPlayerPosition.getY(), packetPlayerPosition.getZ(), mc.thePlayer.rotationYaw + (mc.thePlayer.ticksExisted % 2 == 0 ? RandomUtils.nextFloat(0.05F, 0.1F) : -RandomUtils.nextFloat(0.05F, 0.1F)), mc.thePlayer.rotationPitch, packetPlayerPosition.isOnGround()));
}
}
if (reverseConvertMovingPackets.isEnabled()) {
if (packet instanceof C03PacketPlayer.C06PacketPlayerPosLook) {
final C03PacketPlayer.C06PacketPlayerPosLook packetPlayerPosition = (C03PacketPlayer.C06PacketPlayerPosLook) packet;
event.setPacket(new C03PacketPlayer.C04PacketPlayerPosition(packetPlayerPosition.getX(), packetPlayerPosition.getY(), packetPlayerPosition.getZ(), packetPlayerPosition.isOnGround()));
}
}
if (convertMovingPackets.isEnabled()) {
if (packet instanceof C03PacketPlayer.C04PacketPlayerPosition) {
final C03PacketPlayer.C04PacketPlayerPosition packetPlayerPosition = (C03PacketPlayer.C04PacketPlayerPosition) packet;
event.setPacket(new C03PacketPlayer.C06PacketPlayerPosLook(packetPlayerPosition.getX(), packetPlayerPosition.getY(), packetPlayerPosition.getZ(), mc.thePlayer.rotationYaw + (mc.thePlayer.ticksExisted % 2 == 0 ? RandomUtils.nextFloat(0.05F, 0.1F) : -RandomUtils.nextFloat(0.05F, 0.1F)), mc.thePlayer.rotationPitch, packetPlayerPosition.isOnGround()));
}
}
if (mmcKeepSprint.isEnabled()) {
if (packet instanceof C0BPacketEntityAction) {
final C0BPacketEntityAction c0B = (C0BPacketEntityAction) packet;
if (c0B.getAction().equals(C0BPacketEntityAction.Action.START_SPRINTING)) {
if (EntityPlayerSP.serverSprintState) {
PacketUtil.sendPacketWithoutEvent(new C0BPacketEntityAction(mc.thePlayer, C0BPacketEntityAction.Action.STOP_SPRINTING));
EntityPlayerSP.serverSprintState = false;
}
event.setCancelled(true);
}
if (c0B.getAction().equals(C0BPacketEntityAction.Action.STOP_SPRINTING)) {
event.setCancelled(true);
}
}
}
if (mmcReach.isEnabled() && (PlayerUtil.isOnServer("minemen") || PlayerUtil.isOnServer("mineman"))) {
if (packet instanceof C0FPacketConfirmTransaction) {
event.setCancelled(true);
}
}
}
@Override
public void onStrafe(final StrafeEvent event) {
if (mineland.isEnabled()) {
PacketUtil.sendPacket(new C18PacketSpectate(UUID.randomUUID()));
}
}
@Override
public void onWorldChanged(final WorldChangedEvent event) {
}
}
// NOTE (AI): The C19 hit is the c19 disabler mode: it sends C19PacketResourcePackStatus with an empty hash string and Action.ACCEPTED via sendPacketWithoutEvent. The intent is to satisfy pack-gated server features without ever downloading the pack; a strict plugin that matches the hash against its own S48 log sees the mismatch, a sloppy one grants the gate. The same file also carries the C13, C18 and C0F modes covered on their own impl pages.Globally reject non-http/https/level pack URLs and answer FAILED_DOWNLOAD outside any module.
The static utility validates the S48 URL scheme, sends C19 FAILED_DOWNLOAD with the real hash for bad schemes and throws URISyntaxException to abort the vanilla download.
Block malicious level:// resource packs at the vanilla handler and reply C19 FAILED_DOWNLOAD to keep the server state machine consistent.
@Inject on handleResourcePack HEAD, cancellable: parse the S48 URL scheme, require http/https/level, and for level:// reject traversal (..) or a path not ending in /resources.zip. On URISyntaxException it logs, sends C19(hash, FAILED_DOWNLOAD) through netManager, and cancels the vanilla handler so the download never starts.
// ===== FILE: LiquidSense Dev, net/ccbluex/liquidbounce/injection/forge/mixins/network/MixinNetHandlerPlayClient.java =====
/*
* LiquidBounce Hacked Client
* A free open source mixin-based injection hacked client for Minecraft using Minecraft Forge.
* https://github.com/CCBlueX/LiquidBounce/
*/
package net.ccbluex.liquidbounce.injection.forge.mixins.network;
import io.netty.buffer.Unpooled;
import net.ccbluex.liquidbounce.LiquidBounce;
import net.ccbluex.liquidbounce.event.EntityMovementEvent;
import net.ccbluex.liquidbounce.event.PacketSenEvent;
import net.ccbluex.liquidbounce.features.module.modules.movement.Fly;
import net.ccbluex.liquidbounce.features.special.AntiForge;
import net.ccbluex.liquidbounce.utils.ClientUtils;
import net.minecraft.client.ClientBrandRetriever;
import net.minecraft.client.Minecraft;
import net.minecraft.client.entity.EntityPlayerSP;
import net.minecraft.client.gui.GuiDownloadTerrain;
import net.minecraft.client.multiplayer.PlayerControllerMP;
import net.minecraft.client.multiplayer.WorldClient;
import net.minecraft.client.network.NetHandlerPlayClient;
import net.minecraft.entity.Entity;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.inventory.Container;
import net.minecraft.network.*;
import net.minecraft.network.play.client.C0FPacketConfirmTransaction;
import net.minecraft.network.play.client.C17PacketCustomPayload;
import net.minecraft.network.play.client.C19PacketResourcePackStatus;
import net.minecraft.network.play.server.S01PacketJoinGame;
import net.minecraft.network.play.server.S14PacketEntity;
import net.minecraft.network.play.server.S32PacketConfirmTransaction;
import net.minecraft.network.play.server.S48PacketResourcePackSend;
import net.minecraft.world.WorldSettings;
import org.spongepowered.asm.mixin.Final;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Overwrite;
import org.spongepowered.asm.mixin.Shadow;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
import java.net.URI;
import java.net.URISyntaxException;
@Mixin(NetHandlerPlayClient.class)
public abstract class MixinNetHandlerPlayClient {
@Shadow
@Final
private NetworkManager netManager;
@Shadow
private Minecraft gameController;
@Shadow
private WorldClient clientWorldController;
@Shadow
public int currentServerMaxPlayers;
@Inject(method = "handleResourcePack", at = @At("HEAD"), cancellable = true)
private void handleResourcePack(final S48PacketResourcePackSend p_handleResourcePack_1_, final CallbackInfo callbackInfo) {
final String url = p_handleResourcePack_1_.getURL();
final String hash = p_handleResourcePack_1_.getHash();
try {
final String scheme = new URI(url).getScheme();
final boolean isLevelProtocol = "level".equals(scheme);
if(!"http".equals(scheme) && !"https".equals(scheme) && !isLevelProtocol)
throw new URISyntaxException(url, "Wrong protocol");
if(isLevelProtocol && (url.contains("..") || !url.endsWith("/resources.zip")))
throw new URISyntaxException(url, "Invalid levelstorage resourcepack path");
}catch(final URISyntaxException e) {
ClientUtils.getLogger().error("Failed to handle resource pack", e);
netManager.sendPacket(new C19PacketResourcePackStatus(hash, C19PacketResourcePackStatus.Action.FAILED_DOWNLOAD));
callbackInfo.cancel();
}
}
@Inject(method = "handleJoinGame", at = @At("HEAD"), cancellable = true)
private void handleJoinGameWithAntiForge(S01PacketJoinGame packetIn, final CallbackInfo callbackInfo) {
if(!AntiForge.enabled || !AntiForge.blockFML || Minecraft.getMinecraft().isIntegratedServerRunning())
return;
PacketThreadUtil.checkThreadAndEnqueue(packetIn, (NetHandlerPlayClient) (Object) this, gameController);
this.gameController.playerController = new PlayerControllerMP(gameController, (NetHandlerPlayClient) (Object) this);
this.clientWorldController = new WorldClient((NetHandlerPlayClient) (Object) this, new WorldSettings(0L, packetIn.getGameType(), false, packetIn.isHardcoreMode(), packetIn.getWorldType()), packetIn.getDimension(), packetIn.getDifficulty(), this.gameController.mcProfiler);
this.gameController.gameSettings.difficulty = packetIn.getDifficulty();
this.gameController.loadWorld(this.clientWorldController);
this.gameController.thePlayer.dimension = packetIn.getDimension();
this.gameController.displayGuiScreen(new GuiDownloadTerrain((NetHandlerPlayClient) (Object) this));
this.gameController.thePlayer.setEntityId(packetIn.getEntityId());
this.currentServerMaxPlayers = packetIn.getMaxPlayers();
this.gameController.thePlayer.setReducedDebug(packetIn.isReducedDebugInfo());
this.gameController.playerController.setGameType(packetIn.getGameType());
this.gameController.gameSettings.sendSettingsToServer();
this.netManager.sendPacket(new C17PacketCustomPayload("MC|Brand", (new PacketBuffer(Unpooled.buffer())).writeString(ClientBrandRetriever.getClientModName())));
callbackInfo.cancel();
}
@Inject(method = "handleEntityMovement", at = @At(value = "FIELD", target = "Lnet/minecraft/entity/Entity;onGround:Z"))
private void handleEntityMovementEvent(S14PacketEntity packetIn, final CallbackInfo callbackInfo) {
final Entity entity = packetIn.getEntity(this.clientWorldController);
if(entity != null)
LiquidBounce.eventManager.callEvent(new EntityMovementEvent(entity));
}
@Inject(method = "addToSendQueue", at = @At("HEAD"), cancellable = true)
private void senpacket(Packet<?> packet, final CallbackInfo callbackInfo) {
final PacketSenEvent event = new PacketSenEvent(packet);
LiquidBounce.eventManager.callEvent(event);
if (event.isCancelled()) {
callbackInfo.cancel();
}
}
@Overwrite
public void handleConfirmTransaction(S32PacketConfirmTransaction packetIn) {
PacketThreadUtil.checkThreadAndEnqueue((Packet)packetIn, (INetHandler)this, this.gameController);
Container container = null;
EntityPlayerSP entityplayer = Minecraft.getMinecraft().thePlayer;
if (packetIn.getWindowId() == 0) {
container = entityplayer.inventoryContainer;
} else if (packetIn.getWindowId() == entityplayer.openContainer.windowId) {
container = entityplayer.openContainer;
}
if (container != null && !packetIn.func_148888_e()) {
Minecraft.getMinecraft().getNetHandler().addToSendQueue(new C0FPacketConfirmTransaction(packetIn.getWindowId(), packetIn.getActionNumber(), true));
}
}
}
// NOTE (AI): The guard runs inside the vanilla handler before the download starts, so a blocked pack never reaches the URL fetch. The FAILED_DOWNLOAD reply uses the real S48 hash, which strict plugins accept as a genuine failure.
anticheat Anti-Cheat Checks
Artemis is the only anticheat with real logic on the resource-pack-status packet. Its PingSpoofProtocol uses the packet as a cheap keepalive on 1.8 servers to detect ping spoofing, and ResourcePackTickHandler turns it into a tick-confirmation channel. Other corpus hits are packet-type registrations and FlopAC wrappers.
Detect ping spoofing using resource-pack responses as keepalives.
On 1.9 and older servers, the check pushes a fake resource pack whose URL encodes a numeric id, then expects the client's ResourcePackStatus response with FAILED_DOWNLOAD and a matching id, followed by the next keepalive. Missing, out-of-order, or non-numeric responses log violations. On 1.10+ it switches to fake teleports because the resource-pack hash was removed.
// ===== FILE: artemisac-artemis-minecraft-anticheat, ac.artemis.checks.enterprise/src/main/java/ac/artemis/checks/enterprise/spoof/PingSpoofProtocol.java =====
package ac.artemis.checks.enterprise.spoof;
import ac.artemis.core.v4.check.ArtemisCheck;
import ac.artemis.core.v4.check.FastProcessHandler;
import ac.artemis.core.v4.check.PacketHandler;
import ac.artemis.core.v4.check.annotations.Check;
import ac.artemis.anticheat.api.check.type.Type;
import ac.artemis.core.v4.check.exempt.type.ExemptType;
import ac.artemis.core.v4.check.settings.CheckInformation;
import ac.artemis.core.v4.data.PlayerData;
import ac.artemis.core.v4.utils.chat.StringUtil;
import ac.artemis.packet.PacketManager;
import cc.ghast.packet.PacketAPI;
import ac.artemis.packet.protocol.ProtocolVersion;
import cc.ghast.packet.wrapper.mc.PlayerEnums;
import ac.artemis.packet.spigot.wrappers.GPacket;
import cc.ghast.packet.wrapper.packet.play.client.GPacketPlayClientCustomPayload;
import cc.ghast.packet.wrapper.packet.play.client.GPacketPlayClientKeepAlive;
import cc.ghast.packet.wrapper.packet.play.client.GPacketPlayClientResourcePackStatus;
import cc.ghast.packet.wrapper.packet.play.server.GPacketPlayServerKeepAlive;
import cc.ghast.packet.wrapper.packet.play.server.GPacketPlayServerResourcePackSend;
import java.util.Deque;
import java.util.LinkedList;
/**
* @author Ghast
* @since 25/03/2021
* Artemis © 2021
*
* This is most effectively the best antibot protection I've got on Artemis. By combining the
* concept of checking a random resource pack link and the usage of keep alives, we can pretty
* much capture whether or not a player is a bot or has a broken client misplacing keep-alives/
* resource packs.
*/
@Check(type = Type.PINGSPOOF, var = "Protocol")
public class PingSpoofProtocol extends ArtemisCheck implements PacketHandler, FastProcessHandler {
public PingSpoofProtocol(PlayerData data, CheckInformation info) {
super(data, info);
}
private final Deque<Long> ids = new LinkedList<>();
private Long next;
@Override
public void handle(GPacket packet) {
final boolean exempt = this.isExempt(ExemptType.JOIN);
/*
* They removed the hash :(. We can't use it to identify packet order. How unlucky. This would mean
* this would false on laggy and latter clients; We can instead from 1.9+ use fake teleports.
*/
if (data.getVersion().isOrAbove(ProtocolVersion.V1_10))
return;
/*
* Lets handle resource pack status. Since we flush the channel before, theoretically this should be processed
* beforehand?
*/
if (packet instanceof GPacketPlayClientResourcePackStatus) {
final GPacketPlayClientResourcePackStatus sts = (GPacketPlayClientResourcePackStatus) packet;
/*
* Lets not interfere with real resource pack requests alright?
*/
if (!StringUtil.isNumeric(sts.getUrl().get())) {
this.debug("Invalid id");
return;
}
/*
* Theoretically speaking, the client can ONLY respond with FAILED_DOWNLOAD. Anything other
* than that is completely invalid. Hence we can just skip over it.
*/
if (!sts.getStatus().equals(PlayerEnums.ResourcePackStatus.FAILED_DOWNLOAD) && !exempt) {
this.log("Successfully downloaded - Invalid");
this.debug("[FLAG] Successfully downloaded - Invalid");
return;
}
/*
* Both resource pack and keep alive packets are async to the threading. Meaning they aren't ticked.
* This means these are synchronous but not correlated to other packets. Perfect for a pingspoof check.
* If no response is received, it's invalid
*/
if (ids.isEmpty() && !exempt) {
this.log("Packet coming from idk where");
this.debug("[FLAG] Packet coming from idk where");
return;
}
/*
* Alrighty lets get decoding.
*/
final long var = Long.decode(sts.getUrl().get());
/*
* No clue where tf this keep alive coming from hommie, but it defo ain't ours, so it's a bad
* packet.
*/
if (!ids.contains(var) && !exempt) {
this.log("Keep alive does not exist bruh");
this.debug("[FLAG] Keep alive does not exist bruh");
return;
}
long id = ids.poll();
/*
* Well this is awkward. We're receiving the wrong... packet id?
* Hence, this is deemed as a bad packet.
*/
if (id != var && ids.contains(var)) {
while (id != var && !ids.isEmpty()) {
id = ids.poll();
if (exempt)
continue;
this.log("Invalid identifier, polling queue...");
}
}
/*
* Nice alright, valid keep alive, lets mark the next id to receive.
*/
else {
next = var;
ids.remove(var);
this.debug("resource=" + var);
}
}
/*
* Since the keep alive flushed out a resource pack status packet, the next packet received should be the
* resource pack denial then only the keep alive.
*/
else if (packet instanceof GPacketPlayClientKeepAlive) {
final GPacketPlayClientKeepAlive ka = (GPacketPlayClientKeepAlive) packet;
if (next == null) {
if (!exempt)
this.log("No confirmation");
return;
}
if (next == ka.getId()) {
this.debug("ka=" + ka.getId());
} else if (!exempt) {
this.log("Packet order 0x1");
this.debug("[FLAG] Packet order 0x1");
}
}
}
@Override
public void fastHandle(GPacket packet) {
/*
* They removed the hash :(. We can't use it to identify packet order. How unlucky. This would mean
* this would false on laggy and latter clients; We can instead from 1.9+ use fake teleports.
*/
if (data.getVersion().isOrAbove(ProtocolVersion.V1_10))
return;
/*
* Only handle server keep alives because uhhh
*/
if (packet instanceof GPacketPlayServerKeepAlive) {
final GPacketPlayServerKeepAlive ka = (GPacketPlayServerKeepAlive) packet;
this.ids.add(ka.getId());
final String encoded = Long.toString(ka.getId());
PacketManager.getApi().sendPacket(
data.getPlayer().getUniqueId(),
new GPacketPlayServerResourcePackSend(
"level://" + Math.random() + "/resources.zip", encoded
)
);
}
}
}
// NOTE (AI): The check encodes the keepalive id into the resource-pack URL, which only works on protocols where the client echoes the URL back in the status packet.Turn resource-pack status into a tick counter for the connection.
On 1.8 servers, pushes a level:// resource pack whose hash encodes a numeric id, and accepts only FAILED_DOWNLOAD responses whose URL is numeric and contains the player name. The parsed id is stored as the player's resourcePackTick.
// ===== FILE: artemisac-artemis-minecraft-anticheat, ac.artemis.core/src/main/java/ac/artemis/core/v5/features/tick/impl/ResourcePackTickHandler.java =====
package ac.artemis.core.v5.features.tick.impl;
import ac.artemis.core.v4.data.PlayerData;
import ac.artemis.core.v4.utils.chat.StringUtil;
import ac.artemis.packet.PacketManager;
import cc.ghast.packet.PacketAPI;
import ac.artemis.packet.protocol.ProtocolVersion;
import cc.ghast.packet.wrapper.mc.PlayerEnums;
import ac.artemis.packet.spigot.wrappers.GPacket;
import cc.ghast.packet.wrapper.packet.play.client.GPacketPlayClientResourcePackStatus;
import cc.ghast.packet.wrapper.packet.play.server.GPacketPlayServerResourcePackSend;
public class ResourcePackTickHandler extends AbstractTickHandler<GPacketPlayClientResourcePackStatus> {
public ResourcePackTickHandler(final PlayerData data) {
super(data);
}
@Override
public boolean canReceive() {
return data.getVersion().isOrBelow(ProtocolVersion.V1_8_9);
}
@Override
public boolean isPacket(final GPacket packet) {
if (!(packet instanceof GPacketPlayClientResourcePackStatus))
return false;
final GPacketPlayClientResourcePackStatus wrapper = (GPacketPlayClientResourcePackStatus) packet;
/*
* Theoretically speaking, the client can ONLY respond with FAILED_DOWNLOAD. Anything other
* than that is completely invalid. Hence we can just skip over it.
*/
if (!wrapper.getStatus().equals(PlayerEnums.ResourcePackStatus.FAILED_DOWNLOAD))
return false;
if (!wrapper.getUrl().isPresent())
return false;
if (!wrapper.getUrl().get().contains(data.getPlayer().getName()))
return false;
return StringUtil.isNumeric(wrapper.getUrl().get());
}
@Override
public short getPacketId(final GPacket packet) {
return Short.parseShort(((GPacketPlayClientResourcePackStatus) packet).getUrl().get());
}
@Override
public void onConsume(final GPacketPlayClientResourcePackStatus packet) {
data.connection.resourcePackTick = Integer.parseInt(packet.getUrl().get());
}
@Override
public void onPush(final boolean flush, final short id) {
final GPacket packet = new GPacketPlayServerResourcePackSend(
"level://" + data.getPlayer().getName() + "_" + Math.random() + "/resources.zip",
Short.toString(id)
);
PacketManager.getApi().sendPacket(data.getPlayer().getUniqueId(), packet);
}
}
// NOTE (AI): This is a confirmation tracker rather than a flagging check, which is why the corpus classifies it under Artemis v5 tick features.Related Packets
Wiki Cross-Reference
Hash string max 40 chars echoing the S48 hash (ctor truncates past 40) plus VarInt action 0-3.
Action order is 0 loaded, 1 declined, 2 failed download, 3 accepted; PLAY serverbound 0x19.
Vanilla 1.8.9 server handler is an empty no-op; required-pack kicks and gating live in plugins.
MCP 1.8.9 C19PacketResourcePackStatus implements Packet
1.8.9 callers: NetHandlerPlayClient.handleResourcePack sends new C19PacketResourcePackStatus (line 1714): https://github.com/Marcelektro/MavenMCP-1.8.9/blob/master/src/main/java/net/minecraft/client/network/NetHandlerPlayClient.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 C19PacketResourcePackStatus
Full source walkthroughs of the modules and anti-cheats that use this packet.