Skip to content

Data packs, resource packs and OptiFine packs

Status: Implemented for packs as they are and for data mods. The code-based replacements for OptiFine features and the data-pack patterns marked planned below need CLight APIs that aren’t in the game yet.

Unlike Java mods, packs are data, and Celestial reads the vanilla formats directly. Most packs need no porting at all. This page lists what works unchanged, what is supported from the OptiFine/Iris ecosystem, and when it is worth turning a pack into a CLight mod.

What works unchanged

Pack type Status on Celestial
Data packs (26.3 pack_format, and older formats vanilla 26.3 accepts) Work unchanged: recipes, loot tables, tags, advancements, predicates, item modifiers, functions, enchantments, damage types, trims, paintings, jukebox songs, banner patterns, variants, and worldgen data for the three vanilla dimensions (extra dimensions aren’t generated yet)
Resource packs Work unchanged: block states, models, item model definitions, textures with animation .mcmeta, atlases, fonts, lang files, sounds, core/ and post/ shaders, overlays
Shader packs (OptiFine/Iris format) Supported: translated from GLSL to SPIR-V at load (Rendering internals for mods)
OptiFine CEM (.jem/.jpm custom entity models with animations) Supported, GPU-instanced
Random and emissive entity textures (OptiFine random/mob and emissive.properties) Supported
CIT (custom item textures, type=item) Supported
Connected textures (CTM), custom sky, custom colours Planned for the engine. Until then, a CLight mod can provide them (below).

Data packs that rely on vanilla behaviour quirks work the same as in vanilla, because Celestial’s game logic is a faithful port. Function-heavy packs often run faster, but their results are identical.

Shipping a pack as a CLight mod

You don’t need to, but bundling a pack as a data mod has advantages:

  • It appears on the Mods screen with a name, icon, version and description.
  • It is always enabled while installed (it can’t be accidentally disabled on the pack screen).
  • It can declare dependencies (for example on another mod whose items it uses).
  • It can be published on the Celestial website and installed per launcher instance like any mod (Distribution).
{
  "schema": 1,
  "id": "better_dungeons",
  "version": "1.0.0",
  "name": "Better Dungeons",
  "license": "CC-BY-4.0",
  "api": 1,
  "side": "server",
  "sync": "server_only",
  "runtime": { "type": "data" }
}

Put the pack’s data into datapack/ (the namespaces from the pack’s data/ folder, without the data/ level) and/or its assets/ next to the manifest, and run clight pack. The mod is mounted as the built-in pack mod/better_dungeons, below user-selected packs, so players can still override it (Data-driven content).

Data pack patterns that become simpler with CLight

Data pack technique With a small CLight mod
Functions polling every tick (tick.json) to detect an action An event subscription that runs only when it happens (block.break, player.interact_item, entity.death, …)
Fake commands with function trees Real commands with typed arguments and permissions
Chest GUIs built from item frames or barrels Locked container menus (cl_menu_open)
Custom items made from custom_data and command tricks Mod items with their own model, name and a use behaviour
Fake blocks with item displays and interaction entities Mod blocks with their own model and properties, shown as their base block to vanilla clients
Overwriting every biome file to add an ore planned: biome modifiers
Storing state in scoreboards or storage NBT attachments and saved data (Saved data (attachments on entities, players and chunks, world data))

None of these are required. A data pack that works keeps working.

OptiFine features that need code

Feature CLight approach
Connected textures (CTM), custom sky, custom colours, dynamic lights planned: baked model providers, render stages, colour providers and lightmap events. These features may also come to the engine itself.
Zoom A built-in Celestial client feature; a mod can do a simple version with a keybind and a HUD overlay

Write such features as client_only mods with every visual change behind an option that is off by default.

Shader pack authors

Packs are loaded as written, with these Celestial specifics:

  • Mod blocks are their base block in the world, so packs shade them as that block.
  • Custom uniforms from mods are planned.
  • Far terrain LOD (when the player enables it) is shaded through the dh_* programs, so packs written for Distant Horizons shade it too.
  • Packs that use geometry shaders run on the engine’s vertex-pulling path instead of mesh shaders; they work, but slower.

Resource pack authors

  • Mod content is retexturable like vanilla content: override assets/<modid>/… paths in your pack.
  • Packs can restyle Celestial’s RmlUi screens through their sprites (vanilla GUI sprites are used by the screens), but mods’ own RML/RCSS documents are not replaceable by packs.