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
Next revision
Previous revision
tutorial:event_index [2022/03/21 01:40] – ↷ Page moved from event_index to tutorial:event_index solidblocktutorial: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''.
 ===== Client ===== ===== Client =====
- +==== Hotbar ==== 
-  * **ItemTooltipCallback**:  +  * **ClientHotbarScrollEvents.ALLOW**: Can be used to cancel the change of the selected hotbar slot. 
-  * **ClientPickBlockApplyCallback** +  * **ClientHotbarScrollEvents.BEFORE**: Called before the selected hotbar slot changes, after the ALLOW check. 
-  * **ClientPickBlockGatherCallback** +  * **ClientHotbarScrollEvents.AFTER**: Called after the selected hotbar slot changes. 
-  * **ClientLifecycleEvents.CLIENT_STARTED**: Called when Minecraft has started and it'client about to tick for the first time+==== Player ==== 
-  * **ClientLifecycleEvents.CLIENT_STOPPING**: Called when Minecraft's client begins to stop+  * **ClientPlayerBlockBreakEvents.AFTER**: Called after a block is broken client side. 
-  * **ClientTickEvents.END_CLIENT_TICK**: Called at the end of the client tick. +  * **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. 
-  * **ClientTickEvents.END_WORLD_TICK**+==== 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 ClientLevelWhen 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_STOPPING**: Called when Minecraft's client begins to stop, before an integrated server stops, if applicable. 
 +==== Tick ====
   * **ClientTickEvents.START_CLIENT_TICK**: Called at the start of the client tick.   * **ClientTickEvents.START_CLIENT_TICK**: Called at the start of the client tick.
-  * **ClientTickEvents.START_WORLD_TICK**+  * **ClientTickEvents.END_CLIENT_TICK**: Called at the end of the client tick. 
 +  * **ClientTickEvents.START_LEVEL_TICK**: Called at the start of the ClientLevel's tick. 
 +  * **ClientTickEvents.END_LEVEL_TICK**: Called at the end of the ClientLevel's tick. 
 +==== Command ==== 
 +  * **ClientCommandRegistrationCallback.EVENT**: For when client commands are registered to the dispatcher. 
 +==== Tooltip ==== 
 +  * **ClientTooltipComponentCallback.EVENT**: Allows registering a mapping from TooltipComponent to ClientTooltipComponent. This allows custom tooltips for items to be displayed properly in a screen. 
 +==== Recipe ==== 
 +  * **ClientRecipeSynchronizedEvent.EVENT**: Called when a client receives all synchronized recipes. Only invoked if the server supports Recipe Sync packets.
  
-===== Commands ====== 
  
-  * **CommandRegistrationCallback**: Called when a server registers all commands+===== Command ===== 
 +  * **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.
-  * **EntitySleepEvents.ALLOW_NEARBY_MONSTERS** +==== Sleep ==== 
-  * **EntitySleepEvents.ALLOW_RESETTING_TIME** +  * **EntitySleepEvents.ALLOW_SLEEPING**: For checking whether a player can start to sleep in a bed-like block. 
-  * **EntitySleepEvents.ALLOW_SETTING_SPAWN** +  * **EntitySleepEvents.START_SLEEPING**: Called when an entity starts to sleep.
-  * **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** +
-  * **EntitySleepEvents.MODIFY_WAKE_UP_POSITION** +
-  * **EntitySleepEvents.SET_BED_OCCUPATION_STATE** +
-  * **EntitySleepEvents.START_SLEEPING**: Called when an entity starts to sleep. +
   * **EntitySleepEvents.STOP_SLEEPING**: Called when an entity stops sleeping and wakes up.   * **EntitySleepEvents.STOP_SLEEPING**: Called when an entity stops sleeping and wakes up.
-  * **ServerEntityCombatEvents.AFTER_KILLED_OTHER_ENTITY** +  * **EntitySleepEvents.ALLOW_BED**: For checking whether a block is bed-like. 
-  * **ServerEntityWorldChangeEvents.AFTER_ENTITY_CHANGE_WORLD**: Called after an entity is transferred to a new worldNot called for players.+  * **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.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.ALLOW_SETTING_SPAWN**: For checking whether a player's spawn can be set when sleeping. 
 +  * **EntitySleepEvents.SET_BED_OCCUPATION_STATE**: For setting whether a bed block is occupied. 
 +  * **EntitySleepEvents.MODIFY_WAKE_UP_POSITION**: For modifying or providing a wake-up position for an entity waking up. 
 +==== Rendering ==== 
 +  * **LivingEntityFeatureRenderEvents.ALLOW_CAPE_RENDER**: Can prevent capes from rendering. 
 +  * **LivingEntityRenderLayerRegistrationCallback.EVENT**: Called when RenderLayers for a 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 ===== 
 +==== 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 bleed effect to sharpness. 
 +==== Rendering ==== 
 +  * **ExtractItemDecorationsCallback.EVENT**: Allows for drawing custom item stack decorations. Vanilla examples are: Durability bar, cooldown overlay, and stack count. 
 + 
 + 
 +===== 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. 
 + 
 + 
 +===== Loot ===== 
 +  * **LootTableEvents.REPLACE**: Replaces loot tables. 
 +  * **LootTableEvents.MODIFY**: Called when a loot table is loading to modify 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. 
 + 
 + 
 +===== Model ===== 
 +  * **ModelLoadingPlugin.Context.modifyModelOnLoad()**: Called to modify/replace an UnbakedModel right after it is loaded. 
 +  * **ModelLoadingPlugin.Context.modifyBlockModelOnLoad()**: Called to modify/replace a BlockStateModel.UnbakedRoot (Unbaked block model) right after it is loaded. 
 +  * **ModelLoadingPlugin.Context.modifyBlockModelBeforeBake()**: Called to modify/replace a BlockStateModel.UnbakedRoot right before it is baked. Gives access to the ModelBaker. 
 +  * **ModelLoadingPlugin.Context.modifyBlockModelAfterBake()**: Called to modify/replace a BlockStateModel right after it is baked. 
 +  * **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 ===== 
 +==== 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. 
 + 
 + 
 +===== 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 ===== ===== Players =====
 +==== Block ====
 +  * **AttackBlockCallback.EVENT**: Called when left-clicking ("attacking") a block. 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.
 +  * **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.AFTER**: Called after a block is successfully broken.
 +  * **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.
 +==== Item ====
 +  * **ItemEvents.USE_ON**: Called when an item is used on something.
 +  * **ItemEvents.USE**: Called when an item is used by a player, like 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.
 +==== 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=====
 +==== 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.
 +
  
