User Tools

Site Tools


tutorial:event_index

This is an old revision of the document!


Event Index

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.

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

  • ItemTooltipCallback:
  • ClientPickBlockApplyCallback
  • ClientPickBlockGatherCallback
  • ClientLifecycleEvents.CLIENT_STARTED: Called when Minecraft has started and it's client about to tick for the first time.
  • ClientLifecycleEvents.CLIENT_STOPPING: Called when Minecraft's client begins to stop.
  • ClientTickEvents.END_CLIENT_TICK: Called at the end of the client tick.
  • ClientTickEvents.END_WORLD_TICK
  • ClientTickEvents.START_CLIENT_TICK: Called at the start of the client tick.
  • ClientTickEvents.START_WORLD_TICK

Commands

  • CommandRegistrationCallback: Called when a server registers all commands

Entities (General)

  • EntityElytraEvents.ALLOW: For checking whether elytra flight is allowed.
  • EntityElytraEvents.CUSTOM: For granting elytra flight to entities not wearing an elytra.
  • EntitySleepEvents.ALLOW_NEARBY_MONSTERS
  • EntitySleepEvents.ALLOW_RESETTING_TIME
  • EntitySleepEvents.ALLOW_SETTING_SPAWN
  • 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.
  • ServerEntityCombatEvents.AFTER_KILLED_OTHER_ENTITY
  • ServerEntityWorldChangeEvents.AFTER_ENTITY_CHANGE_WORLD: Called after an entity is transferred to a new world. Not called for players.

Players

  • ServerEntityWorldChangeEvents.AFTER_PLAYER_CHANGE_WORLD
  • ServerPlayerEvents.AFTER_RESPAWN
  • ServerPlayerEvents.ALLOW_DEATH
  • ServerPlayerEvents.COPY_FROM
tutorial/event_index.1648253294.txt.gz · Last modified: 2022/03/26 00:08 by 127.0.0.1