Skip to content

Client integration (mods screen, client settings, toasts, camera)

Status: Partly implemented. The Mods screen (every mod with its state, errors, mixin conflicts, Permissions and Config pages), client-only messages and titles, and the client events. API 1.11: the camera (cl_camera_get: position, direction, field of view, first person). Custom config screens from the Mods screen, categories in Celestial’s Client Settings screen, toasts, and camera, FOV and fog events are Planned.

Client only. This page covers how mods appear in Celestial’s own menus and the client-side tools “client mods” (QoL, HUD and visual tweaks) use.

The Mods screen

The Mods screen (from the pause menu and the options) lists every mod CLight found, in load order, loaded or disabled with its error. For each mod:

  • its mixin count, and mixin conflicts or errors (red: a hard conflict or a mixin turned off after an error; amber: a mixin that never runs under another mod’s overwrite);
  • Permissions: the capabilities it declared, each allowed or denied by the player (Capabilities and permissions);
  • Config: a page generated from the options the mod defined (Configuration).

The name and description come from the manifest. With the Celestial launcher, mods are turned on and off per instance in the launcher.

Client-only text

C Lua Does
cl_client_show_message(text, overlay), cl_easy_show_message("Hi") cl.client.message("Hi"), cl.client.action_bar("Hi") A chat line or action-bar text only this player sees
cl_client_show_title(title, subtitle, fade_in, stay, fade_out) cl.client.title("Hi", "sub", { stay = 40 }) A title only this player sees

Client events

Event Use
tick.client_pre, tick.client_post Per-tick client logic (count, cache, react to keybinds)
client.connect, client.disconnect Joining and leaving a server or world (address)
client.screen_open A screen opened (screen_id; filterable)
client.key Key presses (cancellable)
client.chat_received, client.chat_send Change or hide chat lines
client.sound_play Change the volume or pitch of any sound, or silence it
lifecycle.resources_reloaded Rebuild caches that depend on resource packs

The hot-path pattern

Celestial’s built-in client features follow a rule worth copying: a disabled feature costs one boolean test. Read config values when they change (config.reloaded), keep them in plain variables, and test those in hot code. Better still, subscribe to per-tick or per-frame events only while the feature is on, and cancel the subscription when it turns off.

local config = cl.config.open("client")
config:define_bool("sparkles.enabled", true)
local enabled = config:get_bool("sparkles.enabled")
config:on_reload(function() enabled = config:get_bool("sparkles.enabled") end)

Planned

A custom config screen opened from the Mods screen; categories in the Client Settings screen with a generated page and a live preview; toasts (advancement, recipe, system styles); camera, FOV and fog events; an options-changed event.