-  * **ServerEntityWorldChangeEvents.AFTER_PLAYER_CHANGE_WORLD** +===== Screen ===== 
-  * **ServerPlayerEvents.AFTER_RESPAWN** +==== Render ==== 
-  * **ServerPlayerEvents.ALLOW_DEATH** +  * **ScreenEvents.BEFORE_INIT**: Called before a screen is initialized to its default state. Some methods in Screens such as a screen's font may not be initialized. Typically used to register tick, render, keyboard, and mouse events, or to add or remove child elements. 
-  * **ServerPlayerEvents.COPY_FROM**+  * **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 initialized, and this event can be used for the same purposes as BEFORE_INIT. Elements will not automatically be drawn. 
 +  * **ScreenEvents.remove()**: Returns an event that is called when the given screen has had Screen.removed() called. May precede BEFORE_INIT, and 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. 
 +  * **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 a 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 =====
 +==== MobEffect ====
 +  * **ServerMobEffectEvents.ALLOW_ADD**: Check for if a LivingEntity can have a mob effect applied to it.
 +  * **ServerMobEffectEvents.BEFORE_ADD**: Called before a LivingEntity has an effect applied to it.
 +  * **ServerMobEffectEvents.AFTER_ADD**: Called after a LivingEntity has an effect applied to it.
 +  * **ServerMobEffectEvents.ALLOW_EARLY_REMOVE**: Check for if a LivingEntity can remove an effect before the time left runs out.
 +  * **ServerMobEffectEvents.BEFORE_REMOVE**: Called before a LivingEntity removes an effect. May be before or after ALLOW_EARLY_REMOVE is called, depending on which method was used to remove the effect.
 +  * **ServerMobEffectEvents.AFTER_REMOVE**: Called after a LivingEntity removes an effect.
 +==== Entity ====
 +  * **ServerEntityCombatEvents.AFTER_KILLED_OTHER_ENTITY**: Called after an entity has killed another entity.
 +  * **ServerEntityLevelChangeEvents.AFTER_ENTITY_CHANGE_LEVEL**: Called after an entity is transferred to a new level. Not called for players.
 +  * **ServerEntityLevelChangeEvents.AFTER_PLAYER_CHANGE_LEVEL**: Called after a player has been moved to a different level.
 +  * **ServerLivingEntityEvents.ALLOW_DAMAGE**: Check for if a LivingEntity will have damage applied to it. Returning false cancels the damage.
 +  * **ServerLivingEntityEvents.AFTER_DAMAGE**: Called after a LivingEntity had damage applied to it. Not fired if the entity was killed by the damage.
 +  * **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.
 +  * **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 a ServerLevel. When this event is called, the entity is already in the level.
 +  * **ServerEntityEvents.ALLOW_LOAD**: Called before an Entity is loaded into a ServerLevel. Can be used to stop the entity from being loaded in.
 +  * **ServerEntityEvents.ENTITY_UNLOAD**: Called when an Entity is about to be unloaded from a ServerLevel. When this event is called, the entity is still present in the level.
 +  * **ServerEntityEvents.EQUIPMENT_CHANGE**: Called when a LivingEntity's equipment has been changed or mutated. Also called when the entity joins the level.
 +==== Player ====
 +  * **ServerPlayerEvents.COPY_FROM**: Called when player data is copied to a new player.
 +  * **ServerPlayerEvents.AFTER_RESPAWN**: Called after a player has been respawned.
 +  * **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's 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 time. At 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.END_SERVER_TICK**: Called at the end of the server tick.
 +  * **ServerTickEvents.START_LEVEL_TICK**: Called at the start of the ServerLevel's tick.
 +  * **ServerTickEvents.END_LEVEL_TICK**: Called at the end of the ServerLevel's tick.
 +==== Message ====
 +  * **ServerMessageDecoratorEvent.EVENT**: Allows for registering custom ChatDecorators. Has a ContentPhase for modifying the component contents, and a 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 a 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.1647826820.txt.gz · Last modified: 2022/03/21 01:40 by solidblock