User Tools

Site Tools


tutorial:event_index

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
tutorial:event_index [2025/10/06 23:53] – Grammar fix eesatutorial:event_index [2026/08/06 12:40] (current) – Completely overhaul the index infinitychances
Line 3: Line 3:
 This page is an index of all the events/callbacks provided in Fabric API, sorted by category. This page is a **work in progress.** Please help by contributing! This page is an index of all the events/callbacks provided in Fabric API, sorted by category. This page is a **work in progress.** Please help by contributing!
  
-Descriptions for events should not begin with "An event..." as that is implied, and events should be sorted alphabetically in each category. Deprecated events should not be listed unless they have no replacement, in which case they should be marked as such.+Descriptions for events should not begin with "An event..." as that is implied. Deprecated events should not be listed unless they have no replacement, in which case they should be marked as such.
  
 You can get a list of all events in your IDE by getting a call hierarchy of ''fabric.api.event.EventFactory.createArrayBacked(Class<? super T>, Function<T[], T>)''. In IntelliJ you can use the hot-key ''Ctrl + Alt + H'' (Windows/Linux), ''⌥ + ^ + H'' (macOS) with the method selected/hovered over; In Visual Studio, ''right-click -> Show Call Hierarchy''. You can get a list of all events in your IDE by getting a call hierarchy of ''fabric.api.event.EventFactory.createArrayBacked(Class<? super T>, Function<T[], T>)''. In IntelliJ you can use the hot-key ''Ctrl + Alt + H'' (Windows/Linux), ''⌥ + ^ + H'' (macOS) with the method selected/hovered over; In Visual Studio, ''right-click -> Show Call Hierarchy''.
 ===== Client ===== ===== Client =====
- +==== Hotbar ==== 
-  * **ClientBlockEntityEvents.BLOCK_ENTITY_LOAD**: Called when a BlockEntity is loaded into a ClientWorld. When this event is called, the block entity is already in the world+  * **ClientHotbarScrollEvents.ALLOW**: Can be used to cancel the change of the selected hotbar slot. 
-  * **ClientBlockEntityEvents.BLOCK_ENTITY_UNLOAD**: Called when a BlockEntity is about to be unloaded from a ClientWorld. When this event is called, the block entity is still present in the world+  * **ClientHotbarScrollEvents.BEFORE**: Called before the selected hotbar slot changes, after the ALLOW check. 
-  * **ClientChunkEvents.CHUNK_LOAD**: Called when a chunk is loaded into a ClientWorld. When this event is called, the chunk is already in the world+  * **ClientHotbarScrollEvents.AFTER**: Called after the selected hotbar slot changes. 
-  * **ClientChunkEvents.CHUNK_UNLOAD**: Called when a chunk is about to be unloaded from a ClientWorld. When this event is called, the chunk is still present in the world+==== Player ==== 
-  * **ClientCommandRegistrationCallback.EVENT**: For when client commands are registered to the dispatcher. +  * **ClientPlayerBlockBreakEvents.AFTER**: Called after a block is broken client side. 
-  * **ClientEntityEvents.ENTITY_LOAD**: Called when an Entity is loaded into a ClientWorld. When this event is called, the entity is already in the world+  * **ClientPreAttackCallback.EVENT**: Allows for the cancelling of the handling of holding the attack key. Called for every tick the key is held down, except if it was cancelled before. 
-  * **ClientEntityEvents.ENTITY_UNLOAD**: Called when an Entity is about to be unloaded from a ClientWorld. When this event is called, the entity is still present in the world.+==== BlockEntity ==== 
 +  * **ClientBlockEntityEvents.BLOCK_ENTITY_LOAD**: Called when a BlockEntity is loaded into a ClientLevel. When this event is called, the block entity is already in the level
 +  * **ClientBlockEntityEvents.BLOCK_ENTITY_UNLOAD**: Called when a BlockEntity is about to be unloaded from a ClientLevel. When this event is called, the block entity is still present in the level. 
 +==== Chunk ==== 
 +  * **ClientChunkEvents.CHUNK_LOAD**: Called when a chunk is loaded into a ClientLevel. When this event is called, the chunk is already in the level
 +  * **ClientChunkEvents.CHUNK_UNLOAD**: Called when a chunk is about to be unloaded from a ClientLevel. When this event is called, the chunk is still present in the level
 +==== Entity ==== 
 +  * **ClientEntityEvents.ENTITY_LOAD**: Called when an Entity is loaded into a ClientLevel. When this event is called, the entity is already in the level
 +  * **ClientEntityEvents.ENTITY_UNLOAD**: Called when an Entity is about to be unloaded from a ClientLevel. When this event is called, the entity is still present in the level. 
 +==== Level ==== 
 +  * **ClientLevelEvents.AFTER_CLIENT_LEVEL_CHANGE**: Called after the client level has changed. Called in occasions such as a player logging in or disconnecting. 
 +==== Lifecycle ====
   * **ClientLifecycleEvents.CLIENT_STARTED**: Called when Minecraft has started and its client is about to tick for the first time.   * **ClientLifecycleEvents.CLIENT_STARTED**: Called when Minecraft has started and its client is about to tick for the first time.
-  * **ClientLifecycleEvents.CLIENT_STOPPING**: Called when Minecraft's client begins to stop+  * **ClientLifecycleEvents.CLIENT_STOPPING**: Called when Minecraft's client begins to stop, before an integrated server stops, if applicable. 
-  * **ClientPickBlockApplyCallback.EVENT**: Emitted during the block-picking process; can be used to modify the returned ItemStackas well as nullify it+==== Tick ==== 
-  * **ClientPickBlockGatherCallback.EVENT**: Emitted at the beginning of the block-picking process to find any applicable ItemStack.+  * **ClientTickEvents.START_CLIENT_TICK**: Called at the start of the client tick.
   * **ClientTickEvents.END_CLIENT_TICK**: Called at the end of the client tick.   * **ClientTickEvents.END_CLIENT_TICK**: Called at the end of the client tick.
-  * **ClientTickEvents.END_WORLD_TICK**: Called at the end of the ClientWorld's tick. +  * **ClientTickEvents.START_LEVEL_TICK**: Called at the start of the ClientLevel's tick. 
-  * **ClientTickEvents.START_CLIENT_TICK**: Called at the start of the client tick. +  * **ClientTickEvents.END_LEVEL_TICK**: Called at the end of the ClientLevel's tick. 
-  * **ClientTickEvents.START_WORLD_TICK**: Called at the start of the ClientWorld's tick. +==== Command ==== 
-  * **ItemTooltipCallback.EVENT**: Called when an item stack's tooltip is rendered+  * **ClientCommandRegistrationCallback.EVENT**: For when client commands are registered to the dispatcher. 
-  * **ScreenEvents.AFTER_INIT**: Called after screen is initialized to its default state. +==== Tooltip ==== 
-  * **ScreenEvents.BEFORE_INIT**: Called before a screen is initialized to its default state+  * **ClientTooltipComponentCallback.EVENT**: Allows registering mapping from TooltipComponent to ClientTooltipComponentThis allows custom tooltips for items to be displayed properly in a screen. 
-  * **TooltipComponentCallback.EVENT**: Allows registering mapping from TooltipData to TooltipComponentThis allows custom tooltips for items.+==== Recipe ==== 
 +  * **ClientRecipeSynchronizedEvent.EVENT**: Called when client receives all synchronized recipesOnly invoked if the server supports Recipe Sync packets.
  
-===== Commands ====== 
  
 +===== Command =====
   * **CommandRegistrationCallback**: Called when a server registers all commands.   * **CommandRegistrationCallback**: Called when a server registers all commands.
  
-===== Entities (General) ===== 
  
 +===== Creative Mode Tab =====
 +  * **CreativeModeTabEvents.MODIFY_OUTPUT_ALL**: Allows the output of any creative mode tab to be modified.
 +  * **CreativeModeTabEvents.modifyOutputEvent()**: Returns a modify output event for the given tab, and should be preferred over MODIFY_OUTPUT_ALL.
 +
 +
 +===== Dimension =====
 +  * **DimensionEvents.MODIFY_ATTRIBUTES**: Allows the environment attributes of a dimension to be modified.
 +
 +
 +===== Entities =====
 +==== Elytra ====
   * **EntityElytraEvents.ALLOW**: For checking whether elytra flight is allowed.   * **EntityElytraEvents.ALLOW**: For checking whether elytra flight is allowed.
   * **EntityElytraEvents.CUSTOM**: For granting elytra flight to entities not wearing an elytra.   * **EntityElytraEvents.CUSTOM**: For granting elytra flight to entities not wearing an elytra.
 +==== Sleep ====
 +  * **EntitySleepEvents.ALLOW_SLEEPING**: For checking whether a player can start to sleep in a bed-like block.
 +  * **EntitySleepEvents.START_SLEEPING**: Called when an entity starts to sleep.
 +  * **EntitySleepEvents.STOP_SLEEPING**: Called when an entity stops sleeping and wakes up.
   * **EntitySleepEvents.ALLOW_BED**: For checking whether a block is bed-like.   * **EntitySleepEvents.ALLOW_BED**: For checking whether a block is bed-like.
   * **EntitySleepEvents.ALLOW_NEARBY_MONSTERS**: For checking whether a player can sleep when monsters are nearby.   * **EntitySleepEvents.ALLOW_NEARBY_MONSTERS**: For checking whether a player can sleep when monsters are nearby.
   * **EntitySleepEvents.ALLOW_RESETTING_TIME**: For checking whether a sleeping player allows for skipping the current day and resetting the time to 0.   * **EntitySleepEvents.ALLOW_RESETTING_TIME**: For checking whether a sleeping player allows for skipping the current day and resetting the time to 0.
-  * **EntitySleepEvents.ALLOW_SETTING_SPAWN**: For checking whether a player's spawn can be set when sleeping. 
-  * **EntitySleepEvents.ALLOW_SLEEPING**: For checking whether a player can start to sleep in a bed-like block. Recommended to use the more specific ALLOW_SLEEP_TIME or ALLOW_NEARBY_MONSTERS for mod compatibility. 
-  * **EntitySleepEvents.ALLOW_SLEEP_TIME**: For checking whether the current time of day is valid for sleeping. 
   * **EntitySleepEvents.MODIFY_SLEEPING_DIRECTION**: For modifying or providing a sleeping direction for a bed-like block. The sleeping direction is where the player's head is pointing when they're sleeping.   * **EntitySleepEvents.MODIFY_SLEEPING_DIRECTION**: For modifying or providing a sleeping direction for a bed-like block. The sleeping direction is where the player's head is pointing when they're sleeping.
-  * **EntitySleepEvents.MODIFY_WAKE_UP_POSITION**: For modifying or providing wake-up position for an entity waking up.+  * **EntitySleepEvents.ALLOW_SETTING_SPAWN**: For checking whether player's spawn can be set when sleeping.
   * **EntitySleepEvents.SET_BED_OCCUPATION_STATE**: For setting whether a bed block is occupied.   * **EntitySleepEvents.SET_BED_OCCUPATION_STATE**: For setting whether a bed block is occupied.
-  * **EntitySleepEvents.START_SLEEPING**: Called when an entity starts to sleep.  +  * **EntitySleepEvents.MODIFY_WAKE_UP_POSITION**: For modifying or providing a wake-up position for an entity waking up. 
-  * **EntitySleepEvents.STOP_SLEEPING**: Called when an entity stops sleeping and wakes up+==== Rendering ==== 
-  * **EntityTrackingEvents.START_TRACKING**: Called before player starts tracking an entity. +  * **LivingEntityFeatureRenderEvents.ALLOW_CAPE_RENDER**: Can prevent capes from rendering
-  * **EntityTrackingEvents.STOP_TRACKING**: Called after a player has stopped tracking an entity+  * **LivingEntityRenderLayerRegistrationCallback.EVENT**: Called when RenderLayers for LivingEntityRenderer are registered. Render layers are typically used for rendering additional objects on an entity, such as armor, an elytra, or Deadmau5's ears 
 + 
 + 
 +===== Gamerule ====== 
 +  * **GameRuleEvents.changeCallback()**: Returns an event that is called when the given gamerule is updated. 
  
 ===== Item ===== ===== Item =====
 +==== Tooltip ====
 +  * **ItemTooltipCallback.EVENT**: Called after all base tooltip lines were added to an itemstack's tooltip.
 +==== Components ====
 +  * **DefaultItemComponentEvents.MODIFY**: Used to add or remove default components of known items. 
 +==== Enchantment ====
 +  * **EnchantmentEvents.ALLOW_ENCHANTING**: Checks for if an enchantment can be applied to an itemstack.
 +  * **EnchantmentEvents.MODIFY_WITH_LOOKUP**: Called when enchantments are being loaded, allows for the behavior of an enchantment to be changed, such as adding a bleed effect to sharpness.
 +==== Rendering ====
 +  * **ExtractItemDecorationsCallback.EVENT**: Allows for drawing custom item stack decorations. Vanilla examples are: Durability bar, cooldown overlay, and stack count.
  
-  * **ModifyItemAttributeModifiersCallback.EVENT**: Stack-aware attribute modifier callback for foreign items. Instead of using Mixin to change attribute modifiers in items not in your mod, you can use this instead, either checking the Item itself or using a tag. This event provides you with a guaranteed mutable map you can put attribute modifiers in. Do not use for your own Item classes 
  
-===== Lifecycle =====+===== Level ===== 
 +==== Extraction ==== 
 +  * **LevelExtractionEvents.AFTER_BLOCK_OUTLINE_EXTRACTION**: Called right after the block outline render state is extracted, before it is drawn. Can cancel the default rendering, suppressing BEFORE_BLOCK_OUTLINE. Use this to extract custom data needed when decorating or replacing the default block outline. 
 +  * **LevelExtractionEvents.END_EXTRACTION**: Called after all render states have been extracted, before any are drawn. Use this to extract custom data needed for rendering. 
 +==== Render ==== 
 +  * **LevelRenderEvents.START_MAIN**: Called at the start of the main pass, after the sky is drawn and all chunks that need to be rendered are uploaded to the GPU, but before any chunks are drawn. 
 +  * **LevelRenderEvents.AFTER_OPAQUE_TERRAIN**: Called after opaque terrain is drawn, and before any submit nodes are added to the submit node storage. Use this to add more opaque terrain-like geometry. 
 +  * **LevelRenderEvents.COLLECT_SUBMITS**: Called after all submit nodes from entities, blockentities, and particles are added to the storage, but before any are drawn. Use this to add additional submits. 
 +  * **LevelRenderEvents.AFTER_SOLID_FEATURES**: Called after the solid geometry from entities, blockentities, and particles are drawn. 
 +  * **LevelRenderEvents.AFTER_TRANSLUCENT_FEATURES**: Called after the translucent geometry from entities and blockentities are drawn. Translucent particle geometry is drawn later. 
 +  * **LevelRenderEvents.BEFORE_BLOCK_OUTLINE**: Called after block outline render checks are made, but before the default block outline is drawn. Use this to replace the default block outline rendering for specific blocks that need special rendering or to add information. Can be suppressed by AFTER_BLOCK_OUTLINE_EXTRACTION. 
 +  * **LevelRenderEvents.BEFORE_GIZMOS**: Called after all geometry of submits collected from entities, block entities, and particles (except translucent particle geometry), the block breaking overlay, and the block outline for solid blocks are drawn, but before gizmos are collected. 
 +  * **LevelRenderEvents.BEFORE_TRANSLUCENT_TERRAIN**: Called after opaque terrain, entities, blockentities, solid particles, overlays, and gizmos are drawn, but before translucent terrain and translucent particles are drawn. 
 +  * **LevelRenderEvents.AFTER_TRANSLUCENT_TERRAIN**: Called after translucent terrain is drawn, but before translucent particles are drawn. Use this to render additional translucent terrain-like geometry. 
 +  * **LevelRenderEvents.END_MAIN**: Called at the end of the main pass, after terrain, entities, blockentities, and particles are drawn, but before clouds, weather, and late debug are drawn, and before fabulous translucent frambuffers are combined. 
 +  * **InvalidateRenderStateCallback.EVENT**: Called when the level renderer reloads, usually as result of changing resource pack or video configuration, or when the player types F3+A in the debug screen. Afterwards all render chunks will be reset and reloaded.
  
 +
 +===== Lifecycle =====
   * **CommonLifecycleEvents.TAGS_LOADED**: Called when tags are loaded or updated.   * **CommonLifecycleEvents.TAGS_LOADED**: Called when tags are loaded or updated.
-  * **ServerLifecycleEvents.END_DATA_PACK_RELOAD**: Called after a Minecraft server has reloaded data packs. If reloading data packs was unsuccessful, the current data packs will be kept. +
-  * **ServerLifecycleEvents.SERVER_STARTED**: Called when a Minecraft server has started and is about to tick for the first time. At this stage, all worlds are live. +
-  * **ServerLifecycleEvents.SERVER_STARTING**: Called when a Minecraft server is starting. This occurs before the player manager and any worlds are loaded. +
-  * **ServerLifecycleEvents.SERVER_STOPPED**: Called when a Minecraft server has stopped. All worlds have been closed and all (block)entities and players have been unloaded. +
-  * **ServerLifecycleEvents.SERVER_STOPPING**: Called when a Minecraft server has started shutting down. This occurs before the server's network channel is closed and before any players are disconnected. +
-  * **ServerLifecycleEvents.START_DATA_PACK_RELOAD**: Called before a Minecraft server reloads data packs. +
-  * **ServerLifecycleEvents.SYNC_DATA_PACK_CONTENTS**: Called when a Minecraft server is about to send tag and recipe data to a player.+
  
 ===== Loot ===== ===== Loot =====
 +  * **LootTableEvents.REPLACE**: Replaces loot tables.
   * **LootTableEvents.MODIFY**: Called when a loot table is loading to modify loot tables.   * **LootTableEvents.MODIFY**: Called when a loot table is loading to modify loot tables.
-  * **LootTableEvents.REPLACE**: Replaces loot tables.+  * **LootTableEvents.ALL_LOADED**: Called after all loot tables have been loaded and modified. 
 +  * **LootTableEvents.MODIFY_DROPS**: Similar to MODIFY, except can be used to modify many loot tables without having to add a custom loot function to every table.
  
-===== Messages ===== 
  
-  * **ServerMessageEvents.ALLOW_CHAT_MESSAGE**: Checks whether chat messages are allowed on the server. Will be called only if ALLOW_COMMAND_MESSAGE event did not block the message, and after triggering COMMAND_MESSAGE event+===== Model ===== 
-  * **ServerMessageEvents.ALLOW_COMMAND_MESSAGE**: Checks whether command messages are allowed on the serverALLOW_CHAT_MESSAGE and CHAT_MESSAGE events will also be triggered after triggering COMMAND_MESSAGE+  * **ModelLoadingPlugin.Context.modifyModelOnLoad()**: Called to modify/replace an UnbakedModel right after it is loaded
-  * **ServerMessageEvents.ALLOW_GAME_MESSAGE**: Checks whether game messages are allowed on the server+  * **ModelLoadingPlugin.Context.modifyBlockModelOnLoad()**: Called to modify/replace a BlockStateModel.UnbakedRoot (Unbaked block model) right after it is loaded
-  * **ServerMessageEvents.CHAT_MESSAGE**: Triggered when the server broadcasts chat message sent by a player, typically from a client GUI or a player-executed command. Will be called only if ALLOW_COMMAND_MESSAGE event did not block the message, and after triggering COMMAND_MESSAGE event+  * **ModelLoadingPlugin.Context.modifyBlockModelBeforeBake()**: Called to modify/replace a BlockStateModel.UnbakedRoot right before it is baked. Gives access to the ModelBaker
-  * **ServerMessageEvents.COMMAND_MESSAGE**: Triggered when the server broadcasts a command message to all players, such as one from /me, /msg, /say, and /tellrawALLOW_CHAT_MESSAGE and CHAT_MESSAGE events will also be triggered afterwards+  * **ModelLoadingPlugin.Context.modifyBlockModelAfterBake()**: Called to modify/replace BlockStateModel right after it is baked
-  * **ServerMessageEvents.GAME_MESSAGE**: Triggered when the server broadcasts a game message to all players. Game messages include death messages, join/leave messages, and advancement messages.+  * **ModelLoadingPlugin.Context.modifyItemModelBeforeBake()**: Called to modify/replace an ItemModel.Unbaked right before it is baked
 +  * **ModelLoadingPlugin.Context.modifyItemModelAfterBake()**: Called to modify/replace an ItemModel right after it is baked. 
 +  * **BuiltInBlockModelsCallback.EVENT**: Called when custom block models are registered in BuiltInBlockModels.createBlockModels(...). Allows for overriding block models that get used in BlockModelResolver. 
  
 ===== Networking ===== ===== Networking =====
 +==== Configuration ====
 +=== Client ===
 +  * **ServerboundConfigurationChannelEvents.REGISTER**: Called when the server is capable of receiving packets in certain channels. May be invoked at any point between login and disconnection.
 +  * **ServerboundConfigurationChannelEvents.UNREGISTER**: Called when the server is no longer capable of receiving packets in certain channels. May be invoked at any point between login and disconnection.
 +  * **ClientConfigurationConnectionEvents.INIT**: Called once a connection has entered the CONFIGURATION state, ready for registering channel handlers. Do not send packets during this event.
 +  * **ClientConfigurationConnectionEvents.START**: Called once the connection has been initialized and can send and receive configuration packets.
 +  * **ClientConfigurationConnectionEvents.COMPLETE**: Called after the ClientboundFinishConfigurationPacket was received, just before switching to the PLAY state. Do not send packets during this event.
 +  * **ClientConfigurationConnectionEvents.DISCONNECT**: Called right before the client configuration packet listener is disconnected. Do not send packets during this event. 
 +=== Server ===  
 +  * **ClientboundConfigurationChannelEvents.REGISTER**: Called when the client is capable of receiving packets in certain channels. May be invoked at any point between login and disconnection.
 +  * **ClientboundConfigurationChannelEvents.UNREGISTER**: Called when the client is no longer capable of receiving packets in certain channels. May be invoked at any point between login and disconnection.
 +  * **ServerConfigurationConnectionEvents.BEFORE_CONFIGURE**: Called before any vanilla configuration has taken place. Tasks here will execute before any vanilla configuration
 +  * **ServerConfigurationConnectionEvents.CONFIGURE**: Called during vanilla configuration. 
 +  * **ServerConfigurationConnectionEvents.DISCONNECT**: Called right before the server configuration packet listener is disconnected. Do not send packets during this event.
 +==== Login ====
 +=== Client ===
 +  * **ClientLoginConnectionEvents.INIT**: Called when a connection reaches the LOGIN state, ready for registering query request handlers. May be used for preparing client side states. Does not guarantee a successful login attempt.
 +  * **ClientLoginConnectionEvents.QUERY_START**: Called when the client receives its first login query. Vanilla servers typically will not make the client enter this phase. Do not send packets during this event.
 +  * **ClientLoginConnectionEvents.DISCONNECT**: Called when the client's login process ended due to disconnection. Do not send packets during this event.
 +=== Server ===
 +  * **ServerLoginConnectionEvents.INIT**: Called when a connection reaches the LOGIN state, ready for registering query response handlers.
 +  * **ServerLoginConnectionEvents.QUERY_START**: Called just before the first login query response is processed. May be used for registering response handlers. You may send login queries during this event to the connected client.
 +  * **ServerLoginConnectionEvents.DISCONNECT**: Called when the server login packet listener is disconnected. Do not send packets during this event.
 +==== Play ====
 +=== Client ===
 +  * **ServerboundPlayChannelEvents.REGISTER**: Called when the server is capable of receiving packets in certain channels. May be invoked at any point between login and disconnection.
 +  * **ServerboundPlayChannelEvents.UNREGISTER**: Called when the server is no longer capable of receiving packets in certain channels. May be invoked at any point between login and disconnection.
 +  * **ClientPlayConnectionEvents.INIT**: Called when a connection reaches the PLAY state, ready for registering channel handlers. Do not send packets during this event.
 +  * **ClientPlayConnectionEvents.JOIN**: Called when the client play packet listener is ready to send packets to the server.
 +  * **ClientPlayConnectionEvents.DISCONNECT**: Called when the client play packet listener is disconnected. Do not send packets during this event.
 +=== Server ===
 +  * **ClientboundPlayChannelEvents.REGISTER**: Called when the client is capable of receiving packets in certain channels. May be invoked at any point between login and disconnection.
 +  * **ClientboundPlayChannelEvents.UNREGISTER**: Called when the client is no longer capable of receiving packets in certain channels. May be invoked at any point between login and disconnection.
 +  * **ServerPlayConnectionEvents.INIT**: Called when a connection reaches the PLAY state, ready for registering channel handlers. Do not send packets during this event.
 +  * **ServerPlayConnectionEvents.JOIN**: Called when the server game packet listener is ready to send packets to the client.
 +  * **ServerPlayConnectionEvents.DISCONNECT**: Called when the server game packet listener is disconnected. Do not send packets during this event.
 +==== Tracking ====
 +  * **EntityTrackingEvents.START_TRACKING**: Called after a player starts tracking an entity. Typically occurs when an entity enters a client's view distance.
 +  * **EntityTrackingEvents.STOP_TRACKING**: Called before player has stopped tracking an entity. The entity still exists on the server and on the player's client.
  
