
Client-Server Communication API
how to use for developer:
- Register packet in common code:
public class FooBarPacket implements CscPacket{
public FooBarPacket(ByteBuf buf) {
read(buf);
}
private int foo;
@Override
public void read(ByteBuf buf) {
foo = buf.readInt();
}
@Override
public void write(ByteBuf buf) {
buf.writeInt(foo);
}
}
public static CscPacketType<FooBarPacket> FOO_BAR_PACKET = CscApi.registerPacket(
"foo_bar",
FooBarPacket.class,
FooBarPacket::new
);
- Use it on Server:
public class ServerClass {
private static final Logger log = LoggerFactory.getLogger(ServerClass.class);
public void init() {
CscServer.getService().registerListener((packet, player) -> {
log.info("Received packet {} from player {}", packet.getClass().getSimpleName(), player.getName());
}, ModPackets.FOO_BAR_PACKET);
}
public void sendFooBarPacket(Player player) {
CscServer.getService().sendPacket(new FooBarPacket(), player);
}
}
- Use it on Client:
public class ClientClass {
private static final Logger log = LoggerFactory.getLogger(ClientClass.class);
public void init() {
CscClient.getService().registerListener(packet -> {
log.info("Received packet: {}", packet);
}, ModPackets.FOO_BAR_PACKET);
}
public void sendFooBarPacket() {
CscClient.getService().sendPacket(new FooBarPacket());
}
}
Quick facts
- Edition: Minecraft Java
- File type: .jar
- Minecraft version listed: 1.21.8
- How to install: Install the matching mod loader (Forge, Fabric or NeoForge) for your Minecraft version. → Download the .jar. → Put it in the .minecraft/mods folder and launch that loader profile.
- Where to get it: Opens on Modrinth — not every file is mirrored on our own servers.
Install steps are the general flow for this file type — How to install Minecraft Java mods & modpacks walks through it step by step.
Verified by MCModsHub
- Ships as csc-paper-1.21.8-1.0-shaded.jar — drop this file into the mods folder
- Download size: 14 KB
- Download link checked 8 Sept 2026 — working
These come from our own check of the pack file, not from the source page.