Skip to content

Event table

Status: Implemented (API 1.24). Generated from client/clight/idl/clight_api.json by tools/docs/gen_api_reference.py; do not edit by hand. 59 events.

How events work: Events and the event concept page. Lua subscribes by name (cl.on("block.break", fn)), C with the id (CL_EV_BLOCK_BREAK), C++ with the type in clight::ev (clight::on<clight::ev::BlockBreak>(...)).

Id Name C id C++ type Payload Side Context Cancel Result
1 lifecycle.register CL_EV_LIFECYCLE_REGISTER ev::LifecycleRegister cl_ev_lifecycle both MAIN
2 lifecycle.registries_frozen CL_EV_LIFECYCLE_REGISTRIES_FROZEN ev::LifecycleRegistriesFrozen cl_ev_lifecycle both MAIN
3 lifecycle.common_setup CL_EV_LIFECYCLE_COMMON_SETUP ev::LifecycleCommonSetup cl_ev_lifecycle both MAIN
4 lifecycle.client_setup CL_EV_LIFECYCLE_CLIENT_SETUP ev::LifecycleClientSetup cl_ev_lifecycle client MAIN
5 lifecycle.server_setup CL_EV_LIFECYCLE_SERVER_SETUP ev::LifecycleServerSetup cl_ev_lifecycle server MAIN
6 lifecycle.resources_reloaded CL_EV_LIFECYCLE_RESOURCES_RELOADED ev::LifecycleResourcesReloaded cl_ev_lifecycle client MAIN
7 lifecycle.data_reloaded CL_EV_LIFECYCLE_DATA_RELOADED ev::LifecycleDataReloaded cl_ev_lifecycle server MAIN
8 lifecycle.server_starting CL_EV_LIFECYCLE_SERVER_STARTING ev::LifecycleServerStarting cl_ev_lifecycle server MAIN
9 lifecycle.server_started CL_EV_LIFECYCLE_SERVER_STARTED ev::LifecycleServerStarted cl_ev_lifecycle server MAIN
10 lifecycle.server_stopping CL_EV_LIFECYCLE_SERVER_STOPPING ev::LifecycleServerStopping cl_ev_lifecycle server MAIN
11 lifecycle.server_stopped CL_EV_LIFECYCLE_SERVER_STOPPED ev::LifecycleServerStopped cl_ev_lifecycle server MAIN
12 lifecycle.level_load CL_EV_LIFECYCLE_LEVEL_LOAD ev::LifecycleLevelLoad cl_ev_lifecycle server MAIN
13 lifecycle.level_save CL_EV_LIFECYCLE_LEVEL_SAVE ev::LifecycleLevelSave cl_ev_lifecycle server TICK
14 lifecycle.level_unload CL_EV_LIFECYCLE_LEVEL_UNLOAD ev::LifecycleLevelUnload cl_ev_lifecycle server MAIN
15 lifecycle.mod_reload CL_EV_LIFECYCLE_MOD_RELOAD ev::LifecycleModReload cl_ev_lifecycle both MAIN
16 lifecycle.shutdown CL_EV_LIFECYCLE_SHUTDOWN ev::LifecycleShutdown cl_ev_lifecycle both MAIN
17 tick.server_pre CL_EV_TICK_SERVER_PRE ev::TickServerPre cl_ev_tick server TICK
18 tick.server_post CL_EV_TICK_SERVER_POST ev::TickServerPost cl_ev_tick server TICK
19 tick.level_pre CL_EV_TICK_LEVEL_PRE ev::TickLevelPre cl_ev_tick server TICK
20 tick.level_post CL_EV_TICK_LEVEL_POST ev::TickLevelPost cl_ev_tick server TICK
21 tick.client_pre CL_EV_TICK_CLIENT_PRE ev::TickClientPre cl_ev_tick client TICK
22 tick.client_post CL_EV_TICK_CLIENT_POST ev::TickClientPost cl_ev_tick client TICK
23 player.join CL_EV_PLAYER_JOIN ev::PlayerJoin cl_ev_player server TICK
24 player.leave CL_EV_PLAYER_LEAVE ev::PlayerLeave cl_ev_player server TICK
25 player.respawn CL_EV_PLAYER_RESPAWN ev::PlayerRespawn cl_ev_player server TICK
26 player.chat CL_EV_PLAYER_CHAT ev::PlayerChat cl_ev_player_chat server TICK yes
27 player.command CL_EV_PLAYER_COMMAND ev::PlayerCommand cl_ev_player_command server TICK yes
28 player.interact_block CL_EV_PLAYER_INTERACT_BLOCK ev::PlayerInteractBlock cl_ev_player_interact_block server TICK yes yes
29 player.interact_item CL_EV_PLAYER_INTERACT_ITEM ev::PlayerInteractItem cl_ev_player_interact_item server TICK yes yes
30 player.attack_entity CL_EV_PLAYER_ATTACK_ENTITY ev::PlayerAttackEntity cl_ev_player_attack_entity server TICK yes
31 block.break CL_EV_BLOCK_BREAK ev::BlockBreak cl_ev_block_break server TICK yes
32 block.place CL_EV_BLOCK_PLACE ev::BlockPlace cl_ev_block_place server TICK yes
33 entity.damage CL_EV_ENTITY_DAMAGE ev::EntityDamage cl_ev_entity_damage server TICK yes
34 entity.death CL_EV_ENTITY_DEATH ev::EntityDeath cl_ev_entity_death server TICK yes
35 server.command_register CL_EV_SERVER_COMMAND_REGISTER ev::ServerCommandRegister cl_ev_command_register server MAIN
36 client.connect CL_EV_CLIENT_CONNECT ev::ClientConnect cl_ev_client_connect client RENDER
37 client.disconnect CL_EV_CLIENT_DISCONNECT ev::ClientDisconnect cl_ev_lifecycle client RENDER
38 client.screen_open CL_EV_CLIENT_SCREEN_OPEN ev::ClientScreenOpen cl_ev_screen_open client RENDER
39 client.key CL_EV_CLIENT_KEY ev::ClientKey cl_ev_key client RENDER yes
40 client.chat_received CL_EV_CLIENT_CHAT_RECEIVED ev::ClientChatReceived cl_ev_chat_received client RENDER yes
41 client.chat_send CL_EV_CLIENT_CHAT_SEND ev::ClientChatSend cl_ev_chat_send client TICK yes
42 client.sound_play CL_EV_CLIENT_SOUND_PLAY ev::ClientSoundPlay cl_ev_sound_play client ANY yes
43 config.reloaded CL_EV_CONFIG_RELOADED ev::ConfigReloaded cl_ev_config_reloaded both ANY
44 client.sound_stop CL_EV_CLIENT_SOUND_STOP ev::ClientSoundStop cl_ev_sound_stop client ANY
45 voice.stream_open CL_EV_VOICE_STREAM_OPEN ev::VoiceStreamOpen cl_ev_voice_stream client MAIN
46 voice.stream_close CL_EV_VOICE_STREAM_CLOSE ev::VoiceStreamClose cl_ev_voice_stream client MAIN
47 voice.talking CL_EV_VOICE_TALKING ev::VoiceTalking cl_ev_voice_talking client MAIN
48 entity.tick CL_EV_ENTITY_TICK ev::EntityTick cl_ev_entity_tick both TICK
49 entity.anim_event CL_EV_ENTITY_ANIM_EVENT ev::EntityAnimEvent cl_ev_anim_event both TICK
50 entity.synced CL_EV_ENTITY_SYNCED ev::EntitySynced cl_ev_entity_synced client TICK
51 entity.knockback CL_EV_ENTITY_KNOCKBACK ev::EntityKnockback cl_ev_entity_knockback server TICK yes
52 level.block_changed CL_EV_LEVEL_BLOCK_CHANGED ev::LevelBlockChanged cl_ev_block_changed both TICK
53 entity.data_changed CL_EV_ENTITY_DATA_CHANGED ev::EntityDataChanged cl_ev_entity_data_changed client TICK
54 render.frame CL_EV_RENDER_FRAME ev::RenderFrame cl_ev_render_frame client RENDER
55 render.fog CL_EV_RENDER_FOG ev::RenderFog cl_ev_render_fog client RENDER
56 mod.permission_changed CL_EV_MOD_PERMISSION_CHANGED ev::ModPermissionChanged cl_ev_permission_changed both MAIN
57 entity.spawn CL_EV_ENTITY_SPAWN ev::EntitySpawn cl_ev_entity_spawn server TICK yes
58 player.interact_entity CL_EV_PLAYER_INTERACT_ENTITY ev::PlayerInteractEntity cl_ev_player_interact_entity server TICK yes yes
59 entity.change_dimension CL_EV_ENTITY_CHANGE_DIMENSION ev::EntityChangeDimension cl_ev_entity_change_dimension server TICK

Payloads

Fields marked mut can be changed by a handler; the change is used when the handler returns. borrowed handles are only valid during the handler. Every payload starts with cl_event_header header.

cl_ev_lifecycle

Used by: lifecycle.register, lifecycle.registries_frozen, lifecycle.common_setup, lifecycle.client_setup, lifecycle.server_setup, lifecycle.resources_reloaded, lifecycle.data_reloaded, lifecycle.server_starting, lifecycle.server_started, lifecycle.server_stopping, lifecycle.server_stopped, lifecycle.level_load, lifecycle.level_save, lifecycle.level_unload, lifecycle.mod_reload, lifecycle.shutdown, client.disconnect.

Field Type Notes
level cl_level

cl_ev_tick

Used by: tick.server_pre, tick.server_post, tick.level_pre, tick.level_post, tick.client_pre, tick.client_post.

Field Type Notes
level cl_level
tick_count int64_t

cl_ev_player

Used by: player.join, player.leave, player.respawn.

Field Type Notes
player cl_entity

cl_ev_player_chat

Used by: player.chat.

Field Type Notes
player cl_entity
message cl_str mut

cl_ev_player_command

Used by: player.command.

Field Type Notes
player cl_entity
command cl_str mut

cl_ev_player_interact_block

Used by: player.interact_block.

Field Type Notes
player cl_entity
level cl_level
hand cl_hand
pos cl_block_pos
face cl_direction

cl_ev_player_interact_item

Used by: player.interact_item.

Field Type Notes
player cl_entity
level cl_level
hand cl_hand
stack cl_item_stack borrowed

cl_ev_player_attack_entity

Used by: player.attack_entity.

Field Type Notes
player cl_entity
target cl_entity

cl_ev_block_break

Used by: block.break.

Field Type Notes
level cl_level
pos cl_block_pos
state cl_block_state
player cl_entity
tool cl_item_stack borrowed
xp int32_t mut
drop_items bool mut

cl_ev_block_place

Used by: block.place.

Field Type Notes
level cl_level
pos cl_block_pos
state cl_block_state
placer cl_entity
hand cl_hand
replaced_state cl_block_state

cl_ev_entity_damage

Used by: entity.damage.

Field Type Notes
entity cl_entity
level cl_level
source cl_ident
attacker cl_entity
amount float mut

cl_ev_entity_death

Used by: entity.death.

Field Type Notes
entity cl_entity
level cl_level
source cl_ident
attacker cl_entity

cl_ev_command_register

Used by: server.command_register.

Field Type Notes
dedicated bool

cl_ev_screen_open

Used by: client.screen_open.

Field Type Notes
screen_id cl_str

cl_ev_key

Used by: client.key.

Field Type Notes
key int32_t
scancode int32_t
action int32_t
modifiers int32_t
screen_open bool

cl_ev_chat_received

Used by: client.chat_received.

Field Type Notes
message cl_str mut
overlay bool

cl_ev_chat_send

Used by: client.chat_send.

Field Type Notes
message cl_str mut

cl_ev_client_connect

Used by: client.connect.

Field Type Notes
address cl_str

cl_ev_sound_play

Used by: client.sound_play.

Field Type Notes
sound cl_str
category cl_sound_category
pos cl_vec3
volume float mut
pitch float mut
positional bool
handle cl_sound

cl_ev_config_reloaded

Used by: config.reloaded.

Field Type Notes
mod_id cl_str
file cl_str

cl_ev_sound_stop

Used by: client.sound_stop.

Field Type Notes
handle cl_sound
sound cl_str
category cl_sound_category

cl_ev_voice_stream

Used by: voice.stream_open, voice.stream_close.

Field Type Notes
handle cl_sound
speaker_uuid cl_uuid
speaker cl_entity
kind cl_voice_kind

cl_ev_voice_talking

Used by: voice.talking.

Field Type Notes
speaker_uuid cl_uuid
talking bool
whisper bool

cl_ev_entity_tick

Used by: entity.tick.

Field Type Notes
entity cl_entity
level cl_level
type cl_ident
client bool

cl_ev_anim_event

Used by: entity.anim_event.

Field Type Notes
entity cl_entity
level cl_level
type cl_ident
name cl_str
clip cl_str
layer int32_t
time float
client bool

cl_ev_entity_synced

Used by: entity.synced.

Field Type Notes
entity cl_entity
level cl_level
key cl_str
type cl_synced_type

cl_ev_entity_knockback

Used by: entity.knockback.

Field Type Notes
entity cl_entity
level cl_level
type cl_ident
strength double mut
dx double mut
dz double mut

cl_ev_block_changed

Used by: level.block_changed.

Field Type Notes
level cl_level
pos cl_block_pos
old_state cl_block_state
new_state cl_block_state
client bool

cl_ev_entity_data_changed

Used by: entity.data_changed.

Field Type Notes
entity cl_entity
level cl_level
key cl_str
removed bool

cl_ev_render_frame

Used by: render.frame.

Field Type Notes
partial float
delta float
time double

cl_ev_render_fog

Used by: render.fog.

Field Type Notes
fog_type int32_t
environmental_start float mut
environmental_end float mut
render_distance_start float mut
render_distance_end float mut
sky_end float mut
cloud_end float mut
red float mut
green float mut
blue float mut
alpha float mut
partial float

cl_ev_permission_changed

Used by: mod.permission_changed.

Field Type Notes
capability cl_str
granted bool

cl_ev_entity_spawn

Used by: entity.spawn.

Field Type Notes
entity cl_entity
level cl_level
loaded bool

cl_ev_player_interact_entity

Used by: player.interact_entity.

Field Type Notes
player cl_entity
target cl_entity
level cl_level
hand cl_hand

cl_ev_entity_change_dimension

Used by: entity.change_dimension.

Field Type Notes
entity cl_entity
from cl_level
to cl_level