A reference for all custom payloads supported by this server that clients can interact with.
Warning
Only send these payloads when you are certain the player is connected to anticheat-test.com. It is strongly recommended that you verify this through in-game context - such as scoreboard entries or tab list (player list) information, rather than by checking the server's domain name directly. Sending these payloads to unintended servers could have unexpected consequences.
Modern clients rely on this helper for sending custom payloads. See the implementation here.
sendRawPayload implementation
public static void sendRawPayload(Identifier id, byte[] data) {
Channel channel = MC.getConnection().getConnection().channel;
if (!channel.isOpen()) return;
try {
final PacketEncoder<?> encoder = (PacketEncoder<?>) channel.pipeline().get("encoder");
if (encoder == null) return;
final Object codec = encoder.protocolInfo.codec();
if (!(codec instanceof IdDispatchCodec)) return;
final IdDispatchCodec<?, ?, Object> dispatchCodec = (IdDispatchCodec<?, ?, Object>) codec;
final int packetId = dispatchCodec.toId.getOrDefault(CommonPacketTypes.SERVERBOUND_CUSTOM_PAYLOAD, -1);
if (packetId == -1) return;
final FriendlyByteBuf buf = new FriendlyByteBuf(channel.alloc().buffer());
buf.writeVarInt(packetId);
buf.writeIdentifier(id);
buf.writeBytes(data);
channel.writeAndFlush(buf);
} catch (Exception e) {
e.printStackTrace();
}
}Sent by the client to notify the server that the /packetdebugger command should be blocked
mc.getNetHandler().addToSendQueue(new C17PacketCustomPayload(
"ACT|Debugger",
new PacketBuffer(Unpooled.buffer())
));| Field | Value |
|---|---|
| Channel | ACT|Debugger |
| Payload | (empty) |
Channel: act_debugger:act_debugger
sendRawPayload(
Identifier.fromNamespaceAndPath("act_debugger", "act_debugger"),
new byte[]{}
);| Field | Value |
|---|---|
| Namespace | act_debugger |
| Path | act_debugger |
| Payload | (empty) |
Sent by the client to report the current playback state of a note block song.
Channel: anticheat_test:note_bot_update
| Order | Type | Field | Notes |
|---|---|---|---|
| 1 | String |
songName |
Falls back to filename (without .nbs) if empty |
| 2 | String |
artistName |
Falls back to "Unknown" if empty |
| 3 | float |
targetProgress |
Playback progress (0.0 – 1.0) |
| 4 | boolean |
tuning |
Whether tuning mode is active |
FriendlyByteBuf buffer = new FriendlyByteBuf(Unpooled.buffer());
String songName = this.song.name;
String artistName = this.song.author;
if (songName == null || songName.isEmpty()) songName = this.song.filename.replaceFirst(".nbs", "");
if (artistName == null || artistName.isEmpty()) artistName = "Unknown";
buffer.writeUtf(songName);
buffer.writeUtf(artistName);
buffer.writeFloat(this.targetProgress);
buffer.writeBoolean(this.tuning);
byte[] bufferData = new byte[buffer.readableBytes()];
buffer.readBytes(bufferData);
sendRawPayload(
Identifier.fromNamespaceAndPath("anticheat_test", "note_bot_update"),
bufferData
);