Get the files on 9Minecraft
Contents (5)
Modders depend on Code Chicken Lib to avoid re-implementing math, rendering, networking, and config plumbing. Add it as a dependency, then use its APIs.
Declaring the dependency
Declare Code Chicken Lib as a required dependency in your mod descriptor so the game enforces correct load order, and reference it from your build configuration.
3D math example
import codechicken.lib.vec.Vector3;
import codechicken.lib.vec.Matrix4;
Vector3 dir = new Vector3(1, 0, 0);
Matrix4 m = new Matrix4().rotate(Math.PI / 2, Vector3.Y_POS);
dir.apply(m); // dir is now rotated 90 degrees about the Y axis
Custom packet example
import codechicken.lib.packet.PacketCustom;
// build and send a packet to a player
PacketCustom packet = new PacketCustom(MY_CHANNEL, 1);
packet.writePos(pos);
packet.writeInt(value);
packet.sendToPlayer(player);
Always compile and test against the exact Code Chicken Lib version your release targets - the API surface can change between game versions.