-  * **C2SPlayChannelEvents.REGISTER**: For the client play network handler receiving an update indicating the connected server's ability to receive packets in certain channels. 
-  * **C2SPlayChannelEvents.UNREGISTER**: For the client play network handler receiving an update indicating the connected server's lack of ability to receive packets in certain channels. 
-  * **ClientLogicConnectionEvents.DISCONNECT**: Called when the client's login process has ended due to disconnection. 
-  * **ClientLogicConnectionEvents.INIT**: Called to indicate a connection has entered the LOGIN state, ready for registering query request handlers. May be used by mods to prepare their client side state. Does not guarantee that a login attempt will be successful. 
-  * **ClientLogicConnectionEvents.QUERY_START**: Called when the client has started receiving login queries. A client can only start receiving login queries when a server has sent the first login query. 
-  * **ClientPlayConnectionEvents.DISCONNECT**: Called for the disconnection of the client play network handler. 
-  * **ClientPlayConnectionEvents.INIT**: Called to indicate a connection entered the PLAY state, ready for registering channel handlers. 
-  * **ClientPlayConnectionEvents.JOIN**: Called to notify when the client play network handler is ready to send packets to the server. 
-  * **S2CPlayChannelEvents.REGISTER**: For the server play network handler receiving an update indicating the connected client's ability to receive packets in certain channels. 
-  * **S2CPlayChannelEvents.UNREGISTER**: For the server play network handler receiving an update indicating the connected client's lack of ability to receive packets in certain channels. 
-  * **ServerLoginConnectionEvents.DISCONNECT**: Called for the disconnection of the server login network handler. 
-  * **ServerLoginConnectionEvents.INIT**:  Called to indicate a connection entered the LOGIN state, ready for registering query response handlers. 
-  * **ServerLoginConnectionEvents.QUERY_START**: Called for the start of login queries of the server login network handler. 
-  * **ServerPlayConnectionEvents.DISCONNECT**: Called for the disconnection of the server play network handler. 
-  * **ServerPlayConnectionEvents.INIT**: Called to indicate a connection has entered the PLAY state, ready for registering channel handlers. 
-  * **ServerPlayConnectionEvents.JOIN**: Called to notify when the server play network handler is ready to send packets to the client. 
  
-===== Players =====+===== Particles ===== 
 +  * **ParticleRenderEvents.ALLOW_TERRAIN_PARTICLE_TINT**: Used to stop a terrain paricle from being tinted with its block's BlockTintSource.
  
 +
 +===== Permission =====
 +  * **PermissionEvents.ON_REQUEST**: Called to convert a PermissionNode<T> into a T with the given context.
 +  * **PermissionEvents.PREPARE_OFFLINE_PLAYER**: Called to prepare a MutablePermissionContext for an offline player.
 +
 +===== Players =====
 +==== Block ====
   * **AttackBlockCallback.EVENT**: Called when left-clicking ("attacking") a block. Is hooked before the spectator check, so check for player's gamemode.   * **AttackBlockCallback.EVENT**: Called when left-clicking ("attacking") a block. Is hooked before the spectator check, so check for player's gamemode.
-  * **AttackEntityCallback.EVENT**: Called when left-clicking ("attacking") an entity. Is hooked before the spectator check, so check for player's gamemode+  * **BlockEvents.USE_ITEM_ON**: Called after the player interacts with a block while holding an item
-  * **PlayerBreakBlockEvents.AFTER**: Called after a block is successfully broken.+  * **BlockEvents.USE_WITHOUT_ITEM**: Called after the player interacts with a block while not holding an item.
   * **PlayerBreakBlockEvents.BEFORE**: Called before a block is broken and allows cancelling the block breaking.   * **PlayerBreakBlockEvents.BEFORE**: Called before a block is broken and allows cancelling the block breaking.
 +  * **PlayerBreakBlockEvents.AFTER**: Called after a block is successfully broken.
   * **PlayerBreakBlockEvents.CANCELED**: Called when a block break is cancelled.   * **PlayerBreakBlockEvents.CANCELED**: Called when a block break is cancelled.
   * **UseBlockCallback.EVENT**: Called when right-clicking ("using") a block. Is hooked before the spectator check, so check for player's gamemode.   * **UseBlockCallback.EVENT**: Called when right-clicking ("using") a block. Is hooked before the spectator check, so check for player's gamemode.
-  * **UseEntityCallback.EVENT**: Called when right-clicking ("using"an entityIs hooked before the spectator checkso check for player's gamemode.+==== Item ==== 
 +  * **ItemEvents.USE_ON**: Called when an item is used on something. 
 +  * **ItemEvents.USE**: Called when an item is used by a playerlike when eating. 
 +  * **PlayerPickItemEvents.BLOCK**: Called when a player requests to pick the item for a block at a certain position. 
 +  * **PlayerPickItemEvents.ENTITY**: Called when a player requests to pick the item for an entity.
   * **UseItemCallback.EVENT**: Called when right-clicking ("using") an item. Is hooked before the spectator check, so check for player's gamemode.   * **UseItemCallback.EVENT**: Called when right-clicking ("using") an item. Is hooked before the spectator check, so check for player's gamemode.
 +==== Entity ====
 +  * **AttackEntityCallback.EVENT**: Called when left-clicking ("attacking") an entity. Is hooked before the spectator check, so check for player's gamemode.
 +  * **UseEntityCallback.EVENT**: Called when right-clicking ("using") an entity. Is hooked before the spectator check, so check for player's gamemode.
    
 +
 ===== Registry===== ===== Registry=====
 +==== Dynamic ====
 +  * **DynamicRegistrySetupCallback.EVENT**: Triggered when a new DynamicRegistryManager gets created, but before it gets filled. The ideal place to register callbacks to dynamic registries.
 +==== Entry ====
 +  * **RegistryEntryAddedCallback.event()**: Returns an event for the given registry that is called every time a new entry is added.
 +  * **RegistryIdRemapCallback.event**: Returns an event for the given registry that is used to map all entries of a registry to some other object.
 +==== Fuel ====
 +  * **FuelValueEvents.BUILD**: Called right after vanilla fuel values have been added but before vanilla exclusions.
 +  * **FuelValueEvents.EXCLUSIONS**: Called after vanilla exclusions have been applied, and after all modded additions have been made.
  
-  * **DynamicRegistrySetupCallback.EVENT**:Triggered when a new DynamicRegistryManager gets created, but before it gets filled. The ideal place to register callbacks to dynamic registries. 
  
-===== Rendering ===== +===== Screen ===== 
- +==== Render ==== 
-  * **HudRenderCallback.EVENT**: Called after rendering the whole hud, which is displayed in game, in a world+  * **ScreenEvents.BEFORE_INIT**: Called before a screen is initialized to its default state. Some methods in Screens such as screen's font may not be initialized. Typically used to register tick, render, keyboard, and mouse events, or to add or remove child elements
-  * **InvalidateRenderStateCallback.EVENT**: Called when the world renderer reloadsusually as result of changing resource pack or video configuration, or when the player types F3+A in the debug screen. Afterwards all render chunks will be reset and reloaded+  * **ScreenEvents.AFTER_INIT**: Called after a screen is initialized to its default state. Typically used to change the size of elements. Things such as a screen's font will be initializedand this event can be used for the same purposes as BEFORE_INIT. Elements will not automatically be drawn. 
-  * **LivingEntityFeatureRendererRegistrationCallback.EVENT**: Called when feature renderers for living entity renderer are registered+  * **ScreenEvents.remove()**: Returns an event that is called when the given screen has had Screen.removed() called. May precede BEFORE_INITand there is no guarantee that it will be called immediately after. Typically used to undo any screen specific state changes or to terminate threads spawned by a screen. 
-  * **LivingEntityFeatureRenderEvents.ALLOW_CAPE_RENDER**: Can prevent capes from rendering.+  * **ScreenEvents.beforeExtract()**: Returns an event that is called before the given screen is extracted. 
 +  * **ScreenEvents.afterBackground()**: Returns an event that is called after the given screen's background is extracted. 
 +  * **ScreenEvents.afterExtract()**: Returns an event that is called after the given screen is extracted. 
 +  * **ScreenEvents.beforeTick()**: Returns an event that is called before the given screen is ticked. 
 +  * **ScreenEvents.afterTick()**: Returns an event that is called after the given screen is ticked. 
 +==== Keyboard ==== 
 +  * **ScreenKeyboardEvents.allowKeyPress()**: Returns an event that checks if a key press should be allowed on the given screen
 +  * **ScreenKeyboardEvents.beforeKeyPress()**: Returns an event that is called before key press is processed on the given screen
 +  * **ScreenKeyboardEvents.afterKeyPress()**: Returns an event that is called after a key press is processed on the given screen. 
 +  * **ScreenKeyboardEvents.allowKeyRelease()**: Returns an event that checks if a key press should be allowed to release on the given screen. 
 +  * **ScreenKeyboardEvents.beforeKeyRelease()**: Returns an event that is called before a key release is processed on the given screen. 
 +  * **ScreenKeyboardEvents.afterKeyRelease()**: Returns an event that is called after a key release is processed on the given screen. 
 +  * **ScreenKeyboardEvents.allowCharType()**: Returns an event that checks if typing a character should be allowed on the given screen. 
 +  * **ScreenKeyboardEvents.beforeCharType()**: Returns an event that is called before a typed character is processed on the given screen. 
 +  * **ScreenKeyboardEvents.afterCharType()**: Returns an event that is called after a typed character is processed on the given screen. 
 +==== Mouse ==== 
 +  * **ScreenMouseEvents.allowMouseClick()**: Returns an event that checks if a mouse click should be allowed on the given screen. 
 +  * **ScreenMouseEvents.beforeMouseClick()**: Returns an event that is called before a mouse click is processed on the given screen. 
 +  * **ScreenMouseEvents.afterMouseClick()**: Returns an event that is called after a mouse click is processed on the given screen. 
 +  * **ScreenMouseEvents.allowMouseRelease()**: Returns an event that checks if a mouse click should be allowed to release on the given screen. 
 +  * **ScreenMouseEvents.beforeMouseRelease()**: Returns an event that is called before a mouse click release is processed on the given screen. 
 +  * **ScreenMouseEvents.afterMouseRelease()**: Returns an event that is called after a mouse click release is processed on the given screen. 
 +  * **ScreenMouseEvents.allowMouseDrag()**: Returns an event that checks if a mouse should be allowed to drag on the given screen. 
 +  * **ScreenMouseEvents.beforeMouseDrag()**: Returns an event that is called before a mouse dragging is processed on the given screen. 
 +  * **ScreenMouseEvents.afterMouseDrag()**: Returns an event that is called after a mouse dragging is processed on the given screen. 
 +  * **ScreenMouseEvents.allowMouseScroll()**: Returns an event that checks if a mouse should be allowed to scroll on the given screen. 
 +  * **ScreenMouseEvents.beforeMouseScroll()**: Returns an event that is called before a mouse scrolling is processed on the given screen. 
 +  * **ScreenMouseEvents.afterMouseScroll()**: Returns an event that is called after a mouse scrolling is processed on the given screen.
  
  
 ===== Server ===== ===== Server =====
-  +==== MobEffect ==== 
-  * **ServerBlockEntityEvents.BLOCK_ENTITY_LOAD**: Called when BlockEntity is loaded into a ServerWorld. When this event is called, the block entity is already in the world+  * **ServerMobEffectEvents.ALLOW_ADD**: Check for if a LivingEntity can have a mob effect applied to it. 
-  * **ServerBlockEntityEvents.BLOCK_ENTITY_UNLOAD**: Called when BlockEntity is about to be unloaded from ServerWorld. When this event is called, the block entity is still present in the world+  * **ServerMobEffectEvents.BEFORE_ADD**: Called before LivingEntity has an effect applied to it
-  * **ServerChunkEvents.CHUNK_LOAD**: Called when chunk is loaded into a ServerWorldWhen this event is called, the chunk is already in the world+  * **ServerMobEffectEvents.AFTER_ADD**: Called after LivingEntity has an effect applied to it. 
-  * **ServerChunkEvents.CHUNK_UNLOAD**: Called when chunk is about to be unloaded from a ServerWorld. When this event is called, the chunk is still present in the world.+  * **ServerMobEffectEvents.ALLOW_EARLY_REMOVE**: Check for if LivingEntity can remove an effect before the time left runs out
 +  * **ServerMobEffectEvents.BEFORE_REMOVE**: Called before LivingEntity removes an effectMay be before or after ALLOW_EARLY_REMOVE is called, depending on which method was used to remove the effect
 +  * **ServerMobEffectEvents.AFTER_REMOVE**: Called after LivingEntity removes an effect. 
 +==== Entity ====
   * **ServerEntityCombatEvents.AFTER_KILLED_OTHER_ENTITY**: Called after an entity has killed another entity.   * **ServerEntityCombatEvents.AFTER_KILLED_OTHER_ENTITY**: Called after an entity has killed another entity.
-  * **ServerEntityEvents.ENTITY_LOAD**: Called when an Entity is loaded into ServerWorldWhen this event is called, the entity is already in the world+  * **ServerEntityLevelChangeEvents.AFTER_ENTITY_CHANGE_LEVEL**: Called after an entity is transferred to new levelNot called for players. 
-  * **ServerEntityEvents.ENTITY_UNLOAD**: Called when an Entity is about to be unloaded from ServerWorld. When this event is called, the entity is still present in the world+  * **ServerEntityLevelChangeEvents.AFTER_PLAYER_CHANGE_LEVEL**: Called after a player has been moved to a different level. 
-  * **ServerEntityWorldChangeEvents.AFTER_ENTITY_CHANGE_WORLD**: Called after an entity is transferred to new worldNot called for players+  * **ServerLivingEntityEvents.ALLOW_DAMAGE**: Check for if a LivingEntity will have damage applied to it. Returning false cancels the damage. 
-  * **ServerEntityWorldChangeEvents.AFTER_PLAYER_CHANGE_WORLD**: Called after a player has been moved to a different world+  * **ServerLivingEntityEvents.AFTER_DAMAGE**: Called after a LivingEntity had damage applied to it. Not fired if the entity was killed by the damage. 
-  * **ServerPlayerEvents.AFTER_RESPAWN**: Called after player has been respawned. +  * **ServerLivingEntityEvents.ALLOW_DEATH**: Check for if a LivingEntity should die after taking fatal damage. Even if the event is cancelled, the entity will still die next tick, so the listener must do something to prevent this. Includes the player. 
-  * **ServerPlayerEvents.ALLOW_DEATH**: Called when a player takes fatal damage, before totems of undying can take effect.+  * **ServerLivingEntityEvents.AFTER_DEATH**: Called when a LivingEntity dies. 
 +  * **ServerLivingEntityEvents.MOB_CONVERSION**: Called when a mob is being converted to another type. The old instance has still not yet been discarded, and the new one has not been spawned yet. Does not cover mooshrooms getting hit by lightning, creepers getting charged, wolves being tamed, and some other special cases
 +  * **ServerEntityEvents.ENTITY_LOAD**: Called when an Entity is loaded into ServerLevel. When this event is called, the entity is already in the level
 +  * **ServerEntityEvents.ALLOW_LOAD**: Called before an Entity is loaded into ServerLevelCan be used to stop the entity from being loaded in
 +  * **ServerEntityEvents.ENTITY_UNLOAD**: Called when an Entity is about to be unloaded from ServerLevel. When this event is called, the entity is still present in the level
 +  * **ServerEntityEvents.EQUIPMENT_CHANGE**: Called when LivingEntity's equipment has been changed or mutatedAlso called when the entity joins the level. 
 +==== Player ====
   * **ServerPlayerEvents.COPY_FROM**: Called when player data is copied to a new player.   * **ServerPlayerEvents.COPY_FROM**: Called when player data is copied to a new player.
-  * **ServerTickEvents.END_SERVER_TICK**: Called at the end of the server tick+  * **ServerPlayerEvents.AFTER_RESPAWN**: Called after a player has been respawned. 
-  * **ServerTickEvents.END_WORLD_TICK**: Called at the end of the ServerWorld's tick.+  * **ServerPlayerEvents.JOIN**: Called when a player has joined the game, after they have been fully loaded into the world. Includes Singleplayer
 +  * **ServerPlayerEvents.LEAVE**: Called when a player has left the game, after they have been saved and removed from the world. Includes Singleplayer. 
 +==== BlockEntity ==== 
 +  * **ServerBlockEntityEvents.BLOCK_ENTITY_LOAD**: Called when a BlockEntity is loaded into a ServerLevel. When this event is called, the block entity is already in the level, but its data may not be loaded yet. 
 +  * **ServerBlockEntityEvents.BLOCK_ENTITY_UNLOAD**: Called when a BlockEntity is about to be unloaded from a ServerLevel. When this event is called, the block entity is still present in the level. 
 +==== Chunk ==== 
 +  * **ServerChunkEvents.CHUNK_LOAD**: Called when a chunk is loaded into a ServerLevel. When this event is called, the chunk is already in the level. 
 +  * **ServerChunkEvents.CHUNK_UNLOAD**: Called when a chunk is about to be unloaded from a ServerLevel. When this event is called, the chunk is still present in the level. This may not be called immediately after a chunk becomes inaccessible. 
 +  * **ServerChunkEvents.FULL_CHUNK_STATUS_CHANGE**: Called when a chunk'ticking behavior is about to align with its new FullChunkStatus. Entities within the chunk are not guaranteed to be accessible. 
 +==== Level ==== 
 +  * **ServerLevelEvents.LOAD**: Called just after a level is loaded by a Minecraft server 
 +  * **ServerLevelEvents.UNLOAD**: Called before a level is unloaded by a Minecraft server. Typically called after a server has started shutting down. 
 +==== Lifecycle ==== 
 +  * **ServerLifecycleEvents.SERVER_STARTING**: Called when a Minecraft server is starting. This occurs before the player manager and any levels are loaded. 
 +  * **ServerLifecycleEvents.SERVER_STARTED**: Called when a Minecraft server has started and is about to tick for the first timeAt this stage, all levels are live. 
 +  * **ServerLifecycleEvents.SERVER_STOPPING**: Called when a Minecraft server has started shutting down. This occurs before the server's network channel is closed and before any players are disconnected. 
 +  * **ServerLifecycleEvents.SERVER_STOPPED**: Called when a Minecraft server has stopped. All levels have been closed and all (block)entities and players have been unloaded. 
 +  * **ServerLifecycleEvents.SYNC_DATA_PACK_CONTENTS**: Called when a Minecraft server is about to send tag and recipe data to a player. 
 +  * **ServerLifecycleEvents.START_DATA_PACK_RELOAD**: Called before a Minecraft server reloads data packs. 
 +  * **ServerLifecycleEvents.END_DATA_PACK_RELOAD**: Called after a Minecraft server has reloaded data packs. If reloading data packs was unsuccessful, the current data packs will be kept. 
 +  * **ServerLifecycleEvents.BEFORE_SAVE**: Called before a Minecraft server begins saving data. 
 +  * **ServerLifecycleEvents.AFTER_SAVE**: Called after a Minecraft server finishes saving data. 
 +==== Tick ====
   * **ServerTickEvents.START_SERVER_TICK**: Called at the start of the server tick.   * **ServerTickEvents.START_SERVER_TICK**: Called at the start of the server tick.
-  * **ServerTickEvents.START_WORLD_TICK**: Called at the start of the ServerWorld's tick. +  * **ServerTickEvents.END_SERVER_TICK**: Called at the end of the server tick. 
-  * **ServerWorldEvents.LOAD**: Called just after world is loaded by Minecraft server +  * **ServerTickEvents.START_LEVEL_TICK**: Called at the start of the ServerLevel's tick. 
-  * **ServerWorldEvents.UNLOAD**: Called before world is unloaded by a Minecraft server.+  * **ServerTickEvents.END_LEVEL_TICK**: Called at the end of the ServerLevel's tick. 
 +==== Message ==== 
 +  * **ServerMessageDecoratorEvent.EVENT**: Allows for registering custom ChatDecorators. Has ContentPhase for modifying the component contents, and StylingPhase, for only modifying the styling. 
 +  * **ServerMessageEvents.ALLOW_CHAT_MESSAGE**: Checks whether chat messages are allowed on the server. Will be called only if ALLOW_COMMAND_MESSAGE event did not block the message, and after triggering COMMAND_MESSAGE event. 
 +  * **ServerMessageEvents.ALLOW_GAME_MESSAGE**: Checks whether game messages are allowed on the server. 
 +  * **ServerMessageEvents.ALLOW_COMMAND_MESSAGE**: Checks whether command messages are allowed on the server. ALLOW_CHAT_MESSAGE and CHAT_MESSAGE events will also be triggered after triggering COMMAND_MESSAGE. 
 +  * **ServerMessageEvents.CHAT_MESSAGE**: Triggered when the server broadcasts chat message sent by a player, typically from a client GUI or a player-executed command. Will be called only if ALLOW_COMMAND_MESSAGE event did not block the message, and after triggering COMMAND_MESSAGE event. 
 +  * **ServerMessageEvents.GAME_MESSAGE**: Triggered when the server broadcasts a game message to all players. Game messages include death messages, join/leave messages, and advancement messages. 
 +  * **ServerMessageEvents.COMMAND_MESSAGE**: Triggered when the server broadcasts a command message to all players, such as one from /me, /msg, /say, and /tellraw. ALLOW_CHAT_MESSAGE and CHAT_MESSAGE events will also be triggered afterwards.
tutorial/event_index.1759794808.txt.gz · Last modified: 2025/10/06 23:53 by eesa