Skip to content

Make mods in C

Lesson 1.1

Write Celestial mods in C. Your code is compiled to WebAssembly and runs in a sandbox, so players can install it without worrying, and one build works on every computer.

This course doesn’t teach the C language itself. W3Schools already does that very well, for free, with an editor in the browser. Every time you need a language feature, we link to the right W3Schools page. What you learn here is everything about making mods: the tools, the API, and the rules of the sandbox.

Who it is for

  • You know some C, or you are willing to learn the basics on W3Schools first. Before you start lists the pages to read, in order.
  • You don’t need to know anything about Minecraft modding.

If you have never programmed before, the Lua course is the gentler start. Lua mods need no compiler, and they reload while the game runs.

What’s in the course

Getting set up

The C you need, the SDK, the compiler, a first mod, the manifest, building and running.

How the API works

The easy header, handles and strings, errors, and where code is allowed to run.

The game

Events, players and text, items and blocks, the world, commands, timers and config.

The client and beyond

Keybinds, the HUD, screens, sound, networking, permissions, memory, debugging and publishing.

The chapters:

  • Before you start. The C you need and where to learn it.
  • Your first mod. The SDK, the compiler, the manifest, building and running the game.
  • How the API works. The easy header, handles and strings, errors, contexts and sides.
  • Events. Listening, changing and cancelling, and the list of every event.
  • Players and text. Players, inventories, messages and colours.
  • Items and blocks. Registering content, assets, recipes, reading and placing blocks, entities (spawning, moving, your own types), models and animation for them, entity gameplay (finding, buffing, hurting, spawning, riding), world access and player control, and AI (paths, goals) and saved data.
  • Commands and timers. Commands, waiting and repeating, config files.
  • The client. Keybinds, client events, the HUD, screens, menus, sound and music, particles, post effects, the camera, themed GUIs with HUD elements and Appearance pages, React-style components, and HTML/CSS overlays and panels.
  • Networking and permissions. Messages between client and server, the sandbox’s capabilities, and your own files and websites.
  • Finishing up. Memory in the sandbox, debugging, publishing, and a complete project.
  • Mixins. Hooking into the game’s own code: head, return, points, values, wraps, invokers, priorities and debugging, with a project.

Every lesson has the same shape

  • A short explanation with examples.
  • Try it: a small exercise. Write the code yourself before you open the solution.
  • Recap: the lesson in one line.

The examples use the game API, so they run inside the game, not on their own. Each lesson says what to expect when you try them. Log output looks like this:

[my_mod] Ruby Tools loaded

Start with the easy header

The SDK comes with clight_easy.h, a small header with short helpers for the everyday jobs: giving items, sending messages, placing blocks. The course uses it first and shows the full API next to it, so you can start simple and go deeper when you need to.

Start with The C you need.