Trait Hooks
pub trait Hooks:
Any
+ Send
+ Sync {
Show 578 methods
// Provided methods
fn register(&self, r: &mut dyn Registrar, cx: &RegistrationContext) { ... }
fn visuals(&self, host: &dyn ClientHost, event: &mut VisualsEvent<'_>) { ... }
fn emissive(&self, host: &dyn ClientHost, event: &mut EmissiveEvent<'_>) { ... }
fn world_lifecycle(
&self,
host: &mut dyn ServerHost,
event: &mut WorldLifecycleEvent<'_>,
) { ... }
fn server_about_to_start(
&self,
host: &mut dyn ServerHost,
event: &mut ServerAboutToStartEvent,
) { ... }
fn server_starting(
&self,
host: &mut dyn ServerHost,
event: &mut ServerStartingEvent,
) { ... }
fn server_started(
&self,
host: &mut dyn ServerHost,
event: &mut ServerStartedEvent,
) { ... }
fn server_stopping(
&self,
host: &mut dyn ServerHost,
event: &mut ServerStoppingEvent,
) { ... }
fn server_stopped(
&self,
host: &mut dyn ServerHost,
event: &mut ServerStoppedEvent,
) { ... }
fn server_tick(
&self,
host: &mut dyn ServerHost,
event: &mut ServerTickEvent<'_>,
) { ... }
fn level_tick_pre(&self, host: HostSide<'_>, event: &mut LevelTickPreEvent) { ... }
fn level_tick_post(
&self,
host: HostSide<'_>,
event: &mut LevelTickPostEvent,
) { ... }
fn block_changed(
&self,
level: &dyn LevelHost,
event: &mut BlockChangedEvent,
) { ... }
fn command(
&self,
host: &mut dyn ClientHost,
event: &mut CommandEvent<'_>,
) -> Flow { ... }
fn register_client_commands(
&self,
host: &mut dyn ClientHost,
event: &mut RegisterClientCommandsEvent<'_>,
) { ... }
fn zoom(&self, host: &dyn ClientHost, event: &mut ZoomEvent) -> Option<Zoom> { ... }
fn minimap(
&self,
host: &dyn ClientHost,
event: &mut MinimapEvent,
) -> Option<Minimap> { ... }
fn setting_changed(
&self,
host: &mut dyn ClientHost,
event: &mut SettingChangedEvent<'_>,
) { ... }
fn panel_event(
&self,
host: &mut dyn ClientHost,
event_: &mut PanelEventEvent<'_>,
) { ... }
fn block_entity_container(
&self,
host: &dyn Host,
event: &mut BlockEntityContainerEvent<'_>,
) -> Option<ModContainer> { ... }
fn register_commands(
&self,
host: &mut dyn ServerHost,
event: &mut RegisterCommandsEvent<'_>,
) { ... }
fn run_mod_command(
&self,
host: &mut dyn ServerHost,
event: &mut RunModCommandEvent<'_>,
) -> Flow { ... }
fn menu_clicked(
&self,
host: &mut dyn ServerHost,
event: &mut MenuClickedEvent,
) { ... }
fn menu_closed(
&self,
host: &mut dyn ServerHost,
event: &mut MenuClosedEvent,
) { ... }
fn break_block(
&self,
host: &mut dyn ServerHost,
event: &mut BreakBlockEvent<'_>,
) -> Flow { ... }
fn right_click_block(
&self,
host: HostSide<'_>,
event: &mut RightClickBlockEvent<'_>,
) -> Flow { ... }
fn block_spread(
&self,
level: &dyn LevelHost,
event: &mut BlockSpreadEvent<'_>,
) -> Flow { ... }
fn piston_pre(
&self,
level: &dyn LevelHost,
event: &mut PistonPreEvent<'_>,
) -> Flow { ... }
fn piston_post(
&self,
level: &dyn LevelHost,
event: &mut PistonPostEvent<'_>,
) { ... }
fn explosion_detonate(
&self,
host: &mut dyn ServerHost,
event: &mut ExplosionDetonateEvent<'_>,
) { ... }
fn fill_bucket(
&self,
host: &mut dyn ServerHost,
event: &mut FillBucketEvent<'_>,
) -> Flow { ... }
fn attack_entity(
&self,
host: &mut dyn ServerHost,
event: &mut AttackEntityEvent<'_>,
) -> Flow { ... }
fn net_from_client(
&self,
host: &mut dyn ServerHost,
event: &mut NetFromClientEvent<'_>,
) { ... }
fn net_from_server(
&self,
host: &mut dyn ClientHost,
event: &mut NetFromServerEvent<'_>,
) { ... }
fn player_died(
&self,
host: &mut dyn ServerHost,
event: &mut PlayerDiedEvent<'_>,
) { ... }
fn mob_spawned(
&self,
host: &mut dyn ServerHost,
event: &mut MobSpawnedEvent<'_>,
) { ... }
fn mob_killed(
&self,
host: &mut dyn ServerHost,
event: &mut MobKilledEvent<'_>,
) { ... }
fn item_picked_up(
&self,
host: &mut dyn ServerHost,
event: &mut ItemPickedUpEvent<'_>,
) -> Flow { ... }
fn on_equip(&self, host: &mut dyn ServerHost, event: &mut OnEquipEvent<'_>) { ... }
fn health_hud(
&self,
host: &mut dyn ClientHost,
event: &mut HealthHudEvent<'_>,
) -> Option<Vec<GuiDraw>> { ... }
fn entity_interact(
&self,
host: &mut dyn ServerHost,
event: &mut EntityInteractEvent<'_>,
) -> Flow { ... }
fn left_click_block(
&self,
host: &mut dyn ServerHost,
event: &mut LeftClickBlockEvent,
) -> Flow { ... }
fn player_tick_pre(
&self,
host: HostSide<'_>,
event: &mut PlayerTickPreEvent,
) { ... }
fn player_tick_post(
&self,
host: HostSide<'_>,
event: &mut PlayerTickPostEvent,
) { ... }
fn entity_join_level(
&self,
host: &mut dyn ServerHost,
event: &mut EntityJoinLevelEvent<'_>,
) -> Flow { ... }
fn living_incoming_damage(
&self,
level: &mut dyn LevelRandomHost,
event: &mut LivingIncomingDamageEvent<'_>,
) -> Flow { ... }
fn entity_leave_level(
&self,
host: &mut dyn ServerHost,
event: &mut EntityLeaveLevelEvent<'_>,
) { ... }
fn block_entity_fluids(
&self,
host: &dyn Host,
event: &mut BlockEntityFluidsEvent<'_>,
) -> Option<ModFluidTanks> { ... }
fn should_apply_effect_tick_this_tick(
&self,
host: &dyn Host,
event: &mut ShouldApplyEffectTickThisTickEvent,
) { ... }
fn apply_effect_tick(
&self,
host: &dyn Host,
event: &mut ApplyEffectTickEvent<'_>,
) { ... }
fn on_effect_added(
&self,
host: &mut dyn ServerHost,
event: &mut OnEffectAddedEvent,
) { ... }
fn mob_effect_added(
&self,
host: &mut dyn ServerHost,
event: &mut MobEffectAddedEvent,
) { ... }
fn chunk_load(
&self,
host: &mut dyn ServerHost,
event: &mut ChunkLoadEvent<'_>,
) { ... }
fn chunk_unload(
&self,
host: &mut dyn ServerHost,
event: &mut ChunkUnloadEvent<'_>,
) { ... }
fn player_logged_in(
&self,
host: &mut dyn ServerHost,
event: &mut PlayerLoggedInEvent<'_>,
) { ... }
fn player_logged_out(
&self,
host: &mut dyn ServerHost,
event: &mut PlayerLoggedOutEvent<'_>,
) { ... }
fn component_types(
&self,
context: &RegistrationContext,
event: &mut ComponentTypesEvent<'_>,
) { ... }
fn block_step_on(&self, event: &mut BlockStepOnEvent<'_>) { ... }
fn consume_effect(
&self,
host: &mut dyn ServerHost,
event: &mut ConsumeEffectEvent<'_>,
) { ... }
fn loot_table_load(
&self,
context: &dyn DataLoadContext,
event: &mut LootTableLoadEvent<'_>,
) { ... }
fn loot_drops(
&self,
host: &mut dyn ServerHost,
event: &mut LootDropsEvent<'_>,
) { ... }
fn enchant_effect(
&self,
host: &mut dyn ServerHost,
event: &mut EnchantEffectEvent<'_>,
) { ... }
fn screen_render_post(
&self,
host: &dyn ClientHost,
event: &mut ScreenRenderPostEvent<'_>,
) { ... }
fn modify_default_components(
&self,
context: &dyn DataLoadContext,
event: &mut ModifyDefaultComponentsEvent<'_>,
) { ... }
fn screen_mouse_button_pressed_pre(
&self,
host: &dyn ClientHost,
event: &mut ScreenMouseButtonPressedPreEvent<'_>,
) -> Flow { ... }
fn screen_mouse_button_released_pre(
&self,
host: &dyn ClientHost,
event: &mut ScreenMouseButtonReleasedPreEvent<'_>,
) -> Flow { ... }
fn camera_shake(
&self,
host: &dyn ClientHost,
event: &mut CameraShakeEvent<'_>,
) { ... }
fn shader_params(
&self,
host: &dyn ClientHost,
event: &mut ShaderParamsEvent<'_>,
) { ... }
fn block_highlight(
&self,
host: &dyn ClientHost,
event: &mut BlockHighlightEvent,
) -> Flow { ... }
fn render_hand(
&self,
host: &dyn ClientHost,
event: &mut RenderHandEvent<'_, '_>,
) -> Flow { ... }
fn client_resources_reloaded(
&self,
host: &mut dyn ClientHost,
event: &mut ClientResourcesReloadedEvent,
) { ... }
fn can_eat(
&self,
host: &dyn Host,
event: &mut CanEatEvent<'_>,
) -> Option<bool> { ... }
fn living_entity_use_item_start(
&self,
host: HostSide<'_>,
event: &mut LivingEntityUseItemStartEvent<'_>,
) -> Flow { ... }
fn living_entity_use_item_finish(
&self,
host: &mut dyn ServerHost,
event: &mut LivingEntityUseItemFinishEvent<'_>,
) { ... }
fn screen_mouse_scrolled_pre(
&self,
host: &dyn ClientHost,
event: &mut ScreenMouseScrolledPreEvent<'_>,
) -> Flow { ... }
fn player_command(
&self,
host: &mut dyn ServerHost,
event: &mut PlayerCommandEvent<'_>,
) -> Flow { ... }
fn screen_key_pressed_pre(
&self,
host: &dyn ClientHost,
event: &mut ScreenKeyPressedPreEvent<'_>,
) -> Flow { ... }
fn screen_char_typed_pre(
&self,
host: &dyn ClientHost,
event: &mut ScreenCharTypedPreEvent<'_>,
) -> Flow { ... }
fn data_pack_files(
&self,
host: &mut dyn ServerHost,
event: &mut DataPackFilesEvent<'_>,
) { ... }
fn biome_colors(
&self,
host: &dyn ClientHost,
event: &mut BiomeColorsEvent<'_>,
) { ... }
fn compute_fov(&self, host: &dyn ClientHost, event: &mut ComputeFovEvent) { ... }
fn mob_submit(
&self,
host: &dyn ClientHost,
event: &mut MobSubmitEvent<'_>,
) -> Flow { ... }
fn camera_distance(
&self,
host: &dyn ClientHost,
event: &mut CameraDistanceEvent<'_>,
) { ... }
fn compute_fog_color(
&self,
host: &dyn ClientHost,
event: &mut ComputeFogColorEvent<'_>,
) { ... }
fn mouse_button_pre(
&self,
host: &mut dyn ClientHost,
event: &mut MouseButtonPreEvent,
) -> Flow { ... }
fn mouse_button_post(
&self,
host: &mut dyn ClientHost,
event: &mut MouseButtonPostEvent,
) { ... }
fn player_respawn_position(
&self,
host: &mut dyn ServerHost,
event: &mut PlayerRespawnPositionEvent<'_>,
) { ... }
fn player_respawned(
&self,
host: &mut dyn ServerHost,
event: &mut PlayerRespawnedEvent<'_>,
) { ... }
fn render_fog(&self, host: &dyn ClientHost, event: &mut RenderFogEvent<'_>) { ... }
fn screen_key_released_pre(
&self,
host: &dyn ClientHost,
event: &mut ScreenKeyReleasedPreEvent<'_>,
) -> Flow { ... }
fn music(&self, host: &dyn ClientHost, event: &mut MusicEvent<'_>) { ... }
fn music_layers(
&self,
host: &dyn ClientHost,
event: &mut MusicLayersEvent<'_>,
) { ... }
fn datapack_sync(
&self,
host: &mut dyn ServerHost,
event: &mut DatapackSyncEvent<'_>,
) { ... }
fn recipes_received(
&self,
host: &mut dyn ClientHost,
event: &mut RecipesReceivedEvent<'_>,
) { ... }
fn input_key(
&self,
host: &mut dyn ClientHost,
event: &mut InputKeyEvent<'_>,
) { ... }
fn mouse_scrolling(
&self,
host: &mut dyn ClientHost,
event: &mut MouseScrollingEvent,
) -> Flow { ... }
fn screen_mouse_dragged_pre(
&self,
host: &dyn ClientHost,
event: &mut ScreenMouseDraggedPreEvent<'_>,
) -> Flow { ... }
fn mod_container_viewers(
&self,
host: &mut dyn ServerHost,
event: &mut ModContainerViewersEvent<'_>,
) { ... }
fn living_knockback(
&self,
level: &mut dyn LevelRandomHost,
event: &mut LivingKnockbackEvent<'_>,
) -> Flow { ... }
fn experience_orb_can_merge(
&self,
host: &mut dyn ServerHost,
event: &mut ExperienceOrbCanMergeEvent<'_>,
) { ... }
fn experience_orb_merge(
&self,
host: &mut dyn ServerHost,
event: &mut ExperienceOrbMergeEvent<'_>,
) -> Flow { ... }
fn living_entity_use_item_tick(
&self,
host: HostSide<'_>,
event: &mut LivingEntityUseItemTickEvent<'_>,
) -> Flow { ... }
fn living_entity_use_item_stop(
&self,
host: HostSide<'_>,
event: &mut LivingEntityUseItemStopEvent<'_>,
) -> Flow { ... }
fn loot_function(&self, event: &mut LootFunctionEvent<'_>) { ... }
fn loot_condition(&self, event: &mut LootConditionEvent<'_>) { ... }
fn level_load(
&self,
host: &mut dyn ServerHost,
event: &mut LevelLoadEvent<'_>,
) { ... }
fn level_unload(
&self,
host: &mut dyn ServerHost,
event: &mut LevelUnloadEvent<'_>,
) { ... }
fn client_level_load(
&self,
host: &mut dyn ClientHost,
event: &mut ClientLevelLoadEvent<'_>,
) { ... }
fn client_level_unload(
&self,
host: &mut dyn ClientHost,
event: &mut ClientLevelUnloadEvent<'_>,
) { ... }
fn hears_projectile_impacts(
&self,
host: &dyn Host,
event: &mut HearsProjectileImpactsEvent,
) { ... }
fn projectile_impact(
&self,
host: &mut dyn ServerHost,
event: &mut ProjectileImpactEvent<'_>,
) -> Flow { ... }
fn entity_mount(
&self,
host: &mut dyn ServerHost,
event: &mut EntityMountEvent<'_>,
) -> Flow { ... }
fn interaction_key_mapping_triggered(
&self,
host: &mut dyn ClientHost,
event: &mut InteractionKeyMappingTriggeredEvent,
) -> Flow { ... }
fn gui_layer_pre(
&self,
host: &dyn ClientHost,
event: &mut GuiLayerPreEvent<'_>,
) -> Flow { ... }
fn gui_layer_post(
&self,
host: &dyn ClientHost,
event: &mut GuiLayerPostEvent<'_>,
) { ... }
fn map_decorations(
&self,
host: &dyn ClientHost,
event: &mut MapDecorationsEvent<'_>,
) { ... }
fn player_start_tracking(
&self,
host: &mut dyn ServerHost,
event: &mut PlayerStartTrackingEvent<'_>,
) { ... }
fn player_stop_tracking(
&self,
host: &mut dyn ServerHost,
event: &mut PlayerStopTrackingEvent<'_>,
) { ... }
fn block_entity_energy(
&self,
host: &dyn Host,
event: &mut BlockEntityEnergyEvent<'_>,
) -> Option<ModEnergyBuffer> { ... }
fn data_map_types(
&self,
host: &mut dyn ServerHost,
event: &mut DataMapTypesEvent<'_>,
) { ... }
fn living_breathe(
&self,
context: &dyn LoopContext,
event: &mut LivingBreatheEvent<'_>,
) { ... }
fn blocks(&self, context: &RegistrationContext, event: &mut BlocksEvent<'_>) { ... }
fn items(&self, context: &RegistrationContext, event: &mut ItemsEvent<'_>) { ... }
fn entity_tick_pre(
&self,
host: &mut dyn ServerHost,
event: &mut EntityTickPreEvent<'_>,
) -> Flow { ... }
fn entity_tick_post(
&self,
host: &mut dyn ServerHost,
event: &mut EntityTickPostEvent<'_>,
) { ... }
fn entity_tick_listened(
&self,
host: &mut dyn ServerHost,
event: &mut EntityTickListenedEvent,
) { ... }
fn living_equipment_change(
&self,
host: &mut dyn ServerHost,
event: &mut LivingEquipmentChangeEvent<'_>,
) { ... }
fn living_equipment_listened(
&self,
host: &mut dyn ServerHost,
event: &mut LivingEquipmentListenedEvent,
) { ... }
fn player_submit(
&self,
host: &dyn ClientHost,
event: &mut PlayerSubmitEvent<'_>,
) -> Flow { ... }
fn mob_layer(&self, host: &dyn ClientHost, event: &mut MobLayerEvent<'_>) { ... }
fn player_render_listened(
&self,
host: &dyn ClientHost,
event: &mut PlayerRenderListenedEvent,
) { ... }
fn sign_changed(
&self,
host: &mut dyn ServerHost,
event: &mut SignChangedEvent<'_>,
) -> Flow { ... }
fn standalone_models(
&self,
context: &RegistrationContext,
event: &mut StandaloneModelsEvent<'_>,
) { ... }
fn player_container_open(
&self,
host: &mut dyn ServerHost,
event: &mut PlayerContainerOpenEvent<'_>,
) { ... }
fn player_container_close(
&self,
host: &mut dyn ServerHost,
event: &mut PlayerContainerCloseEvent<'_>,
) { ... }
fn player_toggle_flight(
&self,
host: &mut dyn ServerHost,
event: &mut PlayerToggleFlightEvent<'_>,
) -> Flow { ... }
fn anvil_damaged(
&self,
host: &mut dyn ServerHost,
event: &mut AnvilDamagedEvent<'_>,
) { ... }
fn arrow_loose(
&self,
host: &mut dyn ServerHost,
event: &mut ArrowLooseEvent<'_>,
) -> Flow { ... }
fn beacon_state_change(
&self,
host: &mut dyn ServerHost,
event: &mut BeaconStateChangeEvent<'_>,
) { ... }
fn bell_ring(
&self,
level: &dyn LevelHost,
event: &mut BellRingEvent,
) -> Flow { ... }
fn block_break_progress_update(
&self,
host: &mut dyn ServerHost,
event: &mut BlockBreakProgressUpdateEvent<'_>,
) { ... }
fn block_burn(
&self,
level: &dyn LevelHost,
event: &mut BlockBurnEvent,
) -> Flow { ... }
fn block_cook(
&self,
host: &mut dyn ServerHost,
event: &mut BlockCookEvent<'_>,
) { ... }
fn block_damage_abort(
&self,
host: &mut dyn ServerHost,
event: &mut BlockDamageAbortEvent<'_>,
) { ... }
fn block_dispense_armor(
&self,
host: &mut dyn ServerHost,
event: &mut BlockDispenseArmorEvent<'_>,
) { ... }
fn block_fade(
&self,
level: &dyn LevelHost,
event: &mut BlockFadeEvent,
) -> Flow { ... }
fn block_failed_dispense(
&self,
host: &mut dyn ServerHost,
event: &mut BlockFailedDispenseEvent<'_>,
) { ... }
fn block_form(
&self,
level: &dyn LevelHost,
event: &mut BlockFormEvent,
) -> Flow { ... }
fn block_ignite(
&self,
level: &dyn LevelHost,
event: &mut BlockIgniteEvent<'_>,
) -> Flow { ... }
fn block_lock_check(
&self,
host: &mut dyn ServerHost,
event: &mut BlockLockCheckEvent<'_>,
) -> Flow { ... }
fn block_receive_game(
&self,
host: &mut dyn ServerHost,
event_: &mut BlockReceiveGameEvent<'_>,
) -> Flow { ... }
fn block_shear_entity(
&self,
host: &mut dyn ServerHost,
event: &mut BlockShearEntityEvent<'_>,
) { ... }
fn brewing_complete(
&self,
host: &mut dyn ServerHost,
event: &mut BrewingCompleteEvent,
) { ... }
fn brewing_fuel(
&self,
host: &mut dyn ServerHost,
event: &mut BrewingFuelEvent<'_>,
) { ... }
fn brewing_start(
&self,
host: &mut dyn ServerHost,
event: &mut BrewingStartEvent<'_>,
) { ... }
fn broadcast_message(
&self,
host: &dyn Host,
event: &mut BroadcastMessageEvent<'_>,
) -> Flow { ... }
fn campfire_start(
&self,
host: &mut dyn ServerHost,
event: &mut CampfireStartEvent<'_>,
) { ... }
fn cauldron_level_changed(
&self,
level: &dyn LevelHost,
event: &mut CauldronLevelChangedEvent<'_>,
) -> Flow { ... }
fn item_consumption_teleport(
&self,
host: &mut dyn ServerHost,
event: &mut ItemConsumptionTeleportEvent<'_>,
) -> Flow { ... }
fn compost_item(
&self,
host: &mut dyn ServerHost,
event: &mut CompostItemEvent<'_>,
) { ... }
fn crafter_craft(
&self,
host: &mut dyn ServerHost,
event: &mut CrafterCraftEvent<'_>,
) { ... }
fn creeper_ignite(
&self,
host: &mut dyn ServerHost,
event: &mut CreeperIgniteEvent<'_>,
) { ... }
fn creeper_power(
&self,
host: &mut dyn ServerHost,
event: &mut CreeperPowerEvent,
) { ... }
fn critical_hit(
&self,
host: &mut dyn ServerHost,
event: &mut CriticalHitEvent<'_>,
) { ... }
fn difficulty_changed(
&self,
host: &mut dyn ServerHost,
event: &mut DifficultyChangedEvent<'_>,
) { ... }
fn dragon_egg_form(
&self,
level: &dyn LevelHost,
event: &mut DragonEggFormEvent,
) -> Flow { ... }
fn enchant_item(
&self,
host: &mut dyn ServerHost,
event: &mut EnchantItemEvent<'_>,
) { ... }
fn ender_pearl_teleport(
&self,
host: &mut dyn ServerHost,
event: &mut EnderPearlTeleportEvent<'_>,
) -> Flow { ... }
fn entities_load(
&self,
host: &mut dyn ServerHost,
event: &mut EntitiesLoadEvent<'_>,
) { ... }
fn entities_unload(
&self,
host: &mut dyn ServerHost,
event: &mut EntitiesUnloadEvent<'_>,
) { ... }
fn entity_break_door(
&self,
host: &mut dyn ServerHost,
event: &mut EntityBreakDoorEvent<'_>,
) { ... }
fn entity_breed(
&self,
host: &mut dyn ServerHost,
event: &mut EntityBreedEvent,
) { ... }
fn entity_change_block(
&self,
host: &mut dyn ServerHost,
event: &mut EntityChangeBlockEvent<'_>,
) { ... }
fn entity_drop_item(
&self,
host: &mut dyn ServerHost,
event: &mut EntityDropItemEvent<'_>,
) { ... }
fn entity_enter_block(
&self,
host: &mut dyn ServerHost,
event: &mut EntityEnterBlockEvent<'_>,
) { ... }
fn entity_enter_love_mode(
&self,
host: &mut dyn ServerHost,
event: &mut EntityEnterLoveModeEvent<'_>,
) { ... }
fn entity_portal(
&self,
host: &mut dyn ServerHost,
event: &mut EntityPortalEvent<'_>,
) { ... }
fn entity_pose_change(
&self,
host: &mut dyn ServerHost,
event: &mut EntityPoseChangeEvent<'_>,
) { ... }
fn entity_shoot_bow(
&self,
host: &mut dyn ServerHost,
event: &mut EntityShootBowEvent<'_>,
) { ... }
fn entity_tame(
&self,
host: &mut dyn ServerHost,
event: &mut EntityTameEvent<'_>,
) { ... }
fn entity_teleport(
&self,
host: &mut dyn ServerHost,
event: &mut EntityTeleportEvent<'_>,
) { ... }
fn entity_toggle_glide(
&self,
host: &mut dyn ServerHost,
event: &mut EntityToggleGlideEvent<'_>,
) { ... }
fn entity_unleash(
&self,
host: &mut dyn ServerHost,
event: &mut EntityUnleashEvent<'_>,
) { ... }
fn exp_bottle(&self, host: &mut dyn ServerHost, event: &mut ExpBottleEvent) { ... }
fn pickup_xp(
&self,
host: &mut dyn ServerHost,
event: &mut PickupXpEvent<'_>,
) -> Flow { ... }
fn mending_repair(
&self,
host: &mut dyn ServerHost,
event: &mut MendingRepairEvent<'_>,
) { ... }
fn explosion_prime(
&self,
host: &mut dyn ServerHost,
event: &mut ExplosionPrimeEvent,
) { ... }
fn firework_explode(
&self,
host: &mut dyn ServerHost,
event: &mut FireworkExplodeEvent,
) { ... }
fn fluid_level_change(
&self,
level: &dyn LevelHost,
event: &mut FluidLevelChangeEvent<'_>,
) -> Flow { ... }
fn framerate_limit(
&self,
host: &dyn ClientHost,
event: &mut FramerateLimitEvent,
) { ... }
fn furnace_burn(
&self,
host: &mut dyn ServerHost,
event: &mut FurnaceBurnEvent<'_>,
) { ... }
fn furnace_extract(
&self,
host: &mut dyn ServerHost,
event: &mut FurnaceExtractEvent<'_>,
) { ... }
fn furnace_smelt(
&self,
host: &mut dyn ServerHost,
event: &mut FurnaceSmeltEvent<'_>,
) { ... }
fn furnace_start_smelt(
&self,
host: &mut dyn ServerHost,
event: &mut FurnaceStartSmeltEvent<'_>,
) { ... }
fn hopper_inventory_search(
&self,
host: &mut dyn ServerHost,
event: &mut HopperInventorySearchEvent,
) { ... }
fn hopper_pickup_item(
&self,
level: &dyn LevelHost,
event: &mut HopperPickupItemEvent<'_>,
) -> Flow { ... }
fn ingredient(
&self,
context: &dyn DataLoadContext,
event: &mut IngredientEvent<'_>,
) { ... }
fn inventory_block_start(
&self,
host: &mut dyn ServerHost,
event: &mut InventoryBlockStartEvent<'_>,
) -> Flow { ... }
fn inventory_move_item(
&self,
host: &dyn Host,
event: &mut InventoryMoveItemEvent<'_>,
) -> Flow { ... }
fn item_crafted(
&self,
host: &mut dyn ServerHost,
event: &mut ItemCraftedEvent<'_>,
) { ... }
fn item_despawn(
&self,
host: &mut dyn ServerHost,
event: &mut ItemDespawnEvent<'_>,
) { ... }
fn item_expire(
&self,
host: &mut dyn ServerHost,
event: &mut ItemExpireEvent<'_>,
) { ... }
fn item_spawn(
&self,
host: &mut dyn ServerHost,
event: &mut ItemSpawnEvent<'_>,
) { ... }
fn leaves_decay(
&self,
level: &dyn LevelHost,
event: &mut LeavesDecayEvent,
) -> Flow { ... }
fn lightning_strike(
&self,
host: &mut dyn ServerHost,
event: &mut LightningStrikeEvent<'_>,
) -> Flow { ... }
fn moisture_change(
&self,
level: &dyn LevelHost,
event: &mut MoistureChangeEvent,
) -> Flow { ... }
fn anvil_craft_post(
&self,
host: &mut dyn ServerHost,
event: &mut AnvilCraftPostEvent<'_>,
) { ... }
fn anvil_craft_pre(
&self,
host: &mut dyn ServerHost,
event: &mut AnvilCraftPreEvent<'_>,
) -> Flow { ... }
fn armor_stand_manipulate(
&self,
host: &mut dyn ServerHost,
event: &mut ArmorStandManipulateEvent<'_>,
) -> Flow { ... }
fn bucket_empty(
&self,
host: &mut dyn ServerHost,
event: &mut BucketEmptyEvent<'_>,
) -> Flow { ... }
fn container_opened(
&self,
host: &mut dyn ServerHost,
event: &mut ContainerOpenedEvent<'_>,
) -> Flow { ... }
fn creative_slot(
&self,
host: &mut dyn ServerHost,
event: &mut CreativeSlotEvent<'_>,
) -> Flow { ... }
fn food_level_changed(
&self,
host: &mut dyn ServerHost,
event: &mut FoodLevelChangedEvent<'_>,
) -> Flow { ... }
fn hanging_break(
&self,
host: &mut dyn ServerHost,
event: &mut HangingBreakEvent<'_>,
) -> Flow { ... }
fn hanging_place(
&self,
host: &mut dyn ServerHost,
event: &mut HangingPlaceEvent<'_>,
) -> Flow { ... }
fn player_changed_dimension(
&self,
host: &mut dyn ServerHost,
event: &mut PlayerChangedDimensionEvent<'_>,
) { ... }
fn player_clone(
&self,
host: &mut dyn ServerHost,
event: &mut PlayerCloneEvent<'_>,
) { ... }
fn player_commands_sent(
&self,
host: &mut dyn ServerHost,
event: &mut PlayerCommandsSentEvent<'_>,
) { ... }
fn player_destroy_item(
&self,
host: &mut dyn ServerHost,
event: &mut PlayerDestroyItemEvent<'_>,
) { ... }
fn player_fish(
&self,
host: &mut dyn ServerHost,
event: &mut PlayerFishEvent<'_>,
) -> Flow { ... }
fn player_flower_pot_manipulate(
&self,
host: &mut dyn ServerHost,
event: &mut PlayerFlowerPotManipulateEvent<'_>,
) { ... }
fn player_game_mode_changed(
&self,
host: &mut dyn ServerHost,
event: &mut PlayerGameModeChangedEvent<'_>,
) -> Flow { ... }
fn player_insert_lectern_book(
&self,
host: &mut dyn ServerHost,
event: &mut PlayerInsertLecternBookEvent<'_>,
) { ... }
fn player_item_frame_change(
&self,
host: &mut dyn ServerHost,
event: &mut PlayerItemFrameChangeEvent<'_>,
) { ... }
fn player_item_mend(
&self,
host: &mut dyn ServerHost,
event: &mut PlayerItemMendEvent<'_>,
) { ... }
fn player_lectern_page_change(
&self,
host: &mut dyn ServerHost,
event: &mut PlayerLecternPageChangeEvent<'_>,
) { ... }
fn player_load_from_file(
&self,
host: &mut dyn ServerHost,
event: &mut PlayerLoadFromFileEvent<'_>,
) { ... }
fn player_login(
&self,
host: &mut dyn ServerHost,
event: &mut PlayerLoginEvent<'_>,
) -> Flow { ... }
fn player_save_to_file(
&self,
host: &mut dyn ServerHost,
event: &mut PlayerSaveToFileEvent<'_>,
) { ... }
fn player_sprint(
&self,
host: &mut dyn ServerHost,
event: &mut PlayerSprintEvent<'_>,
) { ... }
fn player_swap_hands(
&self,
host: &mut dyn ServerHost,
event: &mut PlayerSwapHandsEvent<'_>,
) -> Flow { ... }
fn player_take_lectern_book(
&self,
host: &mut dyn ServerHost,
event: &mut PlayerTakeLecternBookEvent<'_>,
) { ... }
fn player_teleported(
&self,
host: &mut dyn ServerHost,
event: &mut PlayerTeleportedEvent<'_>,
) { ... }
fn player_totem(
&self,
host: &mut dyn ServerHost,
event: &mut PlayerTotemEvent<'_>,
) { ... }
fn resource_pack_status(
&self,
host: &mut dyn ServerHost,
event: &mut ResourcePackStatusEvent<'_>,
) { ... }
fn spawn_change(
&self,
host: &mut dyn ServerHost,
event: &mut SpawnChangeEvent,
) { ... }
fn tnt_primed(
&self,
host: &mut dyn ServerHost,
event: &mut TntPrimedEvent,
) -> Flow { ... }
fn vehicle_create(
&self,
host: &mut dyn ServerHost,
event: &mut VehicleCreateEvent<'_>,
) { ... }
fn vehicle_damage(
&self,
host: &mut dyn ServerHost,
event: &mut VehicleDamageEvent<'_>,
) -> Flow { ... }
fn vehicle_destroy(
&self,
host: &mut dyn ServerHost,
event: &mut VehicleDestroyEvent<'_>,
) { ... }
fn vehicle_moved(
&self,
host: &mut dyn ServerHost,
event: &mut VehicleMovedEvent<'_>,
) { ... }
fn world_border_bounds_changed(
&self,
host: &mut dyn ServerHost,
event: &mut WorldBorderBoundsChangedEvent,
) { ... }
fn world_border_center_changed(
&self,
host: &mut dyn ServerHost,
event: &mut WorldBorderCenterChangedEvent,
) { ... }
fn player_advancement_done(
&self,
host: &mut dyn ServerHost,
event: &mut PlayerAdvancementDoneEvent<'_>,
) { ... }
fn player_advancement_progress(
&self,
host: &mut dyn ServerHost,
event: &mut PlayerAdvancementProgressEvent<'_>,
) { ... }
fn player_arm_swing(
&self,
host: &mut dyn ServerHost,
event: &mut PlayerArmSwingEvent<'_>,
) { ... }
fn player_attack_cooldown_reset(
&self,
host: &mut dyn ServerHost,
event: &mut PlayerAttackCooldownResetEvent<'_>,
) { ... }
fn player_bed_enter(
&self,
host: &mut dyn ServerHost,
event: &mut PlayerBedEnterEvent<'_>,
) -> Flow { ... }
fn player_bed_leave(
&self,
host: &mut dyn ServerHost,
event: &mut PlayerBedLeaveEvent<'_>,
) { ... }
fn player_bucket_entity(
&self,
host: &mut dyn ServerHost,
event: &mut PlayerBucketEntityEvent<'_>,
) { ... }
fn player_bundle_item_select(
&self,
host: &mut dyn ServerHost,
event: &mut PlayerBundleItemSelectEvent<'_>,
) { ... }
fn player_change_beacon_effect(
&self,
host: &mut dyn ServerHost,
event: &mut PlayerChangeBeaconEffectEvent<'_>,
) { ... }
fn player_client_loaded_world(
&self,
host: &mut dyn ServerHost,
event: &mut PlayerClientLoadedWorldEvent<'_>,
) { ... }
fn player_deep_sleep(
&self,
host: &mut dyn ServerHost,
event: &mut PlayerDeepSleepEvent<'_>,
) { ... }
fn player_edit_book(
&self,
host: &mut dyn ServerHost,
event: &mut PlayerEditBookEvent<'_>,
) -> Flow { ... }
fn player_egg_throw(
&self,
host: &mut dyn ServerHost,
event: &mut PlayerEggThrowEvent<'_>,
) { ... }
fn player_elytra_boost(
&self,
host: &mut dyn ServerHost,
event: &mut PlayerElytraBoostEvent<'_>,
) { ... }
fn player_exp_cooldown_change(
&self,
host: &mut dyn ServerHost,
event: &mut PlayerExpCooldownChangeEvent<'_>,
) { ... }
fn player_input(
&self,
host: &mut dyn ServerHost,
event: &mut PlayerInputEvent<'_>,
) { ... }
fn player_item_cooldown(
&self,
host: &mut dyn ServerHost,
event: &mut PlayerItemCooldownEvent<'_>,
) -> Flow { ... }
fn player_switch_hotbar_slot_pre(
&self,
host: &mut dyn ServerHost,
event: &mut PlayerSwitchHotbarSlotPreEvent,
) -> Flow { ... }
fn player_switch_hotbar_slot_post(
&self,
host: &mut dyn ServerHost,
event: &mut PlayerSwitchHotbarSlotPostEvent,
) { ... }
fn player_jump(
&self,
host: &mut dyn ServerHost,
event: &mut PlayerJumpEvent<'_>,
) { ... }
fn player_kicked(
&self,
host: &mut dyn ServerHost,
event: &mut PlayerKickedEvent<'_>,
) { ... }
fn player_launch_projectile(
&self,
host: &mut dyn ServerHost,
event: &mut PlayerLaunchProjectileEvent<'_>,
) { ... }
fn player_level_change(
&self,
host: &mut dyn ServerHost,
event: &mut PlayerLevelChangeEvent<'_>,
) { ... }
fn player_loom_pattern_select(
&self,
host: &mut dyn ServerHost,
event: &mut PlayerLoomPatternSelectEvent<'_>,
) { ... }
fn player_map_filled(
&self,
host: &mut dyn ServerHost,
event: &mut PlayerMapFilledEvent<'_>,
) { ... }
fn player_name_entity(
&self,
host: &mut dyn ServerHost,
event: &mut PlayerNameEntityEvent<'_>,
) { ... }
fn player_open_sign(
&self,
host: &mut dyn ServerHost,
event: &mut PlayerOpenSignEvent<'_>,
) { ... }
fn player_pick_item(
&self,
host: &mut dyn ServerHost,
event: &mut PlayerPickItemEvent<'_>,
) -> Flow { ... }
fn player_pickup_arrow(
&self,
host: &mut dyn ServerHost,
event: &mut PlayerPickupArrowEvent<'_>,
) { ... }
fn player_ready_arrow(
&self,
host: &mut dyn ServerHost,
event: &mut PlayerReadyArrowEvent<'_>,
) { ... }
fn player_recipe_book_click(
&self,
host: &mut dyn ServerHost,
event: &mut PlayerRecipeBookClickEvent<'_>,
) { ... }
fn player_recipe_book_settings_change(
&self,
host: &mut dyn ServerHost,
event: &mut PlayerRecipeBookSettingsChangeEvent<'_>,
) { ... }
fn player_recipe_discovered(
&self,
host: &mut dyn ServerHost,
event: &mut PlayerRecipeDiscoveredEvent<'_>,
) -> Flow { ... }
fn player_riptide(
&self,
host: &mut dyn ServerHost,
event: &mut PlayerRiptideEvent<'_>,
) { ... }
fn player_shear_entity(
&self,
host: &mut dyn ServerHost,
event: &mut PlayerShearEntityEvent<'_>,
) -> Flow { ... }
fn player_shield_disable(
&self,
host: &mut dyn ServerHost,
event: &mut PlayerShieldDisableEvent<'_>,
) { ... }
fn player_stat_award(
&self,
host: &mut dyn ServerHost,
event: &mut PlayerStatAwardEvent<'_>,
) -> Flow { ... }
fn player_stonecutter_recipe_select(
&self,
host: &mut dyn ServerHost,
event: &mut PlayerStonecutterRecipeSelectEvent<'_>,
) { ... }
fn player_stop_spectating_entity(
&self,
host: &mut dyn ServerHost,
event: &mut PlayerStopSpectatingEntityEvent<'_>,
) { ... }
fn player_stop_using_item(
&self,
host: &mut dyn ServerHost,
event: &mut PlayerStopUsingItemEvent<'_>,
) { ... }
fn player_swap_with_equipment_slot(
&self,
host: &mut dyn ServerHost,
event: &mut PlayerSwapWithEquipmentSlotEvent<'_>,
) { ... }
fn player_teleport_end_gateway(
&self,
host: &mut dyn ServerHost,
event: &mut PlayerTeleportEndGatewayEvent<'_>,
) -> Flow { ... }
fn player_toggle_entity_age_lock(
&self,
host: &mut dyn ServerHost,
event: &mut PlayerToggleEntityAgeLockEvent<'_>,
) { ... }
fn player_toggle_sneak(
&self,
host: &mut dyn ServerHost,
event: &mut PlayerToggleSneakEvent<'_>,
) { ... }
fn player_trade(
&self,
host: &mut dyn ServerHost,
event: &mut PlayerTradeEvent<'_>,
) { ... }
fn player_unleash_entity(
&self,
host: &mut dyn ServerHost,
event: &mut PlayerUnleashEntityEvent<'_>,
) { ... }
fn player_velocity(
&self,
host: &mut dyn ServerHost,
event: &mut PlayerVelocityEvent<'_>,
) { ... }
fn portal_create(
&self,
host: &mut dyn ServerHost,
event: &mut PortalCreateEvent<'_>,
) { ... }
fn potion_splash(
&self,
host: &mut dyn ServerHost,
event: &mut PotionSplashEvent<'_>,
) { ... }
fn prepare_hopper_transfer(
&self,
host: &mut dyn ServerHost,
event: &mut PrepareHopperTransferEvent,
) { ... }
fn prepare_item_craft(
&self,
host: &mut dyn ServerHost,
event: &mut PrepareItemCraftEvent<'_>,
) -> Option<ItemStack> { ... }
fn prepare_item_enchant(
&self,
host: &mut dyn ServerHost,
event: &mut PrepareItemEnchantEvent<'_>,
) { ... }
fn prepare_smithing(
&self,
host: &mut dyn ServerHost,
event: &mut PrepareSmithingEvent<'_>,
) -> Option<ItemStack> { ... }
fn projectile_launch(
&self,
host: &mut dyn ServerHost,
event: &mut ProjectileLaunchEvent<'_>,
) { ... }
fn raid_spawn_wave(
&self,
host: &mut dyn ServerHost,
event: &mut RaidSpawnWaveEvent,
) { ... }
fn raid_state_change(
&self,
host: &mut dyn ServerHost,
event: &mut RaidStateChangeEvent<'_>,
) { ... }
fn sculk_bloom(
&self,
host: &mut dyn ServerHost,
event: &mut SculkBloomEvent<'_>,
) { ... }
fn sleep_finished_time(
&self,
host: &mut dyn ServerHost,
event: &mut SleepFinishedTimeEvent<'_>,
) -> Flow { ... }
fn sponge_absorb(
&self,
level: &dyn LevelHost,
event: &mut SpongeAbsorbEvent,
) { ... }
fn tab_complete(
&self,
host: &mut dyn ServerHost,
event: &mut TabCompleteEvent<'_>,
) { ... }
fn target_hit(
&self,
host: &mut dyn ServerHost,
event: &mut TargetHitEvent<'_>,
) { ... }
fn thunder_change(
&self,
host: &mut dyn ServerHost,
event: &mut ThunderChangeEvent<'_>,
) -> Flow { ... }
fn time_skip(
&self,
host: &mut dyn ServerHost,
event: &mut TimeSkipEvent<'_>,
) -> Flow { ... }
fn trade_select(
&self,
host: &mut dyn ServerHost,
event: &mut TradeSelectEvent<'_>,
) { ... }
fn trade_with_villager(
&self,
host: &mut dyn ServerHost,
event: &mut TradeWithVillagerEvent<'_>,
) { ... }
fn vault_change_state(
&self,
host: &mut dyn ServerHost,
event: &mut VaultChangeStateEvent<'_>,
) { ... }
fn vault_loot(
&self,
host: &mut dyn ServerHost,
event: &mut VaultLootEvent<'_>,
) { ... }
fn weather_change(
&self,
host: &mut dyn ServerHost,
event: &mut WeatherChangeEvent<'_>,
) -> Flow { ... }
fn whitelist_state_update(
&self,
host: &mut dyn ServerHost,
event: &mut WhitelistStateUpdateEvent,
) { ... }
fn world_border_bounds_change_finish(
&self,
host: &mut dyn ServerHost,
event: &mut WorldBorderBoundsChangeFinishEvent,
) { ... }
fn world_saved(
&self,
host: &mut dyn ServerHost,
event: &mut WorldSavedEvent,
) { ... }
fn living_drown(
&self,
context: &dyn LoopContext,
event: &mut LivingDrownEvent<'_>,
) -> Flow { ... }
fn living_fall(
&self,
context: &dyn LoopContext,
event: &mut LivingFallEvent<'_>,
) -> Flow { ... }
fn living_heal(
&self,
context: &dyn LoopContext,
event: &mut LivingHealEvent,
) -> Flow { ... }
fn living_jump(
&self,
context: &dyn LoopContext,
event: &mut LivingJumpEvent<'_>,
) { ... }
fn add_attribute_tooltips(
&self,
host: &dyn ClientHost,
event: &mut AddAttributeTooltipsEvent<'_>,
) { ... }
fn add_client_reload_listeners(
&self,
host: &dyn ClientHost,
event: &mut AddClientReloadListenersEvent<'_>,
) { ... }
fn add_pack_finders(
&self,
host: HostSide<'_>,
event: &mut AddPackFindersEvent<'_>,
) { ... }
fn add_section_geometry(
&self,
context: &RegistrationContext,
event: &mut AddSectionGeometryEvent<'_>,
) { ... }
fn add_server_reload_listeners(
&self,
host: &dyn Host,
event: &mut AddServerReloadListenersEvent<'_>,
) { ... }
fn alter_ground(
&self,
context: &dyn WorldgenHost,
event: &mut AlterGroundEvent<'_>,
) { ... }
fn animal_tame(
&self,
host: &mut dyn ServerHost,
event: &mut AnimalTameEvent<'_>,
) -> Flow { ... }
fn anvil_update(
&self,
host: HostSide<'_>,
event: &mut AnvilUpdateEvent<'_>,
) -> Flow { ... }
fn arm_pose_transform(
&self,
host: &dyn ClientHost,
event: &mut ArmPoseTransformEvent<'_>,
) { ... }
fn armor_hurt(
&self,
host: &mut dyn ServerHost,
event: &mut ArmorHurtEvent<'_>,
) -> Flow { ... }
fn arrow_nock(
&self,
host: &mut dyn ServerHost,
event: &mut ArrowNockEvent<'_>,
) -> Flow { ... }
fn baby_entity_spawn(
&self,
host: &mut dyn ServerHost,
event: &mut BabyEntitySpawnEvent<'_>,
) -> Flow { ... }
fn bake_model_loader(
&self,
context: &RegistrationContext,
event: &mut BakeModelLoaderEvent<'_>,
) { ... }
fn block_drops(
&self,
level: &dyn LevelHost,
event: &mut BlockDropsEvent<'_>,
) -> Flow { ... }
fn block_entity_type_add_blocks(
&self,
context: &RegistrationContext,
event: &mut BlockEntityTypeAddBlocksEvent<'_>,
) { ... }
fn block_grow_feature(
&self,
level: &mut dyn LevelRandomHost,
event: &mut BlockGrowFeatureEvent<'_>,
) -> Flow { ... }
fn block_screen_effect_draw(
&self,
host: &dyn ClientHost,
event: &mut BlockScreenEffectDrawEvent<'_>,
) { ... }
fn block_tool_modification(
&self,
host: &dyn Host,
event: &mut BlockToolModificationEvent<'_>,
) -> Flow { ... }
fn bonemeal(
&self,
host: HostSide<'_>,
event: &mut BonemealEvent<'_>,
) -> Flow { ... }
fn build_creative_mode_tab_contents(
&self,
host: &mut dyn ClientHost,
event: &mut BuildCreativeModeTabContentsEvent<'_>,
) { ... }
fn calculate_player_turn(
&self,
host: &dyn ClientHost,
event: &mut CalculatePlayerTurnEvent,
) { ... }
fn camera_pose(
&self,
host: &dyn ClientHost,
event: &mut CameraPoseEvent<'_>,
) { ... }
fn camera_type_cycle(
&self,
host: &mut dyn ClientHost,
event: &mut CameraTypeCycleEvent<'_>,
) { ... }
fn can_continue_sleeping(
&self,
host: &mut dyn ServerHost,
event: &mut CanContinueSleepingEvent<'_>,
) -> Option<bool> { ... }
fn can_player_sleep(
&self,
host: &mut dyn ServerHost,
event: &mut CanPlayerSleepEvent<'_>,
) { ... }
fn chat_suggestion_applied(
&self,
host: &dyn ClientHost,
event: &mut ChatSuggestionAppliedEvent<'_>,
) { ... }
fn chunk_ticket_level_updated(
&self,
host: &mut dyn ServerHost,
event: &mut ChunkTicketLevelUpdatedEvent,
) { ... }
fn chunk_watch(
&self,
host: &mut dyn ServerHost,
event: &mut ChunkWatchEvent,
) { ... }
fn chunk_sent(&self, host: &mut dyn ServerHost, event: &mut ChunkSentEvent) { ... }
fn chunk_unwatch(
&self,
host: &mut dyn ServerHost,
event: &mut ChunkUnwatchEvent,
) { ... }
fn client_attack_target(
&self,
host: &mut dyn ClientHost,
event: &mut ClientAttackTargetEvent<'_>,
) -> Flow { ... }
fn client_chat(
&self,
host: &mut dyn ClientHost,
event: &mut ClientChatEvent<'_>,
) -> Flow { ... }
fn client_chat_received(
&self,
host: &mut dyn ClientHost,
event: &mut ClientChatReceivedEvent<'_>,
) -> Flow { ... }
fn client_information_updated(
&self,
host: &mut dyn ServerHost,
event: &mut ClientInformationUpdatedEvent<'_>,
) { ... }
fn client_mining_predict(
&self,
host: &dyn ClientHost,
event: &mut ClientMiningPredictEvent,
) -> Flow { ... }
fn client_packet(
&self,
host: &mut dyn ClientHost,
event: &mut ClientPacketEvent<'_>,
) { ... }
fn client_packet_send(
&self,
host: &dyn ClientHost,
event: &mut ClientPacketSendEvent<'_>,
) -> Flow { ... }
fn client_pause_change_pre(
&self,
host: &mut dyn ClientHost,
event: &mut ClientPauseChangePreEvent,
) -> Flow { ... }
fn client_pause_change_post(
&self,
host: &mut dyn ClientHost,
event: &mut ClientPauseChangePostEvent,
) { ... }
fn client_player_change_game_type(
&self,
host: &mut dyn ClientHost,
event: &mut ClientPlayerChangeGameTypeEvent,
) { ... }
fn client_player_clone(
&self,
host: &mut dyn ClientHost,
event: &mut ClientPlayerCloneEvent,
) { ... }
fn client_player_logging_in(
&self,
host: &mut dyn ClientHost,
event: &mut ClientPlayerLoggingInEvent,
) { ... }
fn client_player_logging_out(
&self,
host: &mut dyn ClientHost,
event: &mut ClientPlayerLoggingOutEvent,
) { ... }
fn client_disconnecting(
&self,
host: &dyn ClientHost,
event: &mut ClientDisconnectingEvent,
) { ... }
fn menu_background(
&self,
host: &dyn ClientHost,
event: &mut MenuBackgroundEvent<'_>,
) { ... }
fn client_setup(
&self,
host: &mut dyn ClientHost,
event: &mut ClientSetupEvent,
) { ... }
fn client_stopped(
&self,
host: &mut dyn ClientHost,
event: &mut ClientStoppedEvent,
) { ... }
fn client_stopping(
&self,
host: &mut dyn ClientHost,
event: &mut ClientStoppingEvent,
) { ... }
fn client_tick_post(
&self,
host: &mut dyn ClientHost,
event: &mut ClientTickPostEvent,
) { ... }
fn client_tick_pre(
&self,
host: &mut dyn ClientHost,
event: &mut ClientTickPreEvent,
) { ... }
fn component_hover(
&self,
host: &dyn ClientHost,
event: &mut ComponentHoverEvent<'_>,
) -> Flow { ... }
fn compute_fov_modifier(
&self,
host: &dyn ClientHost,
event: &mut ComputeFovModifierEvent<'_>,
) { ... }
fn create_fluid_source(
&self,
level: &dyn LevelHost,
event: &mut CreateFluidSourceEvent,
) { ... }
fn create_spawn_position(
&self,
host: &mut dyn ServerHost,
event: &mut CreateSpawnPositionEvent<'_>,
) -> Flow { ... }
fn crop_grow_pre(
&self,
level: &mut dyn LevelRandomHost,
event: &mut CropGrowPreEvent<'_>,
) { ... }
fn crop_grow_post(
&self,
level: &mut dyn LevelRandomHost,
event: &mut CropGrowPostEvent,
) { ... }
fn custom_click_action(
&self,
host: &mut dyn ServerHost,
event: &mut CustomClickActionEvent<'_>,
) -> Flow { ... }
fn modify_custom_spawners(
&self,
host: &dyn Host,
event: &mut ModifyCustomSpawnersEvent<'_>,
) { ... }
fn custom_spawner_tick(
&self,
host: &mut dyn ServerHost,
event: &mut CustomSpawnerTickEvent<'_>,
) { ... }
fn customize_boss_event_progress(
&self,
host: &dyn ClientHost,
event: &mut CustomizeBossEventProgressEvent<'_>,
) -> Flow { ... }
fn customize_chat_overlay(
&self,
host: &mut dyn ClientHost,
event: &mut CustomizeChatOverlayEvent,
) { ... }
fn data_maps_updated(
&self,
host: HostSide<'_>,
event: &mut DataMapsUpdatedEvent<'_>,
) { ... }
fn debug_entry_lines(
&self,
host: &dyn ClientHost,
event: &mut DebugEntryLinesEvent<'_>,
) { ... }
fn debug_renderer_draw(
&self,
host: &dyn ClientHost,
event: &mut DebugRendererDrawEvent<'_>,
) { ... }
fn dimension_transition_screen_draw(
&self,
host: &dyn ClientHost,
event: &mut DimensionTransitionScreenDrawEvent<'_>,
) { ... }
fn effect_particle_modification(
&self,
host: &dyn Host,
event: &mut EffectParticleModificationEvent<'_>,
) { ... }
fn enchanted_block_loot(
&self,
level_: &dyn LevelHost,
event: &mut EnchantedBlockLootEvent<'_>,
) { ... }
fn enchanted_entity_loot(
&self,
host: &mut dyn ServerHost,
event: &mut EnchantedEntityLootEvent<'_>,
) { ... }
fn enchantment_level_set(
&self,
host: &mut dyn ServerHost,
event: &mut EnchantmentLevelSetEvent<'_>,
) { ... }
fn ender_entity_teleport(
&self,
context: &dyn LoopContext,
event: &mut EnderEntityTeleportEvent<'_>,
) -> Flow { ... }
fn enderman_anger(
&self,
host: &dyn Host,
event: &mut EndermanAngerEvent,
) -> Flow { ... }
fn entity_change_block_pre(
&self,
host: &mut dyn ServerHost,
event: &mut EntityChangeBlockPreEvent<'_>,
) -> Flow { ... }
fn entity_constructing(
&self,
host: HostSide<'_>,
event: &mut EntityConstructingEvent<'_>,
) { ... }
fn entity_interact_specific(
&self,
host: &mut dyn ServerHost,
event: &mut EntityInteractSpecificEvent<'_>,
) -> Flow { ... }
fn entity_invulnerability_check(
&self,
level: &mut dyn LevelRandomHost,
event: &mut EntityInvulnerabilityCheckEvent<'_>,
) { ... }
fn entity_mob_griefing(
&self,
host: &dyn Host,
event: &mut EntityMobGriefingEvent,
) { ... }
fn entity_outline(
&self,
host: &dyn ClientHost,
event: &mut EntityOutlineEvent<'_>,
) { ... }
fn entity_place(
&self,
host: &mut dyn ServerHost,
event: &mut EntityPlaceEvent,
) -> Flow { ... }
fn entity_size(&self, host: &dyn Host, event: &mut EntitySizeEvent<'_>) { ... }
fn entity_struck_by_lightning(
&self,
host: &mut dyn ServerHost,
event: &mut EntityStruckByLightningEvent,
) -> Flow { ... }
fn entity_travel_to_dimension(
&self,
host: &mut dyn ServerHost,
event: &mut EntityTravelToDimensionEvent<'_>,
) -> Flow { ... }
fn explosion_knockback(
&self,
host: &mut dyn ServerHost,
event: &mut ExplosionKnockbackEvent<'_>,
) { ... }
fn explosion_start(
&self,
host: &mut dyn ServerHost,
event: &mut ExplosionStartEvent<'_>,
) -> Flow { ... }
fn extend_poi_types(
&self,
context: &RegistrationContext,
event: &mut ExtendPoiTypesEvent<'_>,
) { ... }
fn extract_block_screen_effect(
&self,
host: &dyn ClientHost,
event: &mut ExtractBlockScreenEffectEvent,
) -> Flow { ... }
fn farmland_trample(
&self,
context: &dyn LoopContext,
event: &mut FarmlandTrampleEvent,
) -> Flow { ... }
fn finalize_spawn(
&self,
host: &dyn Host,
event: &mut FinalizeSpawnEvent<'_>,
) -> Flow { ... }
fn flip_frame(&self, host: &mut dyn ClientHost, event: &mut FlipFrameEvent) { ... }
fn fluid_flow(
&self,
context: &dyn LoopContext,
event: &mut FluidFlowEvent<'_>,
) { ... }
fn fluid_place_block(
&self,
level: &dyn LevelHost,
event: &mut FluidPlaceBlockEvent<'_>,
) -> Flow { ... }
fn fluid_tick(
&self,
level: &dyn LevelHost,
event: &mut FluidTickEvent<'_>,
) -> Flow { ... }
fn fluid_tooltip(
&self,
host: &dyn ClientHost,
event: &mut FluidTooltipEvent<'_>,
) { ... }
fn game_rule_changed(
&self,
host: &mut dyn ServerHost,
event: &mut GameRuleChangedEvent<'_>,
) { ... }
fn game_shutting_down(
&self,
host: HostSide<'_>,
event: &mut GameShuttingDownEvent,
) { ... }
fn gather_effect_screen_tooltips(
&self,
host: &dyn ClientHost,
event: &mut GatherEffectScreenTooltipsEvent<'_>,
) { ... }
fn gather_skipped_attribute_tooltips(
&self,
host: &dyn ClientHost,
event: &mut GatherSkippedAttributeTooltipsEvent<'_>,
) { ... }
fn get_arm_pose(
&self,
host: &dyn ClientHost,
event: &mut GetArmPoseEvent<'_>,
) -> Option<ArmPose> { ... }
fn get_enchantment_level(&self, event: &mut GetEnchantmentLevelEvent<'_>) { ... }
fn grindstone_place(
&self,
host: &mut dyn ServerHost,
event: &mut GrindstonePlaceEvent<'_>,
) -> Flow { ... }
fn grindstone_take(
&self,
host: &mut dyn ServerHost,
event: &mut GrindstoneTakeEvent<'_>,
) -> Flow { ... }
fn gui_layer_draw(
&self,
host: &dyn ClientHost,
event: &mut GuiLayerDrawEvent<'_>,
) { ... }
fn gui_render_post(
&self,
host: &dyn ClientHost,
event: &mut GuiRenderPostEvent<'_>,
) { ... }
fn ingredient_test(
&self,
context: &dyn LoopContext,
event: &mut IngredientTestEvent<'_>,
) { ... }
fn item_attribute_modifier(
&self,
event: &mut ItemAttributeModifierEvent<'_>,
) { ... }
fn item_container(
&self,
host: &dyn Host,
event: &mut ItemContainerEvent<'_>,
) -> Option<u32> { ... }
fn item_fished(
&self,
host: &mut dyn ServerHost,
event: &mut ItemFishedEvent<'_>,
) -> Flow { ... }
fn item_model_property(
&self,
host: &dyn ClientHost,
event: &mut ItemModelPropertyEvent<'_>,
) { ... }
fn item_model_range_property(
&self,
host: &dyn ClientHost,
event: &mut ItemModelRangePropertyEvent<'_>,
) { ... }
fn item_model_select_property(
&self,
host: &dyn ClientHost,
event: &mut ItemModelSelectPropertyEvent<'_>,
) { ... }
fn item_model_update(
&self,
host: &dyn ClientHost,
event: &mut ItemModelUpdateEvent<'_>,
) { ... }
fn item_smelted(
&self,
host: &mut dyn ServerHost,
event: &mut ItemSmeltedEvent<'_>,
) { ... }
fn item_stacked_on_other(
&self,
context: &dyn LoopContext,
event_: &mut ItemStackedOnOtherEvent<'_, '_>,
) -> Flow { ... }
fn item_tint_source(
&self,
host: &dyn ClientHost,
event: &mut ItemTintSourceEvent<'_>,
) { ... }
fn item_tooltip(
&self,
host: &dyn ClientHost,
event: &mut ItemTooltipEvent<'_>,
) { ... }
fn item_toss(
&self,
host: &mut dyn ServerHost,
event: &mut ItemTossEvent<'_>,
) -> Flow { ... }
fn key_mapping_pre(
&self,
host: &mut dyn ClientHost,
event: &mut KeyMappingPreEvent<'_>,
) -> Flow { ... }
fn left_click_empty(
&self,
host: &mut dyn ClientHost,
event: &mut LeftClickEmptyEvent,
) { ... }
fn level_save(
&self,
host: &mut dyn ServerHost,
event: &mut LevelSaveEvent<'_>,
) { ... }
fn play_level_sound_at_position(
&self,
host: HostSide<'_>,
event: &mut PlayLevelSoundAtPositionEvent<'_>,
) -> Flow { ... }
fn play_level_sound_at_entity(
&self,
host: HostSide<'_>,
event: &mut PlayLevelSoundAtEntityEvent<'_>,
) -> Flow { ... }
fn living_change_target(
&self,
host: &dyn Host,
event: &mut LivingChangeTargetEvent<'_>,
) -> Flow { ... }
fn living_conversion_post(
&self,
host: &mut dyn ServerHost,
event: &mut LivingConversionPostEvent<'_>,
) { ... }
fn living_conversion_pre(
&self,
host: &mut dyn ServerHost,
event: &mut LivingConversionPreEvent<'_>,
) -> Flow { ... }
fn living_damage_post(
&self,
level: &mut dyn LevelRandomHost,
event: &mut LivingDamagePostEvent<'_>,
) { ... }
fn living_damage_pre(
&self,
level: &mut dyn LevelRandomHost,
event: &mut LivingDamagePreEvent<'_>,
) { ... }
fn living_death(
&self,
host: &mut dyn ServerHost,
event: &mut LivingDeathEvent<'_>,
) -> Flow { ... }
fn living_death_post(
&self,
host: &mut dyn ServerHost,
event: &mut LivingDeathPostEvent<'_>,
) { ... }
fn living_destroy_block(
&self,
host: &mut dyn ServerHost,
event: &mut LivingDestroyBlockEvent<'_>,
) -> Flow { ... }
fn living_drops(
&self,
host: &mut dyn ServerHost,
event: &mut LivingDropsEvent<'_>,
) -> Flow { ... }
fn get_equipment_drop_chance(
&self,
host: &mut dyn ServerHost,
event: &mut GetEquipmentDropChanceEvent<'_>,
) { ... }
fn living_experience_drop(
&self,
host: &mut dyn ServerHost,
event: &mut LivingExperienceDropEvent<'_>,
) -> Flow { ... }
fn living_get_projectile(
&self,
host: HostSide<'_>,
event: &mut LivingGetProjectileEvent<'_>,
) { ... }
fn living_jump_power(
&self,
context: &dyn LoopContext,
event: &mut LivingJumpPowerEvent<'_>,
) { ... }
fn living_speed(
&self,
context: &dyn LoopContext,
event: &mut LivingSpeedEvent<'_>,
) { ... }
fn living_flying_speed(
&self,
context: &dyn LoopContext,
event: &mut LivingFlyingSpeedEvent<'_>,
) { ... }
fn living_shield_block(
&self,
level: &mut dyn LevelRandomHost,
event: &mut LivingShieldBlockEvent<'_>,
) { ... }
fn living_use_totem(
&self,
level: &mut dyn LevelRandomHost,
event: &mut LivingUseTotemEvent<'_>,
) -> Flow { ... }
fn living_visibility(
&self,
host: &dyn Host,
event: &mut LivingVisibilityEvent,
) { ... }
fn map_decoration_types(
&self,
context: &RegistrationContext,
event: &mut MapDecorationTypesEvent<'_>,
) { ... }
fn menu_extra_data(
&self,
host: &mut dyn ServerHost,
event: &mut MenuExtraDataEvent<'_>,
) -> Option<Vec<u8>> { ... }
fn mob_despawn(&self, host: &dyn Host, event: &mut MobDespawnEvent<'_>) { ... }
fn mob_effect_applicable(
&self,
host: &mut dyn ServerHost,
event: &mut MobEffectApplicableEvent,
) -> Option<EffectApplicable> { ... }
fn mob_effect_expired(
&self,
host: &dyn Host,
event: &mut MobEffectExpiredEvent,
) -> Flow { ... }
fn mob_effect_remove(
&self,
host: &mut dyn ServerHost,
event: &mut MobEffectRemoveEvent,
) -> Flow { ... }
fn mob_spawn_placement_check(
&self,
host: &dyn Host,
event: &mut MobSpawnPlacementCheckEvent<'_>,
) { ... }
fn mob_spawn_position_check(
&self,
host: &dyn Host,
event: &mut MobSpawnPositionCheckEvent<'_>,
) { ... }
fn mob_split(
&self,
host: &mut dyn ServerHost,
event: &mut MobSplitEvent<'_>,
) -> Flow { ... }
fn register_configs(
&self,
host: HostSide<'_>,
event: &mut RegisterConfigsEvent<'_>,
) { ... }
fn config_loading(
&self,
host: HostSide<'_>,
event: &mut ConfigLoadingEvent<'_>,
) { ... }
fn config_reloading(
&self,
host: HostSide<'_>,
event: &mut ConfigReloadingEvent<'_>,
) { ... }
fn config_unloading(
&self,
host: &mut dyn ServerHost,
event: &mut ConfigUnloadingEvent<'_>,
) { ... }
fn mod_mismatch(&self, host: HostSide<'_>, event: &mut ModMismatchEvent<'_>) { ... }
fn model_baking_completed(
&self,
host: &mut dyn ClientHost,
event: &mut ModelBakingCompletedEvent,
) { ... }
fn movement_input(
&self,
host: &dyn ClientHost,
event: &mut MovementInputEvent,
) { ... }
fn note_block_change(
&self,
level: &dyn LevelHost,
event: &mut NoteBlockChangeEvent<'_>,
) -> Flow { ... }
fn potential_spawns(
&self,
host: &dyn Host,
event: &mut PotentialSpawnsEvent<'_>,
) -> Flow { ... }
fn village_siege(
&self,
host: &mut dyn ServerHost,
event: &mut VillageSiegeEvent<'_>,
) -> Flow { ... }
fn neighbor_notify(
&self,
level: &dyn LevelHost,
event: &mut NeighborNotifyEvent,
) -> Flow { ... }
fn note_block_play(
&self,
level: &dyn LevelHost,
event: &mut NoteBlockPlayEvent<'_>,
) -> Flow { ... }
fn permissions_changed(
&self,
host: &mut dyn ServerHost,
event: &mut PermissionsChangedEvent<'_>,
) -> Flow { ... }
fn player_break_speed(
&self,
host: HostSide<'_>,
event: &mut PlayerBreakSpeedEvent,
) -> Flow { ... }
fn player_brewed_potion(
&self,
host: &mut dyn ServerHost,
event: &mut PlayerBrewedPotionEvent<'_>,
) { ... }
fn player_enchant_item(
&self,
host: &mut dyn ServerHost,
event: &mut PlayerEnchantItemEvent<'_>,
) { ... }
fn player_flyable_fall(
&self,
host: &mut dyn ServerHost,
event: &mut PlayerFlyableFallEvent<'_>,
) { ... }
fn player_harvest_check(
&self,
host: HostSide<'_>,
event: &mut PlayerHarvestCheckEvent,
) { ... }
fn player_heart_type(
&self,
host: &mut dyn ClientHost,
event: &mut PlayerHeartTypeEvent<'_>,
) { ... }
fn player_inventory_changed(
&self,
host: &mut dyn ServerHost,
event: &mut PlayerInventoryChangedEvent<'_>,
) { ... }
fn player_item_smithed(
&self,
host: &mut dyn ServerHost,
event: &mut PlayerItemSmithedEvent<'_>,
) { ... }
fn player_name_format(
&self,
context: &dyn LoopContext,
event: &mut PlayerNameFormatEvent<'_>,
) { ... }
fn player_set_spawn(
&self,
host: &mut dyn ServerHost,
event: &mut PlayerSetSpawnEvent<'_>,
) -> Flow { ... }
fn player_spawn_phantoms(
&self,
host: &mut dyn ServerHost,
event: &mut PlayerSpawnPhantomsEvent<'_>,
) -> Option<PhantomSpawnResult> { ... }
fn player_stays_on_ground_surface(
&self,
context: &dyn LoopContext,
event: &mut PlayerStaysOnGroundSurfaceEvent,
) { ... }
fn player_tab_list_name_format(
&self,
context: &dyn LoopContext,
event: &mut PlayerTabListNameFormatEvent<'_>,
) { ... }
fn player_xp_change(
&self,
host: &mut dyn ServerHost,
event: &mut PlayerXpChangeEvent<'_>,
) -> Flow { ... }
fn player_xp_level_change(
&self,
host: &mut dyn ServerHost,
event: &mut PlayerXpLevelChangeEvent<'_>,
) -> Flow { ... }
fn portal_spawn(
&self,
level: &dyn LevelHost,
event: &mut PortalSpawnEvent,
) -> Flow { ... }
fn potion_brew_post(
&self,
host: &mut dyn ServerHost,
event: &mut PotionBrewPostEvent<'_>,
) { ... }
fn potion_brew_pre(
&self,
host: &mut dyn ServerHost,
event: &mut PotionBrewPreEvent<'_>,
) -> Flow { ... }
fn recipe_book_categories(
&self,
host: HostSide<'_>,
event: &mut RecipeBookCategoriesEvent<'_>,
) { ... }
fn recipe_property_sets(
&self,
context: &dyn DataLoadContext,
event: &mut RecipePropertySetsEvent<'_>,
) { ... }
fn register_block_tint_sources(
&self,
context: &RegistrationContext,
event: &mut RegisterBlockTintSourcesEvent<'_>,
) { ... }
fn register_cauldron_fluid_content(
&self,
context: &RegistrationContext,
event: &mut RegisterCauldronFluidContentEvent<'_>,
) { ... }
fn register_cauldron_interaction(
&self,
context: &RegistrationContext,
event: &mut RegisterCauldronInteractionEvent<'_>,
) { ... }
fn register_color_resolvers(
&self,
context: &RegistrationContext,
event: &mut RegisterColorResolversEvent<'_>,
) { ... }
fn register_debug_entries(
&self,
context: &RegistrationContext,
event: &mut RegisterDebugEntriesEvent<'_>,
) { ... }
fn register_debug_renderers(
&self,
context: &RegistrationContext,
event: &mut RegisterDebugRenderersEvent<'_>,
) { ... }
fn register_dimension_transition_screen(
&self,
context: &RegistrationContext,
event: &mut RegisterDimensionTransitionScreenEvent<'_>,
) { ... }
fn register_enchantment_damage_effects(
&self,
context: &RegistrationContext,
event: &mut RegisterEnchantmentDamageEffectsEvent<'_>,
) { ... }
fn register_entity_spectator_shaders(
&self,
context: &RegistrationContext,
event: &mut RegisterEntitySpectatorShadersEvent<'_>,
) { ... }
fn register_fluid_models(
&self,
context: &RegistrationContext,
event: &mut RegisterFluidModelsEvent<'_>,
) { ... }
fn register_game_tests(
&self,
host: &dyn Host,
event: &mut RegisterGameTestsEvent<'_>,
) { ... }
fn register_gui_layers(
&self,
context: &RegistrationContext,
event: &mut RegisterGuiLayersEvent<'_>,
) { ... }
fn register_item_models(
&self,
context: &RegistrationContext,
event: &mut RegisterItemModelsEvent<'_>,
) { ... }
fn register_item_tint_sources(
&self,
context: &RegistrationContext,
event: &mut RegisterItemTintSourcesEvent<'_>,
) { ... }
fn register_layer_definitions(
&self,
context: &RegistrationContext,
event: &mut RegisterLayerDefinitionsEvent<'_>,
) { ... }
fn register_model_loaders(
&self,
context: &RegistrationContext,
event: &mut RegisterModelLoadersEvent<'_>,
) { ... }
fn register_particle_groups(
&self,
context: &RegistrationContext,
event: &mut RegisterParticleGroupsEvent<'_>,
) { ... }
fn register_particle_providers(
&self,
context: &RegistrationContext,
event: &mut RegisterParticleProvidersEvent<'_>,
) { ... }
fn register_preset_editors(
&self,
context: &RegistrationContext,
event: &mut RegisterPresetEditorsEvent<'_>,
) { ... }
fn register_range_select_item_model_property(
&self,
context: &RegistrationContext,
event: &mut RegisterRangeSelectItemModelPropertyEvent<'_>,
) { ... }
fn register_render_pipelines(
&self,
context: &RegistrationContext,
event: &mut RegisterRenderPipelinesEvent<'_>,
) { ... }
fn register_runtime_sprites(
&self,
context: &RegistrationContext,
event: &mut RegisterRuntimeSpritesEvent<'_>,
) { ... }
fn register_select_item_model_property(
&self,
context: &RegistrationContext,
event: &mut RegisterSelectItemModelPropertyEvent<'_>,
) { ... }
fn register_sprite_sources(
&self,
context: &RegistrationContext,
event: &mut RegisterSpriteSourcesEvent<'_>,
) { ... }
fn register_texture_atlases(
&self,
context: &RegistrationContext,
event: &mut RegisterTextureAtlasesEvent<'_>,
) { ... }
fn register_villager_professions(
&self,
context: &RegistrationContext,
event: &mut RegisterVillagerProfessionsEvent<'_>,
) { ... }
fn render_arm(
&self,
host: &dyn ClientHost,
event: &mut RenderArmEvent<'_>,
) -> Flow { ... }
fn render_frame_post(
&self,
host: &mut dyn ClientHost,
event: &mut RenderFramePostEvent,
) { ... }
fn render_frame_pre(
&self,
host: &mut dyn ClientHost,
event: &mut RenderFramePreEvent,
) { ... }
fn render_gui_post(
&self,
host: &dyn ClientHost,
event: &mut RenderGuiPostEvent<'_>,
) { ... }
fn render_gui_pre(
&self,
host: &dyn ClientHost,
event: &mut RenderGuiPreEvent,
) -> Flow { ... }
fn render_item_in_frame(
&self,
host: &dyn ClientHost,
event: &mut RenderItemInFrameEvent<'_>,
) -> Flow { ... }
fn render_level_stage(
&self,
host: &dyn ClientHost,
event: &mut RenderLevelStageEvent<'_>,
) { ... }
fn render_name_tag(
&self,
host: &dyn ClientHost,
event: &mut RenderNameTagEvent<'_>,
) { ... }
fn render_tooltip_gather_components(
&self,
host: &dyn ClientHost,
event: &mut RenderTooltipGatherComponentsEvent<'_>,
) -> Flow { ... }
fn render_tooltip_pre(
&self,
host: &dyn ClientHost,
event: &mut RenderTooltipPreEvent<'_>,
) -> Flow { ... }
fn render_tooltip_texture(
&self,
host: &dyn ClientHost,
event: &mut RenderTooltipTextureEvent<'_>,
) { ... }
fn right_click_empty(
&self,
host: &mut dyn ClientHost,
event: &mut RightClickEmptyEvent,
) { ... }
fn right_click_item(
&self,
host: HostSide<'_>,
event: &mut RightClickItemEvent<'_>,
) -> Flow { ... }
fn scheduled_task(
&self,
host: &mut dyn ServerHost,
event: &mut ScheduledTaskEvent<'_>,
) { ... }
fn screen_closing(
&self,
host: &dyn ClientHost,
event: &mut ScreenClosingEvent<'_>,
) { ... }
fn screen_exclusion_areas(
&self,
host: &dyn ClientHost,
event: &mut ScreenExclusionAreasEvent<'_>,
) { ... }
fn screen_init_post(
&self,
host: &dyn ClientHost,
event: &mut ScreenInitPostEvent<'_>,
) { ... }
fn screen_mouse_button_pressed_post(
&self,
host: &dyn ClientHost,
event: &mut ScreenMouseButtonPressedPostEvent<'_>,
) { ... }
fn screen_mouse_button_released_post(
&self,
host: &dyn ClientHost,
event: &mut ScreenMouseButtonReleasedPostEvent<'_>,
) { ... }
fn screen_mouse_dragged_post(
&self,
host: &dyn ClientHost,
event: &mut ScreenMouseDraggedPostEvent<'_>,
) { ... }
fn screen_mouse_scrolled_post(
&self,
host: &dyn ClientHost,
event: &mut ScreenMouseScrolledPostEvent<'_>,
) { ... }
fn screen_key_pressed_post(
&self,
host: &dyn ClientHost,
event: &mut ScreenKeyPressedPostEvent<'_>,
) -> Flow { ... }
fn screen_key_released_post(
&self,
host: &dyn ClientHost,
event: &mut ScreenKeyReleasedPostEvent<'_>,
) -> Flow { ... }
fn screen_char_typed_post(
&self,
host: &dyn ClientHost,
event: &mut ScreenCharTypedPostEvent<'_>,
) -> Flow { ... }
fn screen_opening(
&self,
host: &dyn ClientHost,
event: &mut ScreenOpeningEvent<'_>,
) -> Option<ScreenOpening> { ... }
fn screen_preedit_pre(
&self,
host: &dyn ClientHost,
event: &mut ScreenPreeditPreEvent<'_>,
) -> Flow { ... }
fn screen_preedit_post(
&self,
host: &dyn ClientHost,
event: &mut ScreenPreeditPostEvent<'_>,
) { ... }
fn screen_render_inventory_mob_effects(
&self,
host: &dyn ClientHost,
event: &mut ScreenRenderInventoryMobEffectsEvent<'_>,
) -> Flow { ... }
fn screen_render_pre(
&self,
host: &dyn ClientHost,
event: &mut ScreenRenderPreEvent<'_>,
) -> Flow { ... }
fn screen_render_background(
&self,
host: &dyn ClientHost,
event: &mut ScreenRenderBackgroundEvent<'_>,
) { ... }
fn screen_render_foreground(
&self,
host: &dyn ClientHost,
event: &mut ScreenRenderForegroundEvent<'_>,
) { ... }
fn screen_transparent_background(
&self,
host: &dyn ClientHost,
event: &mut ScreenTransparentBackgroundEvent<'_>,
) -> Flow { ... }
fn screenshot(
&self,
host: &mut dyn ClientHost,
event: &mut ScreenshotEvent<'_>,
) -> Flow { ... }
fn server_chat(
&self,
host: &mut dyn ServerHost,
event: &mut ServerChatEvent<'_>,
) -> Flow { ... }
fn server_tick_rate_changed(
&self,
host: &mut dyn ServerHost,
event: &mut ServerTickRateChangedEvent,
) { ... }
fn play_sound(
&self,
context: &dyn LoopContext,
event: &mut PlaySoundEvent<'_>,
) { ... }
fn play_sound_source(
&self,
context: &dyn LoopContext,
event: &mut PlaySoundSourceEvent<'_>,
) { ... }
fn play_streaming_source(
&self,
context: &dyn LoopContext,
event: &mut PlayStreamingSourceEvent<'_>,
) { ... }
fn sound_engine_load(
&self,
context: &dyn LoopContext,
event: &mut SoundEngineLoadEvent,
) { ... }
fn spread_players_teleport(
&self,
host: &mut dyn ServerHost,
event: &mut SpreadPlayersTeleportEvent<'_>,
) -> Flow { ... }
fn sprite_source(
&self,
context: &RegistrationContext,
event: &mut SpriteSourceEvent<'_>,
) { ... }
fn submit_custom_geometry(
&self,
host: &dyn ClientHost,
event: &mut SubmitCustomGeometryEvent<'_>,
) { ... }
fn sweep_attack(
&self,
host: HostSide<'_>,
event: &mut SweepAttackEvent<'_>,
) -> Flow { ... }
fn tags_updated(&self, host: HostSide<'_>, event: &mut TagsUpdatedEvent) { ... }
fn teleport_command(
&self,
host: &mut dyn ServerHost,
event: &mut TeleportCommandEvent<'_>,
) -> Flow { ... }
fn texture_atlas_stitched(
&self,
host: &mut dyn ClientHost,
event: &mut TextureAtlasStitchedEvent,
) { ... }
fn tick_target_millis(
&self,
host: &dyn ClientHost,
event: &mut TickTargetMillisEvent,
) { ... }
fn toast_add(
&self,
host: &dyn ClientHost,
event: &mut ToastAddEvent<'_>,
) -> Flow { ... }
fn use_item_on_block(
&self,
host: HostSide<'_>,
event: &mut UseItemOnBlockEvent<'_>,
) -> Flow { ... }
fn validate_tickets(
&self,
host: &mut dyn ServerHost,
event: &mut ValidateTicketsEvent<'_>,
) { ... }
fn vanilla_game_event(
&self,
host: &mut dyn ServerHost,
event_: &mut VanillaGameEventEvent<'_>,
) -> Flow { ... }
fn wind_burst(
&self,
host: &mut dyn ServerHost,
event: &mut WindBurstEvent<'_>,
) { ... }
fn window_resize(
&self,
host: &mut dyn ClientHost,
event: &mut WindowResizeEvent,
) { ... }
fn xp_orb_targeting(
&self,
host: &mut dyn ServerHost,
event: &mut XpOrbTargetingEvent<'_>,
) { ... }
}Expand description
The hooks a trait mod implements: one method per catalog hook, each documented from its doc field.
Annotate the impl with #[mod_api::horizon_mod], which subscribes the mod to just the methods it implements.
Provided Methods§
fn register(&self, r: &mut dyn Registrar, cx: &RegistrationContext)
fn register(&self, r: &mut dyn Registrar, cx: &RegistrationContext)
Once, at startup: attach this mod’s parts (let shaft = r.block_key("mymod:shaft"); r.block_part(shaft, Shaft)).
fn visuals(&self, host: &dyn ClientHost, event: &mut VisualsEvent<'_>)
fn visuals(&self, host: &dyn ClientHost, event: &mut VisualsEvent<'_>)
The world frame’s local, world-space rim and colored-light sources. Push requests; Horizon validates and limits them before rendering. Called only while a world is visible. Side: client.
fn emissive(&self, host: &dyn ClientHost, event: &mut EmissiveEvent<'_>)
fn emissive(&self, host: &dyn ClientHost, event: &mut EmissiveEvent<'_>)
At most 32 pairs of already-loaded base and transparent overlay sprites. Per-pixel alpha in the overlay marks full-bright material, without illuminating the surrounding block or changing gameplay light. Side: client.
Every mod gets event.layers in order and may add, change or remove layers.
fn world_lifecycle(
&self,
host: &mut dyn ServerHost,
event: &mut WorldLifecycleEvent<'_>,
)
fn world_lifecycle( &self, host: &mut dyn ServerHost, event: &mut WorldLifecycleEvent<'_>, )
The world’s phases, read-only; error_text carries the engine’s
own open-failure text, empty otherwise. Server-side. A server loop or final
save failure fires WorldCloseFailed with the error text.
Side: server.
fn server_about_to_start(
&self,
host: &mut dyn ServerHost,
event: &mut ServerAboutToStartEvent,
)
fn server_about_to_start( &self, host: &mut dyn ServerHost, event: &mut ServerAboutToStartEvent, )
The server is about to open its worlds: nothing of the world is
loaded yet (NeoForge’s ServerAboutToStartEvent, “called before the
server begins loading anything”). Vanilla’s MinecraftServer.loadLevel
start. Server-side: the single player server thread once Play is
pressed, a dedicated server once its settings are read. Each is
followed by native_server_started or
native_world_lifecycle’s WorldOpenFailed. dedicated tells a dedicated server from the single
player one.
Side: server.
fn server_starting(
&self,
host: &mut dyn ServerHost,
event: &mut ServerStartingEvent,
)
fn server_starting( &self, host: &mut dyn ServerHost, event: &mut ServerStartingEvent, )
Fired once immediately after server_about_to_start, before the server
accepts play, on both integrated and dedicated servers. A failed startup
still reaches server_stopped.
Side: server.
fn server_started(
&self,
host: &mut dyn ServerHost,
event: &mut ServerStartedEvent,
)
fn server_started( &self, host: &mut dyn ServerHost, event: &mut ServerStartedEvent, )
The server has opened its worlds and is about to run its tick loop
(NeoForge’s ServerStartedEvent): every level is loaded, no player has
joined, and the first tick has not run. Fired where WorldOpenReady was,
on the single player server thread and on a dedicated server, once per
open that succeeds (a failed open fires WorldOpenFailed instead).
dedicated tells a dedicated server from the single player one.
Side: server.
fn server_stopping(
&self,
host: &mut dyn ServerHost,
event: &mut ServerStoppingEvent,
)
fn server_stopping( &self, host: &mut dyn ServerHost, event: &mut ServerStoppingEvent, )
The server begins teardown (NeoForge’s ServerStoppingEvent), including
after startup or the tick loop failed:
the start of vanilla’s MinecraftServer.stopServer, with the worlds
still loaded and the players still connected and not yet saved, so a
mod can save its own data or tell them. native_world_lifecycle’s
WorldCloseFinal follows once the worlds are saved. A server whose loop
fails still fires this before the final save attempt and server_stopped.
Side: server.
fn server_stopped(
&self,
host: &mut dyn ServerHost,
event: &mut ServerStoppedEvent,
)
fn server_stopped( &self, host: &mut dyn ServerHost, event: &mut ServerStoppedEvent, )
Fired once at the end of server teardown, after server_stopping and
the final save attempt and storage release. Also fired when startup or
teardown fails after startup began, including when a shutdown listener
panics, on integrated and dedicated servers.
Failed opens save only worlds already adopted by the server (the prepared
level is installed; the session lock alone is not adoption). A failed
save still reaches this hook, but does not emit WorldCloseFinal.
Side: server.
fn server_tick(
&self,
host: &mut dyn ServerHost,
event: &mut ServerTickEvent<'_>,
)
fn server_tick( &self, host: &mut dyn ServerHost, event: &mut ServerTickEvent<'_>, )
The authoritative server tick’s phases: ServerTickStart before any
level is ticked (NeoForge’s ServerTickEvent.Pre), ServerTickEnd
after the last (.Post). Read blocks with native_server_block, by
dimension: which level self.world holds here is not defined. A paused
pass fires nothing; a frozen world carries world_running false except
during a requested step.
Side: server.
fn level_tick_pre(&self, host: HostSide<'_>, event: &mut LevelTickPreEvent)
fn level_tick_pre(&self, host: HostSide<'_>, event: &mut LevelTickPreEvent)
Before a level’s tick pass on either logical side. level identifies the level.
Side: both.
fn level_tick_post(&self, host: HostSide<'_>, event: &mut LevelTickPostEvent)
fn level_tick_post(&self, host: HostSide<'_>, event: &mut LevelTickPostEvent)
After a successful level tick pass on either logical side; never after a failed tick. Side: both.
fn block_changed(&self, level: &dyn LevelHost, event: &mut BlockChangedEvent)
fn block_changed(&self, level: &dyn LevelHost, event: &mut BlockChangedEvent)
An authoritative server committed a changed state through Level.setBlock.
The world contains new; block side effects and neighbour updates follow.
Side: server.
fn command(
&self,
host: &mut dyn ClientHost,
event: &mut CommandEvent<'_>,
) -> Flow
fn command( &self, host: &mut dyn ClientHost, event: &mut CommandEvent<'_>, ) -> Flow
A command the local player typed or clicked in chat, without its
slash, before the server and Horizon’s commands see it: set ran
when the mod ran it. Client-side: a server never asks, not for
command blocks, guests or the console.
Side: client.
Return Flow::Cancel to take it: this sets ran, and later mods are skipped unless they
listen with #[listener(receive_cancelled)]; those see event.cancelled and may set it back to
false.
fn register_client_commands(
&self,
host: &mut dyn ClientHost,
event: &mut RegisterClientCommandsEvent<'_>,
)
fn register_client_commands( &self, host: &mut dyn ClientHost, event: &mut RegisterClientCommandsEvent<'_>, )
The client’s own commands (NeoForge’s RegisterClientCommandsEvent), which
command runs: push a Command per usage (x <mode:word>).
Asked when a connection starts and again when the server sends its
own tree, so the chat box colours, completes and lists them as the
game’s own; a name the game already has keeps that command’s
behaviour. A client command has no operator level: one with a nonzero
level is left out.
Side: client.
Every mod gets event.commands in order and may add, change or remove commands.
fn zoom(&self, host: &dyn ClientHost, event: &mut ZoomEvent) -> Option<Zoom>
fn zoom(&self, host: &dyn ClientHost, event: &mut ZoomEvent) -> Option<Zoom>
The zoom a native mod asks for, applied while playing (the spyglass’s
own view wins): set zoom when it is none yet.
Side: client.
Return Some to set zoom; the first mod returning Some wins.
fn minimap(
&self,
host: &dyn ClientHost,
event: &mut MinimapEvent,
) -> Option<Minimap>
fn minimap( &self, host: &dyn ClientHost, event: &mut MinimapEvent, ) -> Option<Minimap>
The minimap a native mod shows: set minimap when it is none yet.
Side: client.
Return Some to set minimap; the first mod returning Some wins.
fn setting_changed(
&self,
host: &mut dyn ClientHost,
event: &mut SettingChangedEvent<'_>,
)
fn setting_changed( &self, host: &mut dyn ClientHost, event: &mut SettingChangedEvent<'_>, )
The player changed setting key of mod mod_id on its page in Options > Mods
(Registrar::register_setting); the new value is kept already, so read it with
setting_bool and its siblings. Only mod mod_id hears it: a mod is told of its own
settings, never another’s.
Side: client.
fn panel_event(
&self,
host: &mut dyn ClientHost,
event_: &mut PanelEventEvent<'_>,
)
fn panel_event( &self, host: &mut dyn ClientHost, event_: &mut PanelEventEvent<'_>, )
The player did event on mod mod_id’s panel (native_panel_items):
act on it when it is yours.
Side: client.
fn block_entity_container(
&self,
host: &dyn Host,
event: &mut BlockEntityContainerEvent<'_>,
) -> Option<ModContainer>
fn block_entity_container( &self, host: &dyn Host, event: &mut BlockEntityContainerEvent<'_>, ) -> Option<ModContainer>
Block block’s block entity has item slots (a WorldlyContainer):
hoppers, comparators and breaking the block use them as vanilla’s containers.
Set container when the block is yours. Asked once for each mod
block when the ticking table is built; at most 256 slots, and slot
numbers past the count are left out. Its menu, one of
containers::MOD_MENUS or a content mod’s menu type
(data/<id>/horizon/menu/) with as many
slots, opens when the block is used (its template must open a menu, as
a chest or a furnace does); another is left out. A mod menu type shows
on Horizon clients through the mod’s native_screen only.
Side: both.
Return Some to set container; the first mod returning Some wins.
fn register_commands(
&self,
host: &mut dyn ServerHost,
event: &mut RegisterCommandsEvent<'_>,
)
fn register_commands( &self, host: &mut dyn ServerHost, event: &mut RegisterCommandsEvent<'_>, )
The commands native mods add to the server’s command tree: push
yours. Asked once when a world opens to players (a dedicated
server, a LAN host, single player’s server thread); every player’s
chat box then completes them as vanilla’s, within their level. A
name vanilla has is left out. Asked again after a mod calls
host.commands().refresh_commands(). Each executable usage keeps its own
permission level; a lower-level child only opens traversal through a
shared prefix, not execution of that prefix. An argument’s kind is one
of word, text, integer, number, boolean, player, item and
block_pos, or a command argument type a mod registered
(Registrar::register_command_argument), named by its namespaced id.
Side: server.
Every mod gets event.commands in order and may add, change or remove commands.
fn run_mod_command(
&self,
host: &mut dyn ServerHost,
event: &mut RunModCommandEvent<'_>,
) -> Flow
fn run_mod_command( &self, host: &mut dyn ServerHost, event: &mut RunModCommandEvent<'_>, ) -> Flow
Execute a parsed mod command after permission checks and argument resolution.
Return Flow::Cancel when handled. source identifies origin and permission,
independent of execute as. Feedback honours silence, track-output and the swapped-in player.
Side: server.
Return Flow::Cancel to take it: this sets ran, and later mods are skipped unless they
listen with #[listener(receive_cancelled)]; those see event.cancelled and may set it back to
false.
A click in a menu a mod opened (native_open_menu), which moved
nothing: the menu’s slot (its own first, then the player’s
inventory, native_menu_inventory_slot; -999 outside), the button
and the click’s mode (ClickType’s id) of the player uuid.
No player’s state is swapped in: the menu helpers take the player’s
UUID.
Side: server.
A menu a mod opened closed: the player closed it, the server or a mod opened another, or the player left. Side: server.
fn break_block(
&self,
host: &mut dyn ServerHost,
event: &mut BreakBlockEvent<'_>,
) -> Flow
fn break_block( &self, host: &mut dyn ServerHost, event: &mut BreakBlockEvent<'_>, ) -> Flow
A player breaks the block state at pos, once the game allowed it
(the held item can break blocks, the debug stick didn’t take the
click): where ServerPlayerGameMode.destroyBlock starts. Set
canceled to keep the block: nothing is destroyed or dropped, and a
guest sees it back. Set exp_to_drop to Some(amount) to replace
the experience sample later, after item drops are prepared;
None keeps sampling. A subscribed block part’s exp_drop answer is
supplied as this event’s initial amount. block_drops sees and may change that
amount afterwards; cancellation or disabled block drops suppresses it.
Server-side, for every player of the world (the
helpers read the acting one). Diverges from upstream: renamed from
destroy_block, to NeoForge’s BreakBlockEvent.
Side: server.
Return Flow::Cancel to take it: this sets canceled, and later mods are skipped unless they
listen with #[listener(receive_cancelled)]; those see event.cancelled and may set it back to
false.
fn right_click_block(
&self,
host: HostSide<'_>,
event: &mut RightClickBlockEvent<'_>,
) -> Flow
fn right_click_block( &self, host: HostSide<'_>, event: &mut RightClickBlockEvent<'_>, ) -> Flow
A player right clicks a block (NeoForge’s
PlayerInteractEvent.RightClickBlock): once per hand, where
useItemOn starts, on the clicking client and on the server (click
says which, with the block, the hit, the hand and its stack, and the
player). Before the block’s own use (a chest, a door, a lever) and the
item’s (Item.useOn, native_use_on).
use_block forces the block’s use off (False) or on even while
sneaking with something in hand (True); use_item forces the
item’s useOn off, or on even while the item cools down. Cancelling
skips both and answers cancellation_result in their place:
Pass (the default) goes on to the item’s own use (Item.use) and
then the other hand, Fail ends the click, and Success,
SuccessServer or Consume end it as used, with the swing they name.
A mod that keeps players out of land cancels with Fail.
Side: both.
Return Flow::Cancel to take it: this sets canceled, and later mods are skipped unless they
listen with #[listener(receive_cancelled)]; those see event.cancelled and may set it back to
false.
fn block_spread(
&self,
level: &dyn LevelHost,
event: &mut BlockSpreadEvent<'_>,
) -> Flow
fn block_spread( &self, level: &dyn LevelHost, event: &mut BlockSpreadEvent<'_>, ) -> Flow
On an authoritative server, a fluid flows or fire spreads from from
into to (kind is fluid or fire): FlowingFluid.spreadTo, and
FireBlock.tick setting fire to to or burning it (checkBurnOut).
Set canceled to leave the block at to as it is. Fluids ask on
every flow: answer fast.
Side: server.
Return Flow::Cancel to take it: this sets canceled, and later mods are skipped unless they
listen with #[listener(receive_cancelled)]; those see event.cancelled and may set it back to
false.
fn piston_pre(
&self,
level: &dyn LevelHost,
event: &mut PistonPreEvent<'_>,
) -> Flow
fn piston_pre( &self, level: &dyn LevelHost, event: &mut PistonPreEvent<'_>, ) -> Flow
On an authoritative server, the piston at piston is about to push
the blocks at push one step direction ([0, 1, 0] is up; pulling
when it retracts, extending false) and destroy those at destroy
(NeoForge’s PistonEvent.Pre, in PistonBaseBlock.moveBlocks, once its
structure resolved). Set
canceled and nothing moves, as when the structure can’t; a sticky
piston then retracts without its block, and clients are sent the
blocks rather than the retraction to replay. Diverges from upstream: piston_move is renamed to
piston_pre, and piston_post is new.
Side: server.
Return Flow::Cancel to take it: this sets canceled, and later mods are skipped unless they
listen with #[listener(receive_cancelled)]; those see event.cancelled and may set it back to
false.
fn piston_post(&self, level: &dyn LevelHost, event: &mut PistonPostEvent<'_>)
fn piston_post(&self, level: &dyn LevelHost, event: &mut PistonPostEvent<'_>)
On an authoritative server, the piston at piston pushed the blocks at
push one step direction ([0, 1, 0] is up; pulling when it
retracts, extending false) and destroyed those at destroy
(NeoForge’s PistonEvent.Post, at the end of PistonBaseBlock.moveBlocks,
after the neighbour updates). It only hears; piston_pre is the veto.
Server-side. Diverges from upstream: piston_move is split into
piston_pre and piston_post.
Side: server.
fn explosion_detonate(
&self,
host: &mut dyn ServerHost,
event: &mut ExplosionDetonateEvent<'_>,
)
fn explosion_detonate( &self, host: &mut dyn ServerHost, event: &mut ExplosionDetonateEvent<'_>, )
An explosion at center in dimension (minecraft:overworld) is
about to break blocks: ServerExplosion.explode with its toBlow,
before any block is hit. Take out the positions to spare; they keep
their block and get no fire. Entities are hurt as before. Server-side.
Side: server.
Every mod gets event.blocks in order and may add, change or remove blocks.
fn fill_bucket(
&self,
host: &mut dyn ServerHost,
event: &mut FillBucketEvent<'_>,
) -> Flow
fn fill_bucket( &self, host: &mut dyn ServerHost, event: &mut FillBucketEvent<'_>, ) -> Flow
A player fills (stack an empty bucket) or empties a bucket at pos:
BucketItem.use, where it asks Level.mayInteract. Set canceled
and the bucket does nothing. Server-side, for every player of the
world (host.players().acting_player() says who).
Side: server.
Return Flow::Cancel to take it: this sets canceled, and later mods are skipped unless they
listen with #[listener(receive_cancelled)]; those see event.cancelled and may set it back to
false.
fn attack_entity(
&self,
host: &mut dyn ServerHost,
event: &mut AttackEntityEvent<'_>,
) -> Flow
fn attack_entity( &self, host: &mut dyn ServerHost, event: &mut AttackEntityEvent<'_>, ) -> Flow
A player attacks the entity entity (Entity.getId) of type kind
(minecraft:item_frame, minecraft:cow, minecraft:player) standing
at pos: ServerGamePacketListenerImpl.handleInteract’s attack, once
in reach, where Player.attack starts. The swing has not begun, so the
attacking player’s attack strength is still the charge the blow uses
(vanilla reads it at the start of Player.attack; the swing resets it
afterwards). Set canceled and the blow does nothing (no damage, no
knockback, the frame keeps its item). Server-side, for every player of
the world (host.players().acting_player() says who).
Side: server.
Return Flow::Cancel to take it: this sets canceled, and later mods are skipped unless they
listen with #[listener(receive_cancelled)]; those see event.cancelled and may set it back to
false.
fn net_from_client(
&self,
host: &mut dyn ServerHost,
event: &mut NetFromClientEvent<'_>,
)
fn net_from_client( &self, host: &mut dyn ServerHost, event: &mut NetFromClientEvent<'_>, )
A message from player’s client on channel (mod_id:name), within
the caps (native_net.rs): check channel, and treat data as the
player’s own bytes, checked by nothing. Runs in the tick after it
arrives, with no player’s state swapped in. Server-side. The NeoForge
counterpart is the registered IPayloadHandler.handle callback, not
the registration event.
Side: server.
fn net_from_server(
&self,
host: &mut dyn ClientHost,
event: &mut NetFromServerEvent<'_>,
)
fn net_from_server( &self, host: &mut dyn ClientHost, event: &mut NetFromServerEvent<'_>, )
A message from the server on channel (mod_id:name), whose data
is the sender’s own bytes. The window’s game only. The NeoForge
counterpart is the registered IPayloadHandler.handle callback, not
the registration event.
Side: client.
fn player_died(
&self,
host: &mut dyn ServerHost,
event: &mut PlayerDiedEvent<'_>,
)
fn player_died( &self, host: &mut dyn ServerHost, event: &mut PlayerDiedEvent<'_>, )
player died: where ServerPlayer.die starts, with the death
message’s key when the game knows it (death.attack.lava; none for a
message it builds from the combat). It only hears. Server-side, for
every player of the world, whether death messages are shown or not.
Side: server.
fn mob_spawned(
&self,
host: &mut dyn ServerHost,
event: &mut MobSpawnedEvent<'_>,
)
fn mob_spawned( &self, host: &mut dyn ServerHost, event: &mut MobSpawnedEvent<'_>, )
A new mob of kind joined dimension at pos: natural when the
world’s spawning made it, false when something else did (a breed, a
raid, a spawner, a conversion, /summon, and the second mob of a
jockey the world spawned). One call a mob: a /summon with passengers
tells each. Not told of a mob loaded with its chunk, leaving a hive or
changing level. It only hears; the mob is already among the game’s
mobs. Server-side.
Side: server.
fn mob_killed(&self, host: &mut dyn ServerHost, event: &mut MobKilledEvent<'_>)
fn mob_killed(&self, host: &mut dyn ServerHost, event: &mut MobKilledEvent<'_>)
player’s melee blow killed the mob entity of kind (other deaths
aren’t told yet). It only hears, after the blow landed. Server-side.
Side: server.
fn item_picked_up(
&self,
host: &mut dyn ServerHost,
event: &mut ItemPickedUpEvent<'_>,
) -> Flow
fn item_picked_up( &self, host: &mut dyn ServerHost, event: &mut ItemPickedUpEvent<'_>, ) -> Flow
player is about to take count of item from the ground
(ItemEntity.playerTouch). Set canceled to leave it there: the
stack isn’t offered again for 10 ticks. Server-side.
Side: server.
Return Flow::Cancel to take it: this sets canceled, and later mods are skipped unless they
listen with #[listener(receive_cancelled)]; those see event.cancelled and may set it back to
false.
fn on_equip(&self, host: &mut dyn ServerHost, event: &mut OnEquipEvent<'_>)
fn on_equip(&self, host: &mut dyn ServerHost, event: &mut OnEquipEvent<'_>)
A player’s equipment slot slot (head, chest, legs, feet,
offhand, and mainhand on a swap of the hands or /item) took a different
item, new (none when it was emptied): LivingEntity.onEquipItem,
before the equip sound. It only hears. Never for a spectator.
Server-side, for every player of the world (the helpers read the
acting one).
Side: server.
fn health_hud(
&self,
host: &mut dyn ClientHost,
event: &mut HealthHudEvent<'_>,
) -> Option<Vec<GuiDraw>>
fn health_hud( &self, host: &mut dyn ClientHost, event: &mut HealthHudEvent<'_>, ) -> Option<Vec<GuiDraw>>
The player-health HUD rows, once a frame the HUD draws them
(HealthHud::layout, not under F1): inputs carries the health,
food, air and vehicle state the layout reads, wi/hi the screen’s
GUI size. A mod that sets draws replaces every row — armour,
hearts, food and air are the answer’s to give; bubble_pop_sound
too.
Nothing set draws Horizon’s own.
Side: client.
Return Some to set draws; the first mod returning Some wins.
fn entity_interact(
&self,
host: &mut dyn ServerHost,
event: &mut EntityInteractEvent<'_>,
) -> Flow
fn entity_interact( &self, host: &mut dyn ServerHost, event: &mut EntityInteractEvent<'_>, ) -> Flow
A player right-clicks the entity entity (Entity.getId) of type
kind (minecraft:cow) with hand (Hand::Main or Hand::Off), holding stack (none in an
empty hand): where Player.interactOn starts, before the entity’s own
interact and the item’s interactLivingEntity. Set claimed to take
the click: the hand swings and neither runs. Asked once per hand, as
vanilla tries the main hand then the off hand. Server-side, for every
player of the world (the helpers read the acting one). Diverges from upstream: renamed from
interact_entity, to NeoForge’s PlayerInteractEvent.EntityInteract.
hand corresponds to NeoForge’s PlayerInteractEvent.EntityInteract#getHand.
Side: server.
Return Flow::Cancel to take it: this sets claimed, and later mods are skipped unless they
listen with #[listener(receive_cancelled)]; those see event.cancelled and may set it back to
false.
fn left_click_block(
&self,
host: &mut dyn ServerHost,
event: &mut LeftClickBlockEvent,
) -> Flow
fn left_click_block( &self, host: &mut dyn ServerHost, event: &mut LeftClickBlockEvent, ) -> Flow
A player left-clicks the block state at pos, face the face hit
([0, 1, 0] is the top): where ServerPlayerGameMode.handleBlockBreakAction
takes a dig’s start, after its reach, spawn protection and world border
checks, before Block.attack (a note block plays) or a creative break.
Set canceled to ignore the click: the block isn’t attacked, dug or
broken on the server, and the player’s client gets it back (its own
predicted crack still shows to the clicking player). Server-side, for
every player of the world (the helpers read the acting one).
Side: server.
Return Flow::Cancel to take it: this sets canceled, and later mods are skipped unless they
listen with #[listener(receive_cancelled)]; those see event.cancelled and may set it back to
false.
fn player_tick_pre(&self, host: HostSide<'_>, event: &mut PlayerTickPreEvent)
fn player_tick_pre(&self, host: HostSide<'_>, event: &mut PlayerTickPreEvent)
Before a player’s tick on both logical sides (NeoForge 26.3
PlayerTickEvent.Pre). Non-cancellable, including death-screen ticks.
player identifies the ticked player; on the server their state is
acting. Fires before sleep, cooldowns and body work. Players still tick
under /tick freeze, but not while the level is paused.
Side: both.
fn player_tick_post(&self, host: HostSide<'_>, event: &mut PlayerTickPostEvent)
fn player_tick_post(&self, host: HostSide<'_>, event: &mut PlayerTickPostEvent)
After a player’s tick on both logical sides (NeoForge 26.3
PlayerTickEvent.Post). Non-cancellable, including death-screen ticks.
player is the same identity as in player_tick_pre; on the server
their state is acting. Runs after body work and server-side item,
arrow and XP pickups, so reads see the completed tick. Client reads
see only the state available to that client, not future server updates.
Side: both.
fn entity_join_level(
&self,
host: &mut dyn ServerHost,
event: &mut EntityJoinLevelEvent<'_>,
) -> Flow
fn entity_join_level( &self, host: &mut dyn ServerHost, event: &mut EntityJoinLevelEvent<'_>, ) -> Flow
An entity joins the server level dimension (NeoForge’s
EntityJoinLevelEvent): vanilla’s PersistentEntitySectionManager.addEntity.
loaded_from_disk is true for an entity coming back with its chunk,
false for one added fresh (addFreshEntity: a drop, an orb, /summon,
an arrival through a portal). entity is its ID and kind its type
(minecraft:item). It is already in the level’s lists, so helpers that
take an entity ID find it. Set canceled to keep it out: it is taken
back out as if never added, and a /summon of it fails. Tells every
kind in the game’s entity lists (items, orbs, mobs, boats, minecarts,
armor stands, primed TNT, falling blocks, projectiles, rockets,
tridents, end crystals, the dragon, cushions, paintings, item frames),
once each, in the order they were created; check kind. A drop, an
orb, a mob, a /summon and a chunk’s entities are told at once, any
other spawn between the tick’s phases (it is checked after the blocks,
the vehicles, the projectiles, the items and the mobs, and at the
tick’s end). A mod that cancels one of the others sees it removed
before it ticks again. Not told: the entities Horizon keeps without
simulating (displays, markers, interactions). Server-side.
Side: server.
Return Flow::Cancel to take it: this sets canceled, and later mods are skipped unless they
listen with #[listener(receive_cancelled)]; those see event.cancelled and may set it back to
false.
fn living_incoming_damage(
&self,
level: &mut dyn LevelRandomHost,
event: &mut LivingIncomingDamageEvent<'_>,
) -> Flow
fn living_incoming_damage( &self, level: &mut dyn LevelRandomHost, event: &mut LivingIncomingDamageEvent<'_>, ) -> Flow
NeoForge’s LivingIncomingDamageEvent: LivingEntity.hurtServer, past its guards (an
invulnerable or dead entity, fire on a fire-resistant one), is about to hurt entity
entity of type kind (minecraft:zombie, minecraft:player) by source: its damage
type (minecraft:fall), causing entity (DamageSource.getEntity: the shooter of an
arrow), direct entity (getDirectEntity: the projectile’s entity id when the
damage type names one, on a player, mob or ender dragon; 0 for magic() and any
other source with no direct entity, even during that projectile’s impact), and
where it comes from (getSourcePosition). victim is where the entity stands and
looks, and weapon the direct entity’s weapon (getWeaponItem) when it is known.
container is an API-owned snapshot before any reduction; engine sequencing
remains game-owned. Change its new_damage, the invulnerability ticks a fresh hit
leaves (vanilla’s 20), or add an ordered reduction modifier with
add_reduction_modifier. Set canceled and nothing
of hurtServer happens (no damage, hurt sound, knockback, cooldown, statistics or
criteria); a canceled hit on the ender dragon still counts as landed (EnderDragon.hurt
returns true whatever reallyHurt did). It fires on every damage route, for players,
mobs and the ender dragon. The level is the hit’s: its blocks, random and own
attachments; the hurt entity is in the middle of its hit.
Side: server.
Return Flow::Cancel to take it: this sets canceled, and later mods are skipped unless they
listen with #[listener(receive_cancelled)]; those see event.cancelled and may set it back to
false.
fn entity_leave_level(
&self,
host: &mut dyn ServerHost,
event: &mut EntityLeaveLevelEvent<'_>,
)
fn entity_leave_level( &self, host: &mut dyn ServerHost, event: &mut EntityLeaveLevelEvent<'_>, )
An entity leaves the server level dimension (NeoForge’s
EntityLeaveLevelEvent): vanilla’s onTrackingEnd, when it is removed
for any reason (picked up, merged, despawned, burnt, blown up, killed,
taken by a hopper or a mob, gone through a portal) or its chunk unloads,
a level closing with nobody in it included. Not for the entities still
loaded when the server stops, as in vanilla. entity is its ID and
kind its type (minecraft:item); it is no longer in the level’s lists.
It only hears. It tells every kind native_entity_join_level does
(kind is the type), each once, when the game next notices it gone
(the tick or action that removed
it). Check kind. Server-side.
Side: server.
fn block_entity_fluids(
&self,
host: &dyn Host,
event: &mut BlockEntityFluidsEvent<'_>,
) -> Option<ModFluidTanks>
fn block_entity_fluids( &self, host: &dyn Host, event: &mut BlockEntityFluidsEvent<'_>, ) -> Option<ModFluidTanks>
Block block‘s block entity has fluid tanks: set fluids when the
block is yours, in the container’s shape — each tank’s capacity in
millibuckets, the tanks each face reaches, and the tanks a fill may
reach and a drain may take. Asked once for each mod block when the
ticking table is built; at most 16 tanks, capacities clamped to
1..=1 000 000, and tank numbers past the count are left out. The tanks’
contents are kept in the entity’s saved compound, under fluids, and
the fluid helpers below read and write them.
Side: server.
Return Some to set fluids; the first mod returning Some wins.
fn should_apply_effect_tick_this_tick(
&self,
host: &dyn Host,
event: &mut ShouldApplyEffectTickThisTickEvent,
)
fn should_apply_effect_tick_this_tick( &self, host: &dyn Host, event: &mut ShouldApplyEffectTickThisTickEvent, )
MobEffect.shouldApplyEffectTickThisTick for a content mod’s effect
effect (an EffectKey for ruby:bleeding), each tick a player or a mob has it, in
MobEffectInstance.tickServer before it counts down: tick_count is
the ticks left (the entity’s tick count when infinite). Set apply
and native_apply_effect_tick follows. Server-side.
Side: server.
fn apply_effect_tick(
&self,
host: &dyn Host,
event: &mut ApplyEffectTickEvent<'_>,
)
fn apply_effect_tick( &self, host: &dyn Host, event: &mut ApplyEffectTickEvent<'_>, )
MobEffect.applyEffectTick: the content mod’s resolved EffectKey effect acts on
entity in dimension (minecraft:overworld). Clear keep and the
effect ends now, before it counts down. entity is a mob’s
Entity.getId, None for a player (host.players().acting_player() says who).
It runs inside the entity’s tick: a mob’s world borrows the game
there, so the game is read-only, and it does not hold the ticking
mobs, nor the player’s effects. holder identifies the holder; Host
reads of a mob holder are unavailable while it is ticking. Queued
changes apply after the hook; clearing keep ends the effect.
Server-side.
Side: server.
fn on_effect_added(
&self,
host: &mut dyn ServerHost,
event: &mut OnEffectAddedEvent,
)
fn on_effect_added( &self, host: &mut dyn ServerHost, event: &mut OnEffectAddedEvent, )
MobEffect.onEffectAdded: LivingEntity.addEffect gave entity
(as in native_apply_effect_tick) the content mod’s effect effect,
which it didn’t have. Server-side.
Side: server.
fn mob_effect_added(
&self,
host: &mut dyn ServerHost,
event: &mut MobEffectAddedEvent,
)
fn mob_effect_added( &self, host: &mut dyn ServerHost, event: &mut MobEffectAddedEvent, )
NeoForge’s MobEffectEvent.Added, vanilla’s MobEffect.onEffectStarted:
every LivingEntity.addEffect of the content mod’s effect effect,
new or not, changed or not, after native_on_effect_added.
Server-side.
Side: server.
fn chunk_load(&self, host: &mut dyn ServerHost, event: &mut ChunkLoadEvent<'_>)
fn chunk_load(&self, host: &mut dyn ServerHost, event: &mut ChunkLoadEvent<'_>)
Chunk chunk ([x, z], in chunks) of dimension came into the world
(NeoForge’s ChunkEvent.Load): new when it was just generated, false
when read from the save. A flat world’s chunk that leaves before it’s
first lit isn’t saved, so it’s generated, and new, again; one generated
as the players left is new when it next comes, unless the server
restarts first, or the level closes for being empty, which drops its
memory of what never saved. Its blocks and block entities are there,
but its saved entities join afterwards and its light may not be ready:
change the world from a later tick. The chunks around the spawn come
before server_started. Not told of a chunk a client receives.
The chunks leaving in the same tick were already copied for their last
save: an edit made here to one of them (a neighbour’s block entity, say)
is not in that copy, and is dropped with the chunk.
Server-side.
Side: server.
fn chunk_unload(
&self,
host: &mut dyn ServerHost,
event: &mut ChunkUnloadEvent<'_>,
)
fn chunk_unload( &self, host: &mut dyn ServerHost, event: &mut ChunkUnloadEvent<'_>, )
Chunk chunk of dimension left the world (NeoForge’s
ChunkEvent.Unload), with a level that closes for being empty too. Don’t
read its blocks. Its block entities are still there, but changes made in
this hook aren’t saved: as in vanilla, the chunk is saved before it unloads.
Not told when the world closes, which native_world_lifecycle tells.
Server-side.
Side: server.
fn player_logged_in(
&self,
host: &mut dyn ServerHost,
event: &mut PlayerLoggedInEvent<'_>,
)
fn player_logged_in( &self, host: &mut dyn ServerHost, event: &mut PlayerLoggedInEvent<'_>, )
player (name) joined the game (NeoForge’s
PlayerLoggedInEvent): placed in the world and listed in
host.players().server_players(), so native_net_send_to_player reaches them.
Once a join, with no player’s state swapped in. Server-side.
Side: server.
fn player_logged_out(
&self,
host: &mut dyn ServerHost,
event: &mut PlayerLoggedOutEvent<'_>,
)
fn player_logged_out( &self, host: &mut dyn ServerHost, event: &mut PlayerLoggedOutEvent<'_>, )
player (name) left the game (NeoForge’s PlayerLoggedOutEvent), by
any path: a lost connection, a kick, the server stopping or failing.
Once for each player native_player_logged_in told of. They’ve already
left host.players().server_players(), except when the server stops, which tells
before it saves, with them still listed and able to get a last message.
Server-side.
Side: server.
fn component_types(
&self,
context: &RegistrationContext,
event: &mut ComponentTypesEvent<'_>,
)
fn component_types( &self, context: &RegistrationContext, event: &mut ComponentTypesEvent<'_>, )
Register namespaced NBT component types before content loads. Side: both.
Every mod gets event.types in order and may add, change or remove types.
fn block_step_on(&self, event: &mut BlockStepOnEvent<'_>)
fn block_step_on(&self, event: &mut BlockStepOnEvent<'_>)
Block.stepOn for a mod block, on its authoritative server level.
No self: the simulation owns the entity during this callback.
Side: server.
fn consume_effect(
&self,
host: &mut dyn ServerHost,
event: &mut ConsumeEffectEvent<'_>,
)
fn consume_effect( &self, host: &mut dyn ServerHost, event: &mut ConsumeEffectEvent<'_>, )
A consumable’s effect of a mod’s own kind: the item’s on_consume_effects
entry is of a type in a namespace of its own, and the loader kept it
for this call. The kind and the definition payload as a borrowed Tag are here; the acting
player is the one consuming, and the game’s own effects,
sounds, teleports and drops are open. An unclaimed kind does
nothing. This is the runtime ConsumeEffect.apply moment, not effect
type registration through NeoForge’s RegisterEvent.
Side: server.
fn loot_table_load(
&self,
context: &dyn DataLoadContext,
event: &mut LootTableLoadEvent<'_>,
)
fn loot_table_load( &self, context: &dyn DataLoadContext, event: &mut LootTableLoadEvent<'_>, )
A native mod’s hook point (docs/modding/src/how-to/native-mods.md), declared in hooks/*.rs with the game’s:
the loot table id (minecraft:chests/simple_dungeon, minecraft:blocks/stone,
minecraft:entities/zombie) as it loads, its JSON after the data packs’, before anything
rolls it (NeoForge’s LootTableLoadEvent, Fabric’s LootTableEvents.MODIFY). Add pools to
table["pools"] or entries to a pool’s entries, change or replace it (no pools: it drops
nothing; keep its random_sequence when replacing it, as a mob’s table without one drops
nothing). Called once per table in id order when the server loads or reloads its data, with the
DataLoadContext of that owning load (origin() is always ServerDataLoad: the client never loads
loot tables, so the hook never fires there).
Side: server.
Every mod gets event.table in order and may add, change or remove table.
fn loot_drops(&self, host: &mut dyn ServerHost, event: &mut LootDropsEvent<'_>)
fn loot_drops(&self, host: &mut dyn ServerHost, event: &mut LootDropsEvent<'_>)
A block broke or a mob died, and drops are the items about to drop, in
the order they drop: what the loot tables rolled (after
native_loot_table_load‘s changes), and for a mob what it wore, held or
carried (a fox’s mouth item, an allay’s, piglin’s or horse’s inventory),
but not an enderman’s carried block or a copper golem’s preserved
equipment, which drop after. A charged creeper’s head and a fox’s mouth
item come before the mob’s own table. A block’s stacks get its block
entity’s data (a shulker box’s items) after this. Add, change or take out
stacks; empty ones don’t drop (NeoForge’s global loot modifiers, Fabric’s
LootTableEvents.MODIFY_DROPS); context says what dropped them and
how, and it is called even when drops is empty. A player’s use drops
through it too (LootDrops::used: shears, a brush, an item
frame), with that player named. Lead drops from untying or cutting a
leash, and from a mob a player killed while leashed, pass through here
too, with that player named. It hears blocks that a
player, an explosion or a mob breaks, not other breaks (leaves decaying,
a torch losing its wall, a piston, /setblock ... destroy), nor a
creative break or a tool that can’t harvest the block, nor experience.
For deaths, context.damage_source carries the death invocation’s
damage type and causing/direct IDs (not remembered player credit), and
context.tool is None (the entity context has no TOOL). Resolve the causing
ID through host.entity and host.living to read its main hand live with
living.hand_item(host, Hand::Main), including earlier listeners’ changes.
Block and use drops retain their tool meaning.
Server-side, for every player.
Side: server.
Every mod gets event.drops in order and may add, change or remove drops.
fn enchant_effect(
&self,
host: &mut dyn ServerHost,
event: &mut EnchantEffectEvent<'_>,
)
fn enchant_effect( &self, host: &mut dyn ServerHost, event: &mut EnchantEffectEvent<'_>, )
A minecraft:post_attack effect of a mod’s own kind, on a mob a
player’s weapon hit: the entry says enchanted attacker and affected
victim, its requirements passed, and its effect names a type in a
namespace outside minecraft:. Told the enchantment id, the kind, the
effect payload as a borrowed Tag, the level and the mob’s id (it may have just died). The
acting player is the one whose weapon carries the enchantment. Each
such entry is told once a hit, and once for each mob a sweep lands on.
A hit on a player, and an entry inside minecraft:all_of, aren’t told
yet. An unclaimed kind does nothing.
Side: server.
fn screen_render_post(
&self,
host: &dyn ClientHost,
event: &mut ScreenRenderPostEvent<'_>,
)
fn screen_render_post( &self, host: &dyn ClientHost, event: &mut ScreenRenderPostEvent<'_>, )
The open screen has drawn itself and its tooltips (Screen.render,
the point of ScreenEvent.Render.Post): draw over it with
native_fill, native_sprite and native_text, screen.rect being
its container panel (or the whole window) and screen.id the screen
it is. Once a frame on the window, never while playing with no screen;
&self, so it reads and draws only. The Win and Options screens call
it on their own path, after their drawing.
It does not fire for the screens drawn over gameplay after it (a
server dialog, the server pack, link and code-of-conduct prompts, a
book, a sign editor): those keep Screen::Playing, which it skips (the
server pack prompt hides an open screen too, and that screen does not
fire under it), and draw over what it drew, while vanilla’s
ScreenEvent.Render.Post fires for them. The title’s own screens
(title, world_select, world_create, multiplayer…) fire it too,
their screen.id from the title state machine and the whole window
their rect, and no dialog or prompt over them.
Side: client.
fn modify_default_components(
&self,
context: &dyn DataLoadContext,
event: &mut ModifyDefaultComponentsEvent<'_>,
)
fn modify_default_components( &self, context: &dyn DataLoadContext, event: &mut ModifyDefaultComponentsEvent<'_>, )
NeoForge 26.3’s ModifyDefaultComponentsEvent: set or remove entries in
components, the default component map for item, including vanilla items.
Asked once per item after registries freeze, before the owning load
publishes immutable defaults. Receives a read-only DataLoadContext with
the actual ServerDataLoad or ClientPreload origin, frozen registry names,
settings captured once for loaded packages at this load boundary, and
the shared LoadedMods view. Readers and datapack reloads do not replay
this event. No runtime Host, world handles or transaction access.
Side: both.
Every mod gets event.components in order and may add, change or remove components.
A mouse button went down over the open screen
(ScreenEvent.MouseButtonPressed.Pre, vanilla’s
Screen.mouseClicked): screen is the screen it is, screen.mouse
where the pointer is (so there is no position of its own), button the
button’s GLFW index (0 left, 1 right, 2 middle, 3 back, 4 forward; a
button past those is the platform’s own number, which differs between
systems) and modifiers GLFW’s bits (shift 1, control 2,
alt 4, super 8). Set canceled and the press goes no further: no slot,
no screen button, no drag, no hotbar key, no sort or header button.
It fires before anything the screen does with the press, on the window
only, and while a screen of the game’s or the title’s is open (Options
and the pack list opened from the title screen count, with no player
and no menu; the title’s own screens, their
screen.id from the title state machine). It does not fire on the
connect and loading screens, nor for a server
dialog, the server pack, link and code-of-conduct prompts, a book or a
sign editor drawn over gameplay, nor while a world loads or saves: the
click there stays the game’s own. A gamepad click or a click the
keyboard’s focus sends is not the mouse and fires nothing.
Side: client.
Return Flow::Cancel to take it: this sets canceled, and later mods are skipped unless they
listen with #[listener(receive_cancelled)]; those see event.cancelled and may set it back to
false.
A mouse button went up over the open screen
(ScreenEvent.MouseButtonReleased.Pre, vanilla’s
Screen.mouseReleased), with the same screen, button and
modifiers as native_screen_mouse_button_pressed_pre and fired at
the same point. Set canceled and the release goes no further: a
pressed slot keeps what it took and no drag, slider or scrollbar lets
go.
Cancel a release only when the press it ends was cancelled too: a release the screen took ends the drag or the scroll it began, as it does in vanilla, and no guard here un-cancels it. Same screens as the press; a press that opened another screen ends on that one. Side: client.
Return Flow::Cancel to take it: this sets canceled, and later mods are skipped unless they
listen with #[listener(receive_cancelled)]; those see event.cancelled and may set it back to
false.
fn camera_shake(&self, host: &dyn ClientHost, event: &mut CameraShakeEvent<'_>)
fn camera_shake(&self, host: &dyn ClientHost, event: &mut CameraShakeEvent<'_>)
The camera shake native mods ask for in this frame, partial ticks
past the last tick (0 to 1): add your pitch, yaw and roll in degrees
and your offset in blocks, along the camera’s right, up and back, to
shake, so several mods’ shakes add up. Read while playing only;
Horizon scales the sum by Distortion Effects and bounds it
(native_shake_matrix).
Side: client.
fn shader_params(
&self,
host: &dyn ClientHost,
event: &mut ShaderParamsEvent<'_>,
)
fn shader_params( &self, host: &dyn ClientHost, event: &mut ShaderParamsEvent<'_>, )
The values native mods hand their shader packs in this frame,
partial ticks past the last tick (0 to 1): a pack’s WGSL reads
them as frame.mods (eight vec4<f32>). Write the slots your own
pack reads; a mod that bundles its pack as native-<mod id> is the
one that pack is for. Asked once a frame while a pack is on; a value
that isn’t finite reads as 0 (native_shader_params_now).
Side: client.
fn block_highlight(
&self,
host: &dyn ClientHost,
event: &mut BlockHighlightEvent,
) -> Flow
fn block_highlight( &self, host: &dyn ClientHost, event: &mut BlockHighlightEvent, ) -> Flow
Before an eligible targeted block’s selection outline is built. Cancel skips only the default block highlight, after normal HUD and game-mode gates. Side: client.
Return Flow::Cancel to take it: this sets canceled, and later mods are skipped unless they
listen with #[listener(receive_cancelled)]; those see event.cancelled and may set it back to
false.
fn render_hand(
&self,
host: &dyn ClientHost,
event: &mut RenderHandEvent<'_, '_>,
) -> Flow
fn render_hand( &self, host: &dyn ClientHost, event: &mut RenderHandEvent<'_, '_>, ) -> Flow
Before one first-person hand of this window’s player is drawn
(RenderHandEvent, client): a hand that holds an item or a map, the
empty main hand’s arm, and the empty off hand, where vanilla draws
nothing. Adjust render’s pose, draw in the hand with draw, or
cancel the default geometry; what the mods drew stays. Equip progress
includes the item’s swap scale. draw‘s pose stack starts in the
hands’ view space, in blocks, +x right, +y up, -z into the screen,
under the hand sway and before vanilla’s per-item transforms; both
hands share it, and render.hand says which one is asked. It is lit
with the light at the eyes; add geometry with native_draw_cube,
native_draw_quad, native_draw_block and native_draw_item. It
joins the hand’s own vertices, ahead of vanilla’s: the hand’s field of
view, the view bob, a shader pack’s hand pass and native_hand_drawn
see it as they see vanilla’s hand. Unlike NeoForge, the pose stack is
draw’s own: turning it moves what you draw, render’s pose moves
the default geometry, and player render state is not exposed.
Side: client.
Return Flow::Cancel to take it: this sets canceled, and later mods are skipped unless they
listen with #[listener(receive_cancelled)]; those see event.cancelled and may set it back to
false.
fn client_resources_reloaded(
&self,
host: &mut dyn ClientHost,
event: &mut ClientResourcesReloadedEvent,
)
fn client_resources_reloaded( &self, host: &mut dyn ClientHost, event: &mut ClientResourcesReloadedEvent, )
Render-thread notification after a resource-pack reload has applied successfully.
Atlas, models, renderer and client caches already refer to the new resources.
Selection/F3+T and server-pack reloads share this point; initial startup does not
(client_setup is the once-only moment after the initial load). Runs in
Reloading: published asset/data queries may refresh caches, but world
handles and transactions remain unavailable.
Side: client.
fn can_eat(&self, host: &dyn Host, event: &mut CanEatEvent<'_>) -> Option<bool>
fn can_eat(&self, host: &dyn Host, event: &mut CanEatEvent<'_>) -> Option<bool>
Player.canEat for stack, from Consumable.canConsume when eating
starts and block interaction eligibility for cake and candle cake.
For cake, stack is the held stack (None for an empty hand), and
can_always_eat is false. vanilla_can_eat is vanilla’s answer (creative,
can_always_eat, or hungry). Answer Some(false) to refuse the food,
Some(true) to let a full player eat; can_eat left None keeps
vanilla_can_eat. Both sides (the client starts eating as the
server does), so answer from the stack and the player alone.
Side: both.
Return Some to set can_eat; the first mod returning Some wins.
fn living_entity_use_item_start(
&self,
host: HostSide<'_>,
event: &mut LivingEntityUseItemStartEvent<'_>,
) -> Flow
fn living_entity_use_item_start( &self, host: HostSide<'_>, event: &mut LivingEntityUseItemStartEvent<'_>, ) -> Flow
NeoForge’s LivingEntityUseItemEvent.Start: entity starts using
stack in hand (LivingEntity.startUsingItem), for duration
ticks (native_use_duration‘s answer). entity is a mob’s
Entity.getId, None for a player (host.players().acting_player() says who);
a mob fires it only for LivingRef::start_using_item. Change duration (consumables, potions,
spyglasses and mods’ items count to it; below 0 refuses the use, and
0 runs it out on its first tick, as native_living_entity_use_item_tick
running it out, unless the item’s own is 0 already), or set
canceled and the use doesn’t start. Both sides, as
vanilla’s: on the server for every player of the world, and on a
server’s client for the uses it predicts. Answer the same on both,
and change the world only on the server (native_window is false
there), not on a server’s client.
Side: both.
Return Flow::Cancel to take it: this sets canceled, and later mods are skipped unless they
listen with #[listener(receive_cancelled)]; those see event.cancelled and may set it back to
false.
fn living_entity_use_item_finish(
&self,
host: &mut dyn ServerHost,
event: &mut LivingEntityUseItemFinishEvent<'_>,
)
fn living_entity_use_item_finish( &self, host: &mut dyn ServerHost, event: &mut LivingEntityUseItemFinishEvent<'_>, )
NeoForge’s LivingEntityUseItemEvent.Finish: entity‘s use of
stack in hand ran its time (LivingEntity.completeUsingItem),
duration the ticks left, always 0. entity is as in
native_living_entity_use_item_start. result arrives with what
finishUsingItem left in the hand (the bowl of a stew, none for the
last apple; a mod’s own item is kept) and may be replaced. Fired for
consumables, potions, spyglasses and mods’ items. Server-side, for every player
of the world (the helpers read the acting one).
Side: server.
fn screen_mouse_scrolled_pre(
&self,
host: &dyn ClientHost,
event: &mut ScreenMouseScrolledPreEvent<'_>,
) -> Flow
fn screen_mouse_scrolled_pre( &self, host: &dyn ClientHost, event: &mut ScreenMouseScrolledPreEvent<'_>, ) -> Flow
The wheel turned over the open screen (ScreenEvent.MouseScrolled.Pre,
vanilla’s Screen.mouseScrolled): screen is the screen it is,
screen.mouse where the pointer is (so there is no position of its
own), scroll the wheel’s movement in x and y as the game’s own scroll
handler scales it (a line times the wheel sensitivity: with Discrete
Scrolling on, a notch is ±1, its sign only; a touchpad’s pixels are
divided by 30), and
modifiers GLFW’s bits (shift 1, control 2, alt 4, super 8). Set
canceled and nothing the screen would scroll moves: not the bundle
under the pointer, nor a list, slider, scrollbar or map. Nothing else
reads the wheel while a screen of the game’s is open, so no hotbar slot
changes either.
It fires before the screen scrolls anything, for the window’s wheel
(horizon-ctl’s scroll-at sends it through the window too), and
while a screen of the game’s or the title’s is open (Options and the
pack list opened from the title screen count, with no player and no
menu; the title’s own). It
does not fire on the connect and loading
screens, nor for a server dialog, the server pack, link and
code-of-conduct prompts, a book or a sign editor drawn over gameplay,
nor while a world loads or saves: the scroll there stays the game’s
own. A wheel a gamepad or the keyboard’s focus sends is not the mouse
and fires nothing.
Side: client.
Return Flow::Cancel to take it: this sets canceled, and later mods are skipped unless they
listen with #[listener(receive_cancelled)]; those see event.cancelled and may set it back to
false.
fn player_command(
&self,
host: &mut dyn ServerHost,
event: &mut PlayerCommandEvent<'_>,
) -> Flow
fn player_command( &self, host: &mut dyn ServerHost, event: &mut PlayerCommandEvent<'_>, ) -> Flow
A command a player typed (NeoForge’s CommandEvent, before
Commands.performCommand runs it), without its slash: any command,
vanilla’s and the mods’ own, also one the player may not run. Set
canceled to stop it: nothing runs and nothing is answered but the
lines pushed to replies, which go to the player as system chat.
No player’s state is swapped in and the server’s player list is busy
with this one, so PlayerRef::tell and the other player helpers
reach nobody here: answer through replies. Once for each command a
player sends, on a server, and for each line of a quiet command batch
(horizon:quiet_commands, whose replies are dropped). A command the
server refuses before reading it (unsigned chat arguments, the chat
rate limit) never reaches it.
Side: server.
Return Flow::Cancel to take it: this sets canceled, and later mods are skipped unless they
listen with #[listener(receive_cancelled)]; those see event.cancelled and may set it back to
false.
fn screen_key_pressed_pre(
&self,
host: &dyn ClientHost,
event: &mut ScreenKeyPressedPreEvent<'_>,
) -> Flow
fn screen_key_pressed_pre( &self, host: &dyn ClientHost, event: &mut ScreenKeyPressedPreEvent<'_>, ) -> Flow
A key went down over the open screen (ScreenEvent.KeyPressed.Pre,
vanilla’s Screen.keyPressed): screen is the screen it is, key
vanilla’s name for the key (key.keyboard.e) — a key with no name
fires nothing — repeat whether it is
the keyboard’s auto-repeat of a held press (Horizon’s extra; NeoForge
folds repeats into the event), and modifiers GLFW’s bits (shift 1,
control 2, alt 4, super 8). Set canceled and the press goes no
further: no focus move, no Escape-close, no inventory or hotbar key, no
typing by the key itself.
It fires for the window’s presses and their repeats, and for the
control socket’s key (a release fires nothing), after the window’s
own shortcuts have run — the fullscreen and screenshot keys, the debug
keys and the narrator — and while a screen of the game’s or the title’s
is open (Options and the pack list opened from the title screen count,
with no player and no menu; the title’s own). It does
not fire on the connect and loading screens, nor for a server dialog, the server pack,
link and code-of-conduct prompts, a book or a sign editor drawn over
gameplay, nor while a world loads or saves: the key there stays the
game’s own. A cancelled press’s release still runs, and its characters
are GLFW’s separate char callback and still come; see
native_screen_char_typed_pre.
Side: client.
Return Flow::Cancel to take it: this sets canceled, and later mods are skipped unless they
listen with #[listener(receive_cancelled)]; those see event.cancelled and may set it back to
false.
fn screen_char_typed_pre(
&self,
host: &dyn ClientHost,
event: &mut ScreenCharTypedPreEvent<'_>,
) -> Flow
fn screen_char_typed_pre( &self, host: &dyn ClientHost, event: &mut ScreenCharTypedPreEvent<'_>, ) -> Flow
A character was typed at the open screen
(ScreenEvent.CharacterTyped.Pre, vanilla’s Screen.charTyped):
screen is the screen it is, c the character, modifiers GLFW’s
bits (shift 1, control 2, alt 4, super 8), and field a copy of the
focused text box. Set canceled and that one character never reaches
a text box.
field is None with no box focused, and for the boxes that keep
their own validators: Options’ and World Options’ fields, the game
rules’ and the block editor’s. cursor and highlight count Unicode
scalar characters, and a character sees the box as the one before it
left it. Change value, cursor or highlight and the box takes the
change, cancelled or not, so cancel to replace the character yourself.
New text goes through the box’s own filter and length limit, and what
follows the box (chat suggestions, a search’s results, the anvil’s
name) follows it. max_length, multiline and whether field is
None stay the box’s: a change to them does nothing.
It fires once per printable character of a key press’s text and once
per character of the input method’s committed text, never for a control
character (Enter, Backspace, Tab, Delete, Escape, a Control letter):
those are keys, and the game reads them as keys, not as text. A key’s
characters fire after the key has acted, as GLFW’s char callback comes
after its key callback (KeyboardHandler.charTyped): screen is the
screen open then, so a key that closes the screen (the inventory key)
leaves none to hear its character, where vanilla’s closed screen hears
nothing, and one that moves the focus types into the box it moved to.
They fire even when native_screen_key_pressed_pre cancelled the press
that carried the text, as NeoForge delivers CharacterTyped.Pre for a
cancelled KeyPressed.Pre: the characters left reach the text box
without the key’s own effects. Cancelling one character drops only that
one. The control socket’s type fires it too, but not for its \b
backspace. Same screens as the key press, and it fires with no text box
focused (there is nothing to take the character then).
Side: client.
Return Flow::Cancel to take it: this sets canceled, and later mods are skipped unless they
listen with #[listener(receive_cancelled)]; those see event.cancelled and may set it back to
false.
fn data_pack_files(
&self,
host: &mut dyn ServerHost,
event: &mut DataPackFilesEvent<'_>,
)
fn data_pack_files( &self, host: &mut dyn ServerHost, event: &mut DataPackFilesEvent<'_>, )
The server is assembling its data tables from the world’s data packs
(ReloadableServerResources): a world is opening, or /reload was
run, and the recipes, tags, loot and advancements are built after
this. Push (path, bytes) pack files and they join this load. path
is the overlay’s key, <kind>/<namespace>:<path> without .json, over
the kinds the tables read: recipe/mymod:thing,
tags/mymod:block/thing, loot_table/…, advancement/…,
trade_set/…, villager_trade/…, dialog/…. A file that isn’t JSON
is skipped with a warning. Asked once per load on both paths, so this
is where a mod recomputes them.
Contributed files sit below the world’s own data packs: a pack’s file
for the same path still overrides a mod’s. Server-side (the single
player’s integrated server included). Listener applies run first. A later reload refusal
preserves the old engine generation, but does not undo callback effects. Contributions
share one list, so a failed file cannot be attributed to a particular mod.
Side: server.
Every mod gets event.files in order and may add, change or remove files.
fn biome_colors(&self, host: &dyn ClientHost, event: &mut BiomeColorsEvent<'_>)
fn biome_colors(&self, host: &dyn ClientHost, event: &mut BiomeColorsEvent<'_>)
Change the colours of biome (minecraft:plains) on this client: the
grass, foliage (leaves, vines), dry foliage (leaf litter) and water
tints, 0xRRGGBB, as its biome file and the colormaps set them. Asked
for every biome when a mod calls native_refresh_biome_colors, which
rebuilds the terrain with them; a season mod answers from its season
and calls that when the season turns. The dark forest’s modifier
still applies to the grass set here; the swamp’s noise colours
replace it.
Side: client.
fn compute_fov(&self, host: &dyn ClientHost, event: &mut ComputeFovEvent)
fn compute_fov(&self, host: &dyn ClientHost, event: &mut ComputeFovEvent)
World field of view, after normal calculation and zoom and before projection/Nausea. Called for world rendering and near-plane overlays; hand/HUD FOV uses its own path. Only finite values in 1..=179 degrees replace the computed FOV. Side: client.
fn mob_submit(
&self,
host: &dyn ClientHost,
event: &mut MobSubmitEvent<'_>,
) -> Flow
fn mob_submit( &self, host: &dyn ClientHost, event: &mut MobSubmitEvent<'_>, ) -> Flow
Draw the mob mob (its id, kind, custom name and the frame’s body
and head turns and walk cycle, LivingEntityRenderState) on this
client with a model of your own, once a frame while it is in view
(vanilla’s EntityRenderer.submit), and set drawn to leave out its
vanilla model, armour and held items (NeoForge’s RenderLivingEvent.Pre,
cancelled). Add geometry with native_draw_cube, native_draw_quad,
native_draw_block and native_draw_item under draw’s pose stack,
which starts at the mob’s feet turned with its body: +z is the way it
faces, +x its left, +y up, in blocks. draw also has the partial tick,
the game time and the mob’s light. Its name tag, shadow, flames and
glowing outline draw as for any mob. Asked for every mob in view but
players; a mob your server half spawned (native_spawn_mob) is told
apart by its id, sent with mod messages, or by its custom name.
A mob is drawn afresh each frame: draw.keep() does nothing here.
hidden.hide_named(name) leaves only the part of that name out of the
vanilla model this frame (a villager’s nose), drawn on the CPU or the
GPU: a hidden part takes its children with it, while its armour, held
items and other layers keep every part.
Side: client.
Return Flow::Cancel to take it: this sets drawn, and later mods are skipped unless they
listen with #[listener(receive_cancelled)]; those see event.cancelled and may set it back to
false.
fn camera_distance(
&self,
host: &dyn ClientHost,
event: &mut CameraDistanceEvent<'_>,
)
fn camera_distance( &self, host: &dyn ClientHost, event: &mut CameraDistanceEvent<'_>, )
Final scaled third-person camera distance, before visual-shape collision clipping.
entity includes its living scale/distance and optional mount scale/distance.
Only finite requests in 0..=1024 blocks replace the vanilla distance.
Side: client.
fn compute_fog_color(
&self,
host: &dyn ClientHost,
event: &mut ComputeFogColorEvent<'_>,
)
fn compute_fog_color( &self, host: &dyn ClientHost, event: &mut ComputeFogColorEvent<'_>, )
Computed world fog RGB, after ordinary effects and before upload. Title panoramas skip it. Only finite RGB components in 0..=1 are accepted; alpha and distances stay unchanged. Side: client.
Raw mouse button input on any screen, before dispatch; cancel skips dispatch and Post. Button/modifiers use the same GLFW encoding as screen hooks. Synthetic clicks skip it. Side: client.
Return Flow::Cancel to take it: this sets canceled, and later mods are skipped unless they
listen with #[listener(receive_cancelled)]; those see event.cancelled and may set it back to
false.
An accepted raw button event finished dispatch, including a screen handler’s early return. Side: client.
fn player_respawn_position(
&self,
host: &mut dyn ServerHost,
event: &mut PlayerRespawnPositionEvent<'_>,
)
fn player_respawn_position( &self, host: &mut dyn ServerHost, event: &mut PlayerRespawnPositionEvent<'_>, )
PlayerRespawnPositionEvent: where player respawns, once the server has
found it: the bed or anchor they stand up at (facing it), or the world
spawn’s free column. original_level and original_position are that
point; missing_respawn_block says the bed or anchor was gone, so the
player came back at the world spawn. Change level, position, yaw
and pitch to send them elsewhere: within the level a teleport, into
another level a level change. copy_original_spawn_position (default:
the block wasn’t missing) says whether they keep their respawn point for
next time. Horizon places the player first and finds the point once its
chunks have loaded, so this fires then, before player_respawned only
when no chunks had to load. Not for the End exit, which isn’t a respawn
here (as for player_respawned). Server-side.
Side: server.
fn player_respawned(
&self,
host: &mut dyn ServerHost,
event: &mut PlayerRespawnedEvent<'_>,
)
fn player_respawned( &self, host: &mut dyn ServerHost, event: &mut PlayerRespawnedEvent<'_>, )
player (name) respawned (NeoForge’s PlayerRespawnEvent): at the
end of PlayerList.respawn, once they are placed and their health,
food and experience reset, with their state swapped in. Once for each
death that ends in a respawn, on a server; not for the End-exit one.
Side: server.
fn render_fog(&self, host: &dyn ClientHost, event: &mut RenderFogEvent<'_>)
fn render_fog(&self, host: &dyn ClientHost, event: &mut RenderFogEvent<'_>)
Final world fog, after the computed color hook, ordinary calculations and Horizon’s fog option, before upload. Title panoramas skip it. Invalid color or distance values retain the original whole fog. Side: client.
fn screen_key_released_pre(
&self,
host: &dyn ClientHost,
event: &mut ScreenKeyReleasedPreEvent<'_>,
) -> Flow
fn screen_key_released_pre( &self, host: &dyn ClientHost, event: &mut ScreenKeyReleasedPreEvent<'_>, ) -> Flow
Before an open screen handles a named key’s release (same screen gate as key presses). Cancel bypasses screen handling; physical keys and mapped keyboard hold/toggle state release. Side: client.
Return Flow::Cancel to take it: this sets canceled, and later mods are skipped unless they
listen with #[listener(receive_cancelled)]; those see event.cancelled and may set it back to
false.
fn music(&self, host: &dyn ClientHost, event: &mut MusicEvent<'_>)
fn music(&self, host: &dyn ClientHost, event: &mut MusicEvent<'_>)
Choose this client’s music, once a client tick: music and volume
hold what vanilla chose (Minecraft.getSituationalMusic and
getMusicVolume: the biome’s track, the creative or underwater one, a
boss’s, the menu’s; None for silence). Set music to a track of your
own, a sound event of your content mod’s sounds.json such as
Music::new("mymod:music.spring", 1200, 6000, false) (the delays in
ticks between songs, and whether it cuts off a different song playing),
None to keep vanilla’s quiet, or change volume (0 to 1) to fade it.
Side: client.
fn music_layers(&self, host: &dyn ClientHost, event: &mut MusicLayersEvent<'_>)
fn music_layers(&self, host: &dyn ClientHost, event: &mut MusicLayersEvent<'_>)
The tracks to play over (or instead of) the music on this client,
asked once a client tick: push a MusicLayer (a sound event, looped,
and its volume, 0 to 1) for each. A layer eases to a new volume over up
to two seconds, and one left out fades out and stops; layers that
first appear in the same tick start together, so list every stem of a
piece from the start, the silent ones at volume 0, and raise them (a
fuller arrangement as a village grows). Their sound events should be
stream: true in sounds.json.
Side: client.
Every mod gets event.layers in order and may add, change or remove layers.
fn datapack_sync(
&self,
host: &mut dyn ServerHost,
event: &mut DatapackSyncEvent<'_>,
)
fn datapack_sync( &self, host: &mut dyn ServerHost, event: &mut DatapackSyncEvent<'_>, )
The server is about to send its data to the players (NeoForge’s
OnDatapackSyncEvent, its sendRecipes): push the recipe types
(minecraft:smelting, mymod:crusher) whose recipes your client half
needs. Horizon sends their final recipes — the world’s data packs
merged, load conditions held — to every Horizon client when it joins
and again after each /reload; a vanilla client is sent nothing new.
Asked once per load, when the server’s data tables are built, and the
same types go to every player: unlike NeoForge, which asks again for
each joining player, it can’t differ between players. Push nothing and
nothing is sent; push nothing after a load that pushed some and the
clients go back to their own recipes. Server-side (the single
player’s integrated server included).
Side: server.
Every mod gets event.recipe_types in order and may add, change or remove recipe_types.
fn recipes_received(
&self,
host: &mut dyn ClientHost,
event: &mut RecipesReceivedEvent<'_>,
)
fn recipes_received( &self, host: &mut dyn ClientHost, event: &mut RecipesReceivedEvent<'_>, )
The server’s recipes of recipe_types arrived (NeoForge’s
RecipesReceivedEvent): from now on the recipe helpers
(native_recipes, native_recipes_of_type) give the server’s recipes
of those types in place of the window’s own, so rebuild what you made
of them. It comes after a join, once the window has its player, and
after every /reload, on a server whose mods asked for them
(native_datapack_sync), single player included; with no types when
the server stopped sending them and the window is back on its own
recipes. A recipe the
window’s own recipe book doesn’t know has book_id -1. Client-side.
Side: client.
fn input_key(&self, host: &mut dyn ClientHost, event: &mut InputKeyEvent<'_>)
fn input_key(&self, host: &mut dyn ClientHost, event: &mut InputKeyEvent<'_>)
A real window key event after handling, including repeats and consumed shortcuts
(InputEvent.Key). key is vanilla’s name for the physical key (key.keyboard.a,
key.keyboard.unknown for one it doesn’t name), action what it did, and the
modifier bits the screen hooks’ GLFW encoding. Not cancellable.
Side: client.
fn mouse_scrolling(
&self,
host: &mut dyn ClientHost,
event: &mut MouseScrollingEvent,
) -> Flow
fn mouse_scrolling( &self, host: &mut dyn ClientHost, event: &mut MouseScrollingEvent, ) -> Flow
Gameplay scrolling after accumulation, before hotbar/spectator handling.
scroll is scaled x/y, accumulated whole x/y steps, buttons left/middle/right,
and cursor the GUI position. Cancel skips gameplay scrolling.
Side: client.
Return Flow::Cancel to take it: this sets canceled, and later mods are skipped unless they
listen with #[listener(receive_cancelled)]; those see event.cancelled and may set it back to
false.
fn screen_mouse_dragged_pre(
&self,
host: &dyn ClientHost,
event: &mut ScreenMouseDraggedPreEvent<'_>,
) -> Flow
fn screen_mouse_dragged_pre( &self, host: &dyn ClientHost, event: &mut ScreenMouseDraggedPreEvent<'_>, ) -> Flow
Before a real held-button movement reaches screen drag handlers.
screen.mouse is the current GUI position; delta is its GUI-space movement.
Cancel keeps the new cursor position but skips all screen drag handlers.
Side: client.
Return Flow::Cancel to take it: this sets canceled, and later mods are skipped unless they
listen with #[listener(receive_cancelled)]; those see event.cancelled and may set it back to
false.
fn mod_container_viewers(
&self,
host: &mut dyn ServerHost,
event: &mut ModContainerViewersEvent<'_>,
)
fn mod_container_viewers( &self, host: &mut dyn ServerHost, event: &mut ModContainerViewersEvent<'_>, )
The number of players with the mod container at pos of dimension
open went from previous to viewers (vanilla’s
ContainerOpenersCounter, as a barrel keeps it): 0 to more than 0 is
onOpen, back to 0 is onClose, any change openerCountChanged, so a
block can show itself open while viewers is not 0. Counted every
tick from the players’ open menus, so a player who leaves without
closing (a lost connection, death, another dimension, out of reach, the
block gone) is heard too (recheckOpeners). Once for each change, with
no player’s state swapped in. Server-side.
Side: server.
fn living_knockback(
&self,
level: &mut dyn LevelRandomHost,
event: &mut LivingKnockbackEvent<'_>,
) -> Flow
fn living_knockback( &self, level: &mut dyn LevelRandomHost, event: &mut LivingKnockbackEvent<'_>, ) -> Flow
NeoForge’s LivingKnockBackEvent: LivingEntity.knockback is about to push entity
entity of type kind (minecraft:zombie, minecraft:player) strength away from the
direction (x, z), on the raw strength, before the entity’s knockback resistance takes
its share and its motion changes. Vanilla’s direction points at the source of a hit (the
attacker’s side), and the entity is pushed the other way. source is the push’s
DamageSource, named as native_living_incoming_damage names a hit’s. attacker is the
attacking entity’s network id, falling back to the victim’s last hurt-by mob, or 0 when
unknown; attacker_main and attacker_off are what it holds (a player’s selected and
off-hand stacks, a mob’s main hand), none when unknown. Change strength, x or z, or
set canceled, and the push follows them: canceled, the entity’s motion is left alone. A
strength of 0 or less after the hook is no push, and a direction too short to tell
draws a random one after it, as in vanilla. A value a mod leaves that is not a finite
number is put back as it was. It fires for the players, mobs and armor stands the game
knocks back: a hit’s own push, a sprinting or Knockback hit, a sweep, a spear, a
shield’s push on its holder, a goat’s ram and a mob’s melee push. It does not fire for a
sulfur cube with a block that a hit with a causing entity knocks back
(SulfurCube.knockback does not call super there), for the pushes vanilla doesn’t make
with LivingEntity.knockback (the ender dragon’s wings, Punch arrows, explosions, wind
charges, a mace smash’s area, a hoglin’s throw), nor for the ones Horizon makes another
way (the ender dragon’s). The level is the hit’s: its blocks, random and own attachments.
Side: server.
Return Flow::Cancel to take it: this sets canceled, and later mods are skipped unless they
listen with #[listener(receive_cancelled)]; those see event.cancelled and may set it back to
false.
fn experience_orb_can_merge(
&self,
host: &mut dyn ServerHost,
event: &mut ExperienceOrbCanMergeEvent<'_>,
)
fn experience_orb_can_merge( &self, host: &mut dyn ServerHost, event: &mut ExperienceOrbCanMergeEvent<'_>, )
Whether the experience orb into takes the orb from in (vanilla’s
ExperienceOrb.canMerge): the same value, and ids a multiple of 40 apart. Asked
for each pair whose boxes meet, when an orb spawns (tryMergeToExisting: from is
0, the new orb isn’t an entity yet, and only from_value is known) and every 20
ticks as an orb scans for neighbours (scanForMerges). can_merge holds vanilla’s
answer; change it either way. A merged orb counts as count orbs of into’s
value, so forcing orbs of different values together drops points unless the mod
raises into’s value with native_set_experience_orb in native_experience_orb_merge.
Server-side.
Side: server.
fn experience_orb_merge(
&self,
host: &mut dyn ServerHost,
event: &mut ExperienceOrbMergeEvent<'_>,
) -> Flow
fn experience_orb_merge( &self, host: &mut dyn ServerHost, event: &mut ExperienceOrbMergeEvent<'_>, ) -> Flow
The experience orb into is about to take from in, after
native_experience_orb_can_merge said yes (from is 0 and from_value the
points of a new orb that is spawning). Set canceled to stop it: both orbs stay, and
a spawning orb tries the next orb in reach, then spawns on its own. Server-side.
Side: server.
Return Flow::Cancel to take it: this sets canceled, and later mods are skipped unless they
listen with #[listener(receive_cancelled)]; those see event.cancelled and may set it back to
false.
fn living_entity_use_item_tick(
&self,
host: HostSide<'_>,
event: &mut LivingEntityUseItemTickEvent<'_>,
) -> Flow
fn living_entity_use_item_tick( &self, host: HostSide<'_>, event: &mut LivingEntityUseItemTickEvent<'_>, ) -> Flow
NeoForge’s LivingEntityUseItemEvent.Tick: each tick entity uses
stack in hand, where LivingEntity.updatingUsingItem starts,
duration the ticks left. entity is as in
native_living_entity_use_item_start. Change duration to move the
end (consumables, potions, spyglasses and mods’ items count to it,
and so do a client’s eating crumbs and first person pose, as the
started duration of native_living_entity_use_item_start does). A
cancel sets it to -1. Once a mod set it, the use goes on
only while it is above 0: at 0 or less, by a cancel or set, the
item’s tick is skipped and the server finishes the use
(completeUsingItem: finishUsingItem, the food eaten,
native_living_entity_use_item_finish), while an item used on
release (a crossbow) stays frozen until let go. NeoForge’s javadoc
says a cancel stops the use, but its code finishes it; this follows
the code. On a server’s client a run-out use stays in use, frozen,
so letting go still tells the server. Both sides, as vanilla’s
updatingUsingItem: answer the same on both, and change the world
only on the server (native_window is false there), not on a
server’s client. Runs every tick of every use:
check the item first.
Side: both.
Return Flow::Cancel to take it: this sets canceled, and later mods are skipped unless they
listen with #[listener(receive_cancelled)]; those see event.cancelled and may set it back to
false.
fn living_entity_use_item_stop(
&self,
host: HostSide<'_>,
event: &mut LivingEntityUseItemStopEvent<'_>,
) -> Flow
fn living_entity_use_item_stop( &self, host: HostSide<'_>, event: &mut LivingEntityUseItemStopEvent<'_>, ) -> Flow
NeoForge’s LivingEntityUseItemEvent.Stop: entity lets go of
stack in hand before its use ran its time
(LivingEntity.releaseUsingItem: the use button let go, a screen
opened), duration the ticks left. Set canceled to skip the item’s
release (a bow doesn’t shoot, a spyglass makes no sound,
native_release_using isn’t called); the use stops anyway. Not when
the hand changed item, which stops the use without a release. Both
sides, as native_living_entity_use_item_tick.
Side: both.
Return Flow::Cancel to take it: this sets canceled, and later mods are skipped unless they
listen with #[listener(receive_cancelled)]; those see event.cancelled and may set it back to
false.
fn loot_function(&self, event: &mut LootFunctionEvent<'_>)
fn loot_function(&self, event: &mut LootFunctionEvent<'_>)
A loot function of a mod’s own kind: the entry named a type in a
namespace outside minecraft:, and the roll kept it for this call.
The kind and JSON file input accompany owned API context and candidate snapshots.
Candidate counts remain signed; ordered NBT patches preserve removals and types.
Conversion happens only for subscribed hooks, and refused writeback leaves the roll unchanged.
tags reads membership and ordered members by key from this evaluation’s
authoritative merged tags. No enumeration or full Host is exposed.
Side: server.
Every mod gets event.stack in order and may add, change or remove stack.
fn loot_condition(&self, event: &mut LootConditionEvent<'_>)
fn loot_condition(&self, event: &mut LootConditionEvent<'_>)
A loot condition of a mod’s own kind: the entry named a type in a
namespace outside minecraft:. The kind, the JSON, the context and
whether it holds are here (holds starts false; a mod that claims
the kind sets it). The context is an owned snapshot, captured after the subscription guard.
tags reads membership and ordered members by key from this evaluation’s
authoritative merged tags. No enumeration or full Host is exposed.
Side: server.
Every mod gets event.holds in order and may add, change or remove holds.
fn level_load(&self, host: &mut dyn ServerHost, event: &mut LevelLoadEvent<'_>)
fn level_load(&self, host: &mut dyn ServerHost, event: &mut LevelLoadEvent<'_>)
dimension’s level opened on the server (NeoForge’s LevelEvent.Load,
posted in MinecraftServer.createLevels): before any of its chunks
(native_chunk_load), so a mod sets up what it keeps for the level
here. The level the world opens in comes before server_started; the
others open when someone first goes there (a player, a portal, an
execute in command), with the level in place. Once for each open:
native_level_unload follows. Server-side.
Side: server.
fn level_unload(
&self,
host: &mut dyn ServerHost,
event: &mut LevelUnloadEvent<'_>,
)
fn level_unload( &self, host: &mut dyn ServerHost, event: &mut LevelUnloadEvent<'_>, )
dimension‘s level closed (NeoForge’s LevelEvent.Unload, posted after
level.close() in MinecraftServer.stopServer), after its last save:
drop what the mod kept for it. A level other than the Overworld closes
once nobody has been in it for 300 ticks, after its chunks’ unloads;
every level still open closes when the server stops, before
WorldCloseFinal, and when its open or its loop fails, before
WorldOpenFailed or WorldCloseFailed. Once for each
native_level_load. Don’t read its blocks. Server-side.
Side: server.
fn client_level_load(
&self,
host: &mut dyn ClientHost,
event: &mut ClientLevelLoadEvent<'_>,
)
fn client_level_load( &self, host: &mut dyn ClientHost, event: &mut ClientLevelLoadEvent<'_>, )
The client made a new level for dimension (NeoForge’s
LevelEvent.Load from the ClientLevel constructor): on joining a
server, single player’s own included, and on changing dimension.
Its chunks come after. When the dimension changes, the old level’s
native_client_level_unload follows this, as Minecraft.setLevel
tells it after the new level is made. Client-side, on the window; the
server’s levels have native_level_load.
Side: client.
fn client_level_unload(
&self,
host: &mut dyn ClientHost,
event: &mut ClientLevelUnloadEvent<'_>,
)
fn client_level_unload( &self, host: &mut dyn ClientHost, event: &mut ClientLevelUnloadEvent<'_>, )
The client dropped its level for dimension (LevelEvent.Unload
from Minecraft.setLevel and disconnect): replaced by another
dimension’s, or on leaving the server. Once for each
native_client_level_load. Not told when the game itself quits.
Client-side.
Side: client.
fn hears_projectile_impacts(
&self,
host: &dyn Host,
event: &mut HearsProjectileImpactsEvent,
)
fn hears_projectile_impacts( &self, host: &dyn Host, event: &mut HearsProjectileImpactsEvent, )
Whether a mod hears projectiles’ impacts (native_projectile_impact):
set hears. Asked once a server tick before the projectiles fly; only
then does the tick keep the copy of each flying projectile that a
canceled impact flies on from, so a game without such a mod pays
nothing. Server-side.
Side: server.
Every mod gets event.hears in order and may add, change or remove hears.
fn projectile_impact(
&self,
host: &mut dyn ServerHost,
event: &mut ProjectileImpactEvent<'_>,
) -> Flow
fn projectile_impact( &self, host: &mut dyn ServerHost, event: &mut ProjectileImpactEvent<'_>, ) -> Flow
A projectile hit something (NeoForge’s ProjectileImpactEvent, posted
where vanilla’s projectile has found what it meets, before the hit
acts): projectile (its entity id) of type kind (minecraft:arrow),
shot by owner (a mob’s or a player’s entity id, 0 for none) in the level
dimension. It hit the entity entity of type entity_kind (a player is
minecraft:player; a dragon’s part is minecraft:ender_dragon), or, with
entity None, the block at block on its face (the face’s normal,
[0, 1, 0] for the top), at the point at. Set canceled and the impact
does not happen: no damage, no knockback, no sound, no block reaction, the
arrow does not stick, a pearl does not teleport, a potion or a fireball
does not burst. The projectile flies on and is not discarded, so a mod
that cancels also decides what becomes of it. It continues through its
whole motion and may hit something on a later tick. Covers what
tick_projectiles flies: arrows, tridents, snowballs,
eggs, pearls, potions, fireballs, wither skulls, wind charges, llama spit and
shulker bullets, from players, mobs and dispensers. It does not fire for
a breeze’s deflection, for a hit on a wind charge, for fireworks or for
fishing bobbers. A dragon part or End crystal is told by the id of the
dragon or crystal. Heard only when a mod also sets
native_hears_projectile_impacts. Server-side.
Side: server.
Return Flow::Cancel to take it: this sets canceled, and later mods are skipped unless they
listen with #[listener(receive_cancelled)]; those see event.cancelled and may set it back to
false.
fn entity_mount(
&self,
host: &mut dyn ServerHost,
event: &mut EntityMountEvent<'_>,
) -> Flow
fn entity_mount( &self, host: &mut dyn ServerHost, event: &mut EntityMountEvent<'_>, ) -> Flow
An entity mounts or dismounts a vehicle (NeoForge’s EntityMountEvent, posted from
Entity.startRiding and removeVehicle): entity of type kind (minecraft:player,
minecraft:zombie) in the server level dimension, getting on (mounting) or off the
vehicle of type vehicle_kind (minecraft:oak_boat, minecraft:minecart,
minecraft:horse, minecraft:cushion). Set canceled and it does not: a player stays
where they were, a mob does not board, a /ride fails, and a rider whose dismount is
canceled keeps riding. Players hear boarding and dismounts by input, /ride, hits,
bucking, teleport or spectator mode; mobs hear boarding and dismounts (jockeys,
ravager raiders, /ride, hits), including removal cleanup. A Mob’s canceled
dismount keeps its relationship even when a boat or cart is destroyed; the
removed vehicle is not a valid handle or query result. Each later dismount asks again.
A resident Mob retries immediately before its next eligible entity tick:
its chunk must be entity-ticking and its tick must not have been canceled.
A server player retries on its next vehicle tick. Either can be later in the
same world tick. A rejected, nonresident passenger does not autonomously
tick or retry. Loading a save does not notify. Server-side.
Side: server.
Return Flow::Cancel to take it: this sets canceled, and later mods are skipped unless they
listen with #[listener(receive_cancelled)]; those see event.cancelled and may set it back to
false.
fn interaction_key_mapping_triggered(
&self,
host: &mut dyn ClientHost,
event: &mut InteractionKeyMappingTriggeredEvent,
) -> Flow
fn interaction_key_mapping_triggered( &self, host: &mut dyn ClientHost, event: &mut InteractionKeyMappingTriggeredEvent, ) -> Flow
An interaction mapping is about to act on the tick’s crosshair target. attempt
distinguishes a queued press from held use or mining. Use asks for each hand tried,
main first. Cancelling the main hand ends the click. A cancelled attack or use still
swings unless the listener clears swing_hand. Fires on the window client.
Side: client.
Return Flow::Cancel to take it: this sets canceled, and later mods are skipped unless they
listen with #[listener(receive_cancelled)]; those see event.cancelled and may set it back to
false.
fn gui_layer_pre(
&self,
host: &dyn ClientHost,
event: &mut GuiLayerPreEvent<'_>,
) -> Flow
fn gui_layer_pre( &self, host: &dyn ClientHost, event: &mut GuiLayerPreEvent<'_>, ) -> Flow
Before one of vanilla’s HUD layers is drawn (RenderGuiLayerEvent.Pre):
draw here to put something below the layer, or set canceled to hide
it. layer is the layer’s id, in the order Horizon draws them:
minecraft:crosshair, hotbar, effects, boss_overlay,
vehicle_health (only riding a mount), contextual_info_bar (the
mount’s jump bar, the locator bar or the experience bar, with the level
number), player_health (the health, armor, food and air rows, drawn in
one pass), selected_item_name, sleep_overlay, overlay_message
(the action bar), title, scoreboard_sidebar, subtitle_overlay,
chat and tab_list. A layer F1 hides fires nothing, and the chat
screen draws the focused chat itself, so chat is only the unfocused
lines. The camera overlays and the debug screen are not layers here:
they are not drawn in this pass. Draw with native_fill, native_text
and the sprite helpers; draw.size() is the GUI
size. A layer a mod registered (register_gui_layers) fires this
and gui_layer_post too, with its own id, in its place among
these.
Side: client.
Return Flow::Cancel to take it: this sets canceled, and later mods are skipped unless they
listen with #[listener(receive_cancelled)]; those see event.cancelled and may set it back to
false.
fn gui_layer_post(
&self,
host: &dyn ClientHost,
event: &mut GuiLayerPostEvent<'_>,
)
fn gui_layer_post( &self, host: &dyn ClientHost, event: &mut GuiLayerPostEvent<'_>, )
After one of vanilla’s HUD layers (or after the layer a mod hid), with
the ids of native_gui_layer_pre: draw here to put something above
the layer (RenderGuiLayerEvent.Post).
Side: client.
fn map_decorations(
&self,
host: &dyn ClientHost,
event: &mut MapDecorationsEvent<'_>,
)
fn map_decorations( &self, host: &dyn ClientHost, event: &mut MapDecorationsEvent<'_>, )
Icons a mod puts on map map each time it is drawn: held, in an
item frame or on the cartography table’s screen (a map’s pixels are
its own; nothing is saved in the map). Push MapDecorations
(an atlas sprite, a position in half map pixels, a rotation, and
whether it shows in a frame and on the screen like vanilla’s markers
do); they are drawn after the vanilla ones with the same pose, and a
sprite the atlas lacks is left out. map.center, map.scale and
map.dimension say which blocks the map shows, and
MapDecoration::x has the formula. Vanilla’s decorations are
not passed in. Asked every frame a map is drawn, so keep it cheap.
The client half of MapDecorationType and addDecoration: a type
registered on the server and saved in the map’s data is not here.
Side: client.
Every mod gets event.decorations in order and may add, change or remove decorations.
fn player_start_tracking(
&self,
host: &mut dyn ServerHost,
event: &mut PlayerStartTrackingEvent<'_>,
)
fn player_start_tracking( &self, host: &mut dyn ServerHost, event: &mut PlayerStartTrackingEvent<'_>, )
A client started tracking an entity (NeoForge’s
PlayerEvent.StartTracking, posted at the end of
ServerEntity.addPairing): player (name) is now sent entity
(its ID, uuid its UUID, kind its type, minecraft:zombie) and its
changes. It comes into range, its client’s chunks reach it, or it is
put in the level; another player is an entity too, and a player never
tracks their own. A mod sends the player what they need to show it
(native_net_send_to_player). The entity is as it was last tick: it
may be gone by now. Heard after the tick’s players and entities have
moved, in order, with no player’s state swapped in. Server-side.
Side: server.
fn player_stop_tracking(
&self,
host: &mut dyn ServerHost,
event: &mut PlayerStopTrackingEvent<'_>,
)
fn player_stop_tracking( &self, host: &mut dyn ServerHost, event: &mut PlayerStopTrackingEvent<'_>, )
A client stopped tracking an entity (NeoForge’s
PlayerEvent.StopTracking, posted at the end of
ServerEntity.removePairing): it went out of range, left the level or
died, or player (name) left, changed level or respawned, which
stops everything they tracked. entity, uuid and kind are as
native_player_start_tracking told. Once for each start, a leaving
player’s after native_player_logged_out. The entity is not
necessarily still there, and a player who left is gone: no player’s
state is swapped in. Server-side.
Side: server.
fn block_entity_energy(
&self,
host: &dyn Host,
event: &mut BlockEntityEnergyEvent<'_>,
) -> Option<ModEnergyBuffer>
fn block_entity_energy( &self, host: &dyn Host, event: &mut BlockEntityEnergyEvent<'_>, ) -> Option<ModEnergyBuffer>
Block block’s block entity has an energy buffer
(Capabilities.Energy.BLOCK): set energy when the block is yours,
as SimpleEnergyHandler is built: its capacity, the most one insert
and one extract moves, and the faces a fill may come through and a
drain may leave by. Asked once for each mod block when the ticking
table is built; a capacity under 1 leaves the buffer out, and the
limits are clamped to 0..=capacity. The amount is kept in the entity’s
saved compound, as the int energy, and the energy helpers below read
and write it.
Side: server.
Return Some to set energy; the first mod returning Some wins.
fn data_map_types(
&self,
host: &mut dyn ServerHost,
event: &mut DataMapTypesEvent<'_>,
)
fn data_map_types( &self, host: &mut dyn ServerHost, event: &mut DataMapTypesEvent<'_>, )
The server is assembling its data tables, as for
native_data_pack_files (a world’s first open and every /reload):
push the data map types your mod registers (NeoForge’s
RegisterDataMapTypesEvent). A type is an id (mod_id:name, not in
minecraft) for a registry, minecraft:item or minecraft:block
so far. Its values come from the world’s data packs’
data/<mod_id>/data_maps/<registry path>/<name>.json, and from files
you push through native_data_pack_files under the key
data_maps/<mod_id>:<registry path>/<name>: replace, values
(entry ids and #tags to JSON values) and remove, a newer value
overriding an older. Push a typed map’s DataMap::ty
and read its values with ItemKey::data and BlockKey::data. Server-side,
not synced to clients.
Side: server.
Every mod gets event.types in order and may add, change or remove types.
fn living_breathe(
&self,
context: &dyn LoopContext,
event: &mut LivingBreatheEvent<'_>,
)
fn living_breathe( &self, context: &dyn LoopContext, event: &mut LivingBreatheEvent<'_>, )
An entity’s breathing this tick (LivingBreatheEvent, posted from
LivingEntity.baseTick every tick for a living entity with the generic
air logic): entity is its ID and kind its type (minecraft:player,
minecraft:zombie). can_breathe, consume and refill come in as
Horizon does it today (a mod-free game changes nothing); set them to
change this tick. With can_breathe the air rises by refill, up to its
maximum (300); without, it falls by consume, and at -20 it is set to 0
and the entity takes 2 drowning damage. Negative amounts count as 0.
Asked on servers for players and for mobs, except those with a
WaterAnimal’s or an axolotl’s own air logic. It is given the loop context of the server that ticks the entity (its registries, settings and mod list), because it fires inside the tick’s own air update.
Side: server.
fn blocks(&self, context: &RegistrationContext, event: &mut BlocksEvent<'_>)
fn blocks(&self, context: &RegistrationContext, event: &mut BlocksEvent<'_>)
Blocks this mod adds, declared in code rather than one file each
(NeoForge’s DeferredRegister.Blocks drained by RegisterEvent):
push a mod_api::Block per block, the same declaration
a content mod’s data/<id>/horizon/block/<path>.json holds (a
vanilla template, properties, state_properties, shapes…),
with its id in a namespace owned by your mod’s manifest. item: true gives it a block
item, as a file does unless told not to (..Default::default()
leaves it false). They join the content mods’ blocks: the one whose
id is that namespace when it is on (your models, textures, loot and
recipes are its files), else one of their own, with the template’s
look. Ids, saves and the check that a joining client has the same
blocks are the files’ (docs/modding/src/how-to/content-mods.md). Asked once at start, on every
side, before any resource loads: push the same ones every time, from
nothing but your code. Unowned namespaces refuse registration, naming the mod
and namespace. Each mod receives its own declaration batch. Declarations
that don’t pass the other files’ checks
are logged and that namespace’s are left out.
Side: both.
Each mod receives its own empty event.blocks batch. Declared identifiers must
belong to that mod’s manifest-owned namespaces; unowned identifiers refuse registration.
fn items(&self, context: &RegistrationContext, event: &mut ItemsEvent<'_>)
fn items(&self, context: &RegistrationContext, event: &mut ItemsEvent<'_>)
Items this mod adds, declared in code (NeoForge’s
DeferredRegister.Items), as native_blocks declares blocks: a
mod_api::Item per item, a content mod’s
data/<id>/horizon/item/<path>.json (a vanilla template,
max_stack_size, rarity, components, crafting_remainder). A
block’s item comes with its block (item: true), not from here.
Each mod receives its own batch; IDs must use a namespace owned by its
manifest (bare paths use its mod ID). Unowned namespaces refuse registration.
Asked once at start, on every side.
Side: both.
Each mod receives its own empty event.items batch. Declared identifiers must
belong to that mod’s manifest-owned namespaces; unowned identifiers refuse registration.
fn entity_tick_pre(
&self,
host: &mut dyn ServerHost,
event: &mut EntityTickPreEvent<'_>,
) -> Flow
fn entity_tick_pre( &self, host: &mut dyn ServerHost, event: &mut EntityTickPreEvent<'_>, ) -> Flow
An entity of type kind (minecraft:zombie, minecraft:item) with ID entity is
about to tick in the server level dimension (NeoForge’s EntityTickEvent.Pre, posted
around Entity.commonTick and tick in ServerLevel.tickNonPassenger). Set canceled
and it does not tick this tick: a mob has no AI, physics or effects, an item no movement,
ageing or merging, a minecart or boat no motion, and native_entity_tick_post is not told.
Horizon ticks a family of entities together, so mobs and items hear every Pre before the
first of them ticks; minecarts and boats hear theirs one by one. Told for the mobs, item
entities, minecarts and boats that tick: those in an entity-ticking chunk, not a player’s
boat or cart (it ticks with the player). Check kind; this runs for every ticking entity
each tick, so keep it cheap. Server-side.
Side: server.
Return Flow::Cancel to take it: this sets canceled, and later mods are skipped unless they
listen with #[listener(receive_cancelled)]; those see event.cancelled and may set it back to
false.
fn entity_tick_post(
&self,
host: &mut dyn ServerHost,
event: &mut EntityTickPostEvent<'_>,
)
fn entity_tick_post( &self, host: &mut dyn ServerHost, event: &mut EntityTickPostEvent<'_>, )
The entity entity of type kind ticked in the server level dimension (NeoForge’s
EntityTickEvent.Post): for each entity native_entity_tick_pre let through, after it
ticked, also one that died or was removed in its tick. Mobs and items hear their Posts
once the whole family has ticked; minecarts and boats right after their own tick. Server-side.
Side: server.
fn entity_tick_listened(
&self,
host: &mut dyn ServerHost,
event: &mut EntityTickListenedEvent,
)
fn entity_tick_listened( &self, host: &mut dyn ServerHost, event: &mut EntityTickListenedEvent, )
Whether a mod listens to native_entity_tick_pre and native_entity_tick_post: a mod
that hooks them hooks this one too and sets listened (HEAD, *listened = true).
Without it the game tells no entity’s tick, and keeps no list of them. Asked once for
each family (mobs, items, minecarts, boats) each tick. Server-side.
Side: server.
Every mod gets event.listened in order and may add, change or remove listened.
fn living_equipment_change(
&self,
host: &mut dyn ServerHost,
event: &mut LivingEquipmentChangeEvent<'_>,
)
fn living_equipment_change( &self, host: &mut dyn ServerHost, event: &mut LivingEquipmentChangeEvent<'_>, )
A mob’s or an armor stand’s equipment slot took a different stack
(NeoForge’s LivingEquipmentChangeEvent, posted in
LivingEntity.collectEquipmentChanges): entity is its ID and kind
its type (minecraft:zombie), slot the EquipmentSlot (mainhand,
offhand, feet, legs, chest, head, body, saddle), from
what the slot held when this was last heard (none for empty) and to
what it holds now. Once for each slot that changed, in that order,
after the mobs’ tick, so a mob that joins the level wearing something
counts from empty on its first tick. It only hears: change the mob with
its own helpers. Players are heard by native_on_equip. Server-side.
Side: server.
fn living_equipment_listened(
&self,
host: &mut dyn ServerHost,
event: &mut LivingEquipmentListenedEvent,
)
fn living_equipment_listened( &self, host: &mut dyn ServerHost, event: &mut LivingEquipmentListenedEvent, )
Whether a mod listens to the mobs’ native_living_equipment_change: a
mod that hooks it hooks this one too and sets listened (HEAD,
*listened = true). Without it the game does not read every mob’s
equipment each tick, and mobs are not told (armor stands still are). A
mob that ticks once it is set counts from empty. Asked once a tick, after
the mobs’ tick. Server-side.
Side: server.
Every mod gets event.listened in order and may add, change or remove listened.
fn player_submit(
&self,
host: &dyn ClientHost,
event: &mut PlayerSubmitEvent<'_>,
) -> Flow
fn player_submit( &self, host: &dyn ClientHost, event: &mut PlayerSubmitEvent<'_>, ) -> Flow
Draw the player player (who: its profile name, and whether it is
this window’s own player) with a model of your own, once a frame while
it is in view (RenderPlayerEvent.Pre), and set drawn to leave out its
vanilla model, armour, held items, cape and the other layers. This
window’s player is drawn only in third person (and F5 front view); an
invisible player is not asked. draw is the frame of native_mob_submit:
at the player’s feet, turned with the body. The name tag, shadow,
flames and glowing outline draw as before. hidden.hide(part) (or
hidden.hide_named(name)) leaves only that part out of the vanilla model this frame (after Skin
Customization), as a mod drawing its own outer skin layer does: a
hidden part takes its children with it (the hat goes with the head),
while its armour, held items and other layers, the cape among them,
keep every part.
Side: client.
Return Flow::Cancel to take it: this sets drawn, and later mods are skipped unless they
listen with #[listener(receive_cancelled)]; those see event.cancelled and may set it back to
false.
fn mob_layer(&self, host: &dyn ClientHost, event: &mut MobLayerEvent<'_>)
fn mob_layer(&self, host: &dyn ClientHost, event: &mut MobLayerEvent<'_>)
A layer on every mob and player in view, once a frame after its
vanilla model and layers (EntityRenderersEvent.AddLayers, with
RenderLivingEvent.Post and RenderPlayerEvent.Post): add geometry
in the entity’s frame, which starts at its feet turned with the body
(mob.head_yaw, mob.pitch and the walk cycle place a part, the eyes
being at the entity type’s eye height). who is set for a player.
parts is a humanoid model’s parts as vanilla posed them this frame
(HumanoidModel.setupAnim), taken from the body’s own draw, so a part
native_player_submit hid reads as not visible; read-only: attach
geometry to an arm or the head without animating it again; None for a
model that isn’t humanoid. Not asked for what a mod drew itself (native_mob_submit,
native_player_submit) nor for a mob that isn’t drawn at all.
Side: client.
fn player_render_listened(
&self,
host: &dyn ClientHost,
event: &mut PlayerRenderListenedEvent,
)
fn player_render_listened( &self, host: &dyn ClientHost, event: &mut PlayerRenderListenedEvent, )
Whether a mod listens to native_player_submit or native_mob_layer: a
mod that hooks either hooks this one too and sets listened (HEAD,
*listened = true). Without it the game poses no player or mob for
them, each frame. Client-side.
Side: client.
Every mod gets event.listened in order and may add, change or remove listened.
fn sign_changed(
&self,
host: &mut dyn ServerHost,
event: &mut SignChangedEvent<'_>,
) -> Flow
fn sign_changed( &self, host: &mut dyn ServerHost, event: &mut SignChangedEvent<'_>, ) -> Flow
A player finished editing a sign: ServerGamePacketListenerImpl.updateSignText
has taken their update packet and every check has passed (they were
editing that sign, within reach, the sign is not waxed, the chat filter
let the text through), right before the lines go on the sign. pos in
dimension, the front or back side, and the four lines as written,
plain text with the formatting codes still in (vanilla strips them
afterwards). Rewrite lines (made four lines again) and that is what
the sign gets, without a second look from the chat filter, or set
cancel and the sign keeps its old text. With the player’s state
swapped in, so PlayerRef::tell and the helpers that act on the player
reach them. Once for each update a player sends on a server. Not told:
the host’s own editing of a sign on a LAN or single-player world
(the editor writes into their world directly), and the sign changes
that are no edit of the text (dyeing, glow ink, waxing, /data,
/setblock, mods’ native_with_mod_block_entity).
Side: server.
Return Flow::Cancel to take it: this sets cancel, and later mods are skipped unless they
listen with #[listener(receive_cancelled)]; those see event.cancelled and may set it back to
false.
fn standalone_models(
&self,
context: &RegistrationContext,
event: &mut StandaloneModelsEvent<'_>,
)
fn standalone_models( &self, context: &RegistrationContext, event: &mut StandaloneModelsEvent<'_>, )
Models no blockstate names that this client bakes beside the block
models (NeoForge’s ModelEvent.RegisterStandalone): push their ids
(mymod:block/shaft_half, the model at
assets/mymod/models/block/shaft_half.json). Parts a block entity or
a mob draws, with native_draw_model, so that no block is registered
only to bake its model. Asked once at start, before the resources
load; every resource load, a pack reload included, bakes them again
from that pack’s files. A model that doesn’t read is logged and left
out; an id without a namespace is dropped. Only the client asks it,
as NeoForge’s ModelEvent.RegisterStandalone is a client mod-bus event.
Side: client.
Every mod gets event.models in order and may add, change or remove models.
fn player_container_open(
&self,
host: &mut dyn ServerHost,
event: &mut PlayerContainerOpenEvent<'_>,
)
fn player_container_open( &self, host: &mut dyn ServerHost, event: &mut PlayerContainerOpenEvent<'_>, )
player (name) opened a menu (NeoForge’s PlayerContainerEvent.Open,
posted when ServerPlayer.openMenu sets the new containerMenu): any
menu, vanilla or a mod’s. menu is the menu type’s name
(minecraft:generic_9x3, minecraft:furnace, minecraft:merchant,
minecraft:crafting, minecraft:lectern, a mod’s own), pos the
block it is of in dimension (none for a trade, a vehicle’s, a mod’s
native menu or a mount’s inventory, which has no menu type in vanilla
and is told as horizon:mount_inventory). The player’s own inventory
is not one. Heard once a tick, so a menu opened and closed again
inside one tick is not; one that replaces another comes after that
one’s close. The player’s state is swapped in. native_player_container_close
follows. Server-side.
Side: server.
fn player_container_close(
&self,
host: &mut dyn ServerHost,
event: &mut PlayerContainerCloseEvent<'_>,
)
fn player_container_close( &self, host: &mut dyn ServerHost, event: &mut PlayerContainerCloseEvent<'_>, )
player (name) closed the menu native_player_container_open told
of (NeoForge’s PlayerContainerEvent.Close, posted in
ServerPlayer.doCloseContainer after the menu’s removed): they
closed it, walked out of reach, died, changed level, or another menu
opened. A player who leaves closes it before native_player_logged_out
(vanilla posts nothing for a disconnect; Horizon does, so each open has
its close). Once for each open; not told when the server stops. The
menu’s items are where it left them: the block’s, and the cursor stack
back in the inventory. State swapped in, when the player has a body.
Server-side.
Side: server.
fn player_toggle_flight(
&self,
host: &mut dyn ServerHost,
event: &mut PlayerToggleFlightEvent<'_>,
) -> Flow
fn player_toggle_flight( &self, host: &mut dyn ServerHost, event: &mut PlayerToggleFlightEvent<'_>, ) -> Flow
A player’s client started (flying) or stopped flying (vanilla’s
handlePlayerAbilities, which honours it only for a player who may
fly: creative or spectator), heard once for each change, on a server,
with the player’s state swapped in, so PlayerRef::tell and the other
helpers reach them. The player is already flying or not as asked, as
vanilla leaves them; set cancel to refuse it: they keep the state
they had and the server sends their abilities back, as vanilla does
for what it refuses, so the client lands or flies again. Only what a
client asks for is heard: not the flight a game-mode change starts or
ends (/gamemode), and not a LAN host’s own player.
Side: server.
Return Flow::Cancel to take it: this sets cancel, and later mods are skipped unless they
listen with #[listener(receive_cancelled)]; those see event.cancelled and may set it back to
false.
fn anvil_damaged(
&self,
host: &mut dyn ServerHost,
event: &mut AnvilDamagedEvent<'_>,
)
fn anvil_damaged( &self, host: &mut dyn ServerHost, event: &mut AnvilDamagedEvent<'_>, )
An anvil at pos took damage, changing its block from from to to.
to is air when the anvil broke. Server-side.
Side: server.
fn arrow_loose(
&self,
host: &mut dyn ServerHost,
event: &mut ArrowLooseEvent<'_>,
) -> Flow
fn arrow_loose( &self, host: &mut dyn ServerHost, event: &mut ArrowLooseEvent<'_>, ) -> Flow
NeoForge’s ArrowLooseEvent: the player releases a bow stack with
has_ammo and charge ticks held. Change charge or set canceled
to prevent the shot; negative charge also prevents it. Unlike
native_living_entity_use_item_stop, this does not skip the whole item
release; native_entity_shoot_bow reports a spawned arrow afterward
with read-only force. Fires on the Game running the bow release, including
LAN guests; a remote client’s own release path is not covered. Crossbows
are not covered; native_arrow_nock is the bow’s start.
Side: server.
Return Flow::Cancel to take it: this sets canceled, and later mods are skipped unless they
listen with #[listener(receive_cancelled)]; those see event.cancelled and may set it back to
false.
fn beacon_state_change(
&self,
host: &mut dyn ServerHost,
event: &mut BeaconStateChangeEvent<'_>,
)
fn beacon_state_change( &self, host: &mut dyn ServerHost, event: &mut BeaconStateChangeEvent<'_>, )
A beacon at pos activated or deactivated after its beam was checked.
active says whether it now has a complete pyramid. Server-side.
Side: server.
fn bell_ring(&self, level: &dyn LevelHost, event: &mut BellRingEvent) -> Flow
fn bell_ring(&self, level: &dyn LevelHost, event: &mut BellRingEvent) -> Flow
On an authoritative server, a bell at pos is about to ring. Set
cancel to stop the ring and its raider reveal.
Side: server.
Return Flow::Cancel to take it: this sets cancel, and later mods are skipped unless they
listen with #[listener(receive_cancelled)]; those see event.cancelled and may set it back to
false.
fn block_break_progress_update(
&self,
host: &mut dyn ServerHost,
event: &mut BlockBreakProgressUpdateEvent<'_>,
)
fn block_break_progress_update( &self, host: &mut dyn ServerHost, event: &mut BlockBreakProgressUpdateEvent<'_>, )
A server guest’s block-breaking animation changed to progress at
pos (0 through 9).
Side: server.
fn block_burn(&self, level: &dyn LevelHost, event: &mut BlockBurnEvent) -> Flow
fn block_burn(&self, level: &dyn LevelHost, event: &mut BlockBurnEvent) -> Flow
On an authoritative server, fire is about to burn the block at pos
away. Set cancel to keep that block.
Side: server.
Return Flow::Cancel to take it: this sets cancel, and later mods are skipped unless they
listen with #[listener(receive_cancelled)]; those see event.cancelled and may set it back to
false.
fn block_cook(&self, host: &mut dyn ServerHost, event: &mut BlockCookEvent<'_>)
fn block_cook(&self, host: &mut dyn ServerHost, event: &mut BlockCookEvent<'_>)
A block finished cooking item into result at pos.
Side: server.
fn block_damage_abort(
&self,
host: &mut dyn ServerHost,
event: &mut BlockDamageAbortEvent<'_>,
)
fn block_damage_abort( &self, host: &mut dyn ServerHost, event: &mut BlockDamageAbortEvent<'_>, )
A server player stopped digging pos before the block broke, after
the server cleared the dig and sent the block back to the client.
The player’s state is not swapped in.
Side: server.
fn block_dispense_armor(
&self,
host: &mut dyn ServerHost,
event: &mut BlockDispenseArmorEvent<'_>,
)
fn block_dispense_armor( &self, host: &mut dyn ServerHost, event: &mut BlockDispenseArmorEvent<'_>, )
A dispenser equipped item on the first eligible target in front
of its block at pos. target is player, mob or armor_stand.
The equip, item consumption, sound and game event have completed.
Server-side.
Side: server.
fn block_fade(&self, level: &dyn LevelHost, event: &mut BlockFadeEvent) -> Flow
fn block_fade(&self, level: &dyn LevelHost, event: &mut BlockFadeEvent) -> Flow
A block at pos is about to fade from from to to because of
melting or coral death. Set cancel to keep it. Server-side.
Side: server.
Return Flow::Cancel to take it: this sets cancel, and later mods are skipped unless they
listen with #[listener(receive_cancelled)]; those see event.cancelled and may set it back to
false.
fn block_failed_dispense(
&self,
host: &mut dyn ServerHost,
event: &mut BlockFailedDispenseEvent<'_>,
)
fn block_failed_dispense( &self, host: &mut dyn ServerHost, event: &mut BlockFailedDispenseEvent<'_>, )
A dispenser at pos failed to dispense item. Server-side.
Side: server.
fn block_form(&self, level: &dyn LevelHost, event: &mut BlockFormEvent) -> Flow
fn block_form(&self, level: &dyn LevelHost, event: &mut BlockFormEvent) -> Flow
Precipitation is about to form ice or place or thicken snow at pos.
from and to are block state IDs. Set cancel to keep the old state.
Server-side.
Side: server.
Return Flow::Cancel to take it: this sets cancel, and later mods are skipped unless they
listen with #[listener(receive_cancelled)]; those see event.cancelled and may set it back to
false.
fn block_ignite(
&self,
level: &dyn LevelHost,
event: &mut BlockIgniteEvent<'_>,
) -> Flow
fn block_ignite( &self, level: &dyn LevelHost, event: &mut BlockIgniteEvent<'_>, ) -> Flow
On an authoritative server, fire is about to be placed at pos by
flint and steel, a fire charge, lava, lightning or fire spread. Set
player is the acting server player when there is one. Set cancel to
leave the position unchanged.
Side: server.
Return Flow::Cancel to take it: this sets cancel, and later mods are skipped unless they
listen with #[listener(receive_cancelled)]; those see event.cancelled and may set it back to
false.
fn block_lock_check(
&self,
host: &mut dyn ServerHost,
event: &mut BlockLockCheckEvent<'_>,
) -> Flow
fn block_lock_check( &self, host: &mut dyn ServerHost, event: &mut BlockLockCheckEvent<'_>, ) -> Flow
A guest’s block inventory lock check at pos. locked is the
vanilla result and may be changed. The guest’s state is not swapped in.
Side: server.
Return Flow::Cancel to take it: this sets locked, and later mods are skipped unless they
listen with #[listener(receive_cancelled)]; those see event.cancelled and may set it back to
false.
fn block_receive_game(
&self,
host: &mut dyn ServerHost,
event_: &mut BlockReceiveGameEvent<'_>,
) -> Flow
fn block_receive_game( &self, host: &mut dyn ServerHost, event_: &mut BlockReceiveGameEvent<'_>, ) -> Flow
A sculk sensor or shrieker received a vibration for event at pos.
Set cancel to suppress its response. Server-side.
Side: server.
Return Flow::Cancel to take it: this sets cancel, and later mods are skipped unless they
listen with #[listener(receive_cancelled)]; those see event_.cancelled and may set it back to
false.
fn block_shear_entity(
&self,
host: &mut dyn ServerHost,
event: &mut BlockShearEntityEvent<'_>,
)
fn block_shear_entity( &self, host: &mut dyn ServerHost, event: &mut BlockShearEntityEvent<'_>, )
A dispenser sheared entity of kind kind at the block in front of
its own block at pos, after the shearing effects. Server-side.
Side: server.
fn brewing_complete(
&self,
host: &mut dyn ServerHost,
event: &mut BrewingCompleteEvent,
)
fn brewing_complete( &self, host: &mut dyn ServerHost, event: &mut BrewingCompleteEvent, )
A brewing stand finished brewing at pos, after its bottle contents
were changed. Server-side.
Side: server.
fn brewing_fuel(
&self,
host: &mut dyn ServerHost,
event: &mut BrewingFuelEvent<'_>,
)
fn brewing_fuel( &self, host: &mut dyn ServerHost, event: &mut BrewingFuelEvent<'_>, )
A brewing stand at pos consumed fuel and gained brewing fuel. Server-side.
Side: server.
fn brewing_start(
&self,
host: &mut dyn ServerHost,
event: &mut BrewingStartEvent<'_>,
)
fn brewing_start( &self, host: &mut dyn ServerHost, event: &mut BrewingStartEvent<'_>, )
A brewing stand at pos began brewing ingredient, after fuel and the timer were set. Server-side.
Side: server.
fn broadcast_message(
&self,
host: &dyn Host,
event: &mut BroadcastMessageEvent<'_>,
) -> Flow
fn broadcast_message( &self, host: &dyn Host, event: &mut BroadcastMessageEvent<'_>, ) -> Flow
A server broadcast line is about to be logged and sent. Change line
or set cancel to drop it.
Side: server.
Return Flow::Cancel to take it: this sets cancel, and later mods are skipped unless they
listen with #[listener(receive_cancelled)]; those see event.cancelled and may set it back to
false.
fn campfire_start(
&self,
host: &mut dyn ServerHost,
event: &mut CampfireStartEvent<'_>,
)
fn campfire_start( &self, host: &mut dyn ServerHost, event: &mut CampfireStartEvent<'_>, )
An item was placed on a campfire at pos and began cooking.
Side: server.
fn cauldron_level_changed(
&self,
level: &dyn LevelHost,
event: &mut CauldronLevelChangedEvent<'_>,
) -> Flow
fn cauldron_level_changed( &self, level: &dyn LevelHost, event: &mut CauldronLevelChangedEvent<'_>, ) -> Flow
On an authoritative server, a cauldron at pos is about to change
fill level from from_level to to_level for reason. Set cancel
to leave it unchanged.
Side: server.
Return Flow::Cancel to take it: this sets cancel, and later mods are skipped unless they
listen with #[listener(receive_cancelled)]; those see event.cancelled and may set it back to
false.
fn item_consumption_teleport(
&self,
host: &mut dyn ServerHost,
event: &mut ItemConsumptionTeleportEvent<'_>,
) -> Flow
fn item_consumption_teleport( &self, host: &mut dyn ServerHost, event: &mut ItemConsumptionTeleportEvent<'_>, ) -> Flow
A server player or fox that ate chorus fruit (or another item with the
teleport_randomly consume effect) is about to try a random spot
(NeoForge’s EntityTeleportEvent.ItemConsumption, vanilla’s
TeleportRandomlyConsumeEffect.apply): once per attempt (up to 16),
after they stopped riding. from is their feet, target the spot
drawn; a mod may move it (its y kept inside the level’s height, a
value that is not a number ignored), and the game still looks down
from it for ground it may land on. Canceling ends the effect: no teleport and no
more attempts. consumer names the living actor through its handle.
consumed is the stack captured before consumption, including
its count and components; it is not reread from the hand after listener writes.
A player’s state is swapped in (host.players().acting_player()). A fox’s
callback has the full server host before its living AI/movement step and
before the next mob ticks. Listener writes survive; changing the consumer’s
item, position or eligibility refuses the captured effect instead of
overwriting that write. Cancellation still finishes consumption.
Diverges from upstream: renamed from
chorus_fruit_teleport.
Side: server.
Return Flow::Cancel to take it: this sets cancel, and later mods are skipped unless they
listen with #[listener(receive_cancelled)]; those see event.cancelled and may set it back to
false.
fn compost_item(
&self,
host: &mut dyn ServerHost,
event: &mut CompostItemEvent<'_>,
)
fn compost_item( &self, host: &mut dyn ServerHost, event: &mut CompostItemEvent<'_>, )
A player added a compostable item to the composter at pos.
Side: server.
fn crafter_craft(
&self,
host: &mut dyn ServerHost,
event: &mut CrafterCraftEvent<'_>,
)
fn crafter_craft( &self, host: &mut dyn ServerHost, event: &mut CrafterCraftEvent<'_>, )
A crafter at pos completed recipe recipe.
Side: server.
fn creeper_ignite(
&self,
host: &mut dyn ServerHost,
event: &mut CreeperIgniteEvent<'_>,
)
fn creeper_ignite( &self, host: &mut dyn ServerHost, event: &mut CreeperIgniteEvent<'_>, )
A player ignited a creeper with an item. Side: server.
fn creeper_power(
&self,
host: &mut dyn ServerHost,
event: &mut CreeperPowerEvent,
)
fn creeper_power( &self, host: &mut dyn ServerHost, event: &mut CreeperPowerEvent, )
Lightning charged a creeper. Side: server.
fn critical_hit(
&self,
host: &mut dyn ServerHost,
event: &mut CriticalHitEvent<'_>,
)
fn critical_hit( &self, host: &mut dyn ServerHost, event: &mut CriticalHitEvent<'_>, )
NeoForge’s CriticalHitEvent: a player’s melee hit on a living
target_kind (minecraft:zombie, minecraft:armor_stand) that deals
damage, where Player.attack decides whether it is critical.
vanilla_critical is vanilla’s answer; critical starts as it and may
be forced or denied (as in vanilla a critical hit prevents the sweep, so
a forced crit loses it; a denied crit loses the crit sound and
particles); damage_multiplier starts at 1.5 for vanilla’s critical and
1.0 otherwise, and scales the damage only while critical ends true. Not fired for a
target that is no living entity (a dragon part) or when the hit does
no damage. Fires on the Game that runs the attack.
Side: server.
fn difficulty_changed(
&self,
host: &mut dyn ServerHost,
event: &mut DifficultyChangedEvent<'_>,
)
fn difficulty_changed( &self, host: &mut dyn ServerHost, event: &mut DifficultyChangedEvent<'_>, )
The server’s difficulty changed, from from to to (peaceful,
easy, normal, hard; NeoForge’s DifficultyChangeEvent). It is
vanilla’s MinecraftServer.setDifficulty, which /difficulty, a
dedicated server’s management and a test environment’s difficulty all
go through, and it is told only when the difficulty is another one. It
only hears: the change has already happened. Server-side.
Side: server.
fn dragon_egg_form(
&self,
level: &dyn LevelHost,
event: &mut DragonEggFormEvent,
) -> Flow
fn dragon_egg_form( &self, level: &dyn LevelHost, event: &mut DragonEggFormEvent, ) -> Flow
The Ender Dragon fight is about to place its first dragon egg at pos.
Set cancel to leave the block unchanged. Server-side.
Side: server.
Return Flow::Cancel to take it: this sets cancel, and later mods are skipped unless they
listen with #[listener(receive_cancelled)]; those see event.cancelled and may set it back to
false.
fn enchant_item(
&self,
host: &mut dyn ServerHost,
event: &mut EnchantItemEvent<'_>,
)
fn enchant_item( &self, host: &mut dyn ServerHost, event: &mut EnchantItemEvent<'_>, )
A server player applied an enchantment at pos; item is the finished item and levels the levels charged. The player’s state is not swapped in.
Side: server.
fn ender_pearl_teleport(
&self,
host: &mut dyn ServerHost,
event: &mut EnderPearlTeleportEvent<'_>,
) -> Flow
fn ender_pearl_teleport( &self, host: &mut dyn ServerHost, event: &mut EnderPearlTeleportEvent<'_>, ) -> Flow
A server player’s or mob’s ender pearl is about to teleport its owner
(EntityTeleportEvent.EnderPearl, ThrownEnderpearl.onHit). owner is
the live entity handle, pearl its projectile id, from the owner’s feet
and target the pearl’s previous position. A mod may move the target;
non-finite changes keep the original spot. Canceling leaves the owner
in place with no teleport sound, damage or endermite roll; the pearl is
used up. Player owners keep their acting-player context and mutable fall
damage (5; nonpositive causes no health loss, but zero remains a hit
attempt that asks the invulnerability predicate). Mob owners take no fall damage and
make no endermite draw; their damage starts at zero and is player-only.
An owner moved, removed, killed or put to sleep by a listener is not moved
again using the old decision. The impact hook still hears the hit.
Side: server.
Return Flow::Cancel to take it: this sets cancel, and later mods are skipped unless they
listen with #[listener(receive_cancelled)]; those see event.cancelled and may set it back to
false.
fn entities_load(
&self,
host: &mut dyn ServerHost,
event: &mut EntitiesLoadEvent<'_>,
)
fn entities_load( &self, host: &mut dyn ServerHost, event: &mut EntitiesLoadEvent<'_>, )
Entities from chunk finished loading into the server world. count
is the number of saved entity records read.
Side: server.
fn entities_unload(
&self,
host: &mut dyn ServerHost,
event: &mut EntitiesUnloadEvent<'_>,
)
fn entities_unload( &self, host: &mut dyn ServerHost, event: &mut EntitiesUnloadEvent<'_>, )
Entities in chunk left the active server world and were queued for
saving. count is the number of entity records.
Side: server.
fn entity_break_door(
&self,
host: &mut dyn ServerHost,
event: &mut EntityBreakDoorEvent<'_>,
)
fn entity_break_door( &self, host: &mut dyn ServerHost, event: &mut EntityBreakDoorEvent<'_>, )
A mob broke the door at pos.
Side: server.
fn entity_breed(&self, host: &mut dyn ServerHost, event: &mut EntityBreedEvent)
fn entity_breed(&self, host: &mut dyn ServerHost, event: &mut EntityBreedEvent)
Two mobs completed a breeding action. child is absent when vanilla
lays an egg instead of creating a baby.
Side: server.
fn entity_change_block(
&self,
host: &mut dyn ServerHost,
event: &mut EntityChangeBlockEvent<'_>,
)
fn entity_change_block( &self, host: &mut dyn ServerHost, event: &mut EntityChangeBlockEvent<'_>, )
A mob changed a block at pos, after the new state was applied.
Side: server.
fn entity_drop_item(
&self,
host: &mut dyn ServerHost,
event: &mut EntityDropItemEvent<'_>,
)
fn entity_drop_item( &self, host: &mut dyn ServerHost, event: &mut EntityDropItemEvent<'_>, )
A mob is about to drop count of item at pos (Bukkit’s
EntityDropItemEvent).
Side: server.
fn entity_enter_block(
&self,
host: &mut dyn ServerHost,
event: &mut EntityEnterBlockEvent<'_>,
)
fn entity_enter_block( &self, host: &mut dyn ServerHost, event: &mut EntityEnterBlockEvent<'_>, )
A bee entered the hive at pos and was stored there.
Side: server.
fn entity_enter_love_mode(
&self,
host: &mut dyn ServerHost,
event: &mut EntityEnterLoveModeEvent<'_>,
)
fn entity_enter_love_mode( &self, host: &mut dyn ServerHost, event: &mut EntityEnterLoveModeEvent<'_>, )
A mob entered love mode after player interaction. player is the
feeder when known.
Side: server.
fn entity_portal(
&self,
host: &mut dyn ServerHost,
event: &mut EntityPortalEvent<'_>,
)
fn entity_portal( &self, host: &mut dyn ServerHost, event: &mut EntityPortalEvent<'_>, )
A server entity finished its portal wait and is beginning to leave
dimension through pos. The destination follows the portal rules.
Side: server.
fn entity_pose_change(
&self,
host: &mut dyn ServerHost,
event: &mut EntityPoseChangeEvent<'_>,
)
fn entity_pose_change( &self, host: &mut dyn ServerHost, event: &mut EntityPoseChangeEvent<'_>, )
A guest player’s synchronized pose changed from from to to.
Side: server.
fn entity_shoot_bow(
&self,
host: &mut dyn ServerHost,
event: &mut EntityShootBowEvent<'_>,
)
fn entity_shoot_bow( &self, host: &mut dyn ServerHost, event: &mut EntityShootBowEvent<'_>, )
A player bow or crossbow launched an arrow with force, after the
projectile entered the level.
Side: server.
fn entity_tame(
&self,
host: &mut dyn ServerHost,
event: &mut EntityTameEvent<'_>,
)
fn entity_tame( &self, host: &mut dyn ServerHost, event: &mut EntityTameEvent<'_>, )
A mob became tamed after its owner and persistent state were set. Side: server.
fn entity_teleport(
&self,
host: &mut dyn ServerHost,
event: &mut EntityTeleportEvent<'_>,
)
fn entity_teleport( &self, host: &mut dyn ServerHost, event: &mut EntityTeleportEvent<'_>, )
A server entity was moved by a same-level teleport command, after its
position changed. entity is its network id; from and to are
coordinates in dimension. This hook reports command teleports that
use Horizon’s same-level target path; it does not change vanilla’s
movement.
Side: server.
fn entity_toggle_glide(
&self,
host: &mut dyn ServerHost,
event: &mut EntityToggleGlideEvent<'_>,
)
fn entity_toggle_glide( &self, host: &mut dyn ServerHost, event: &mut EntityToggleGlideEvent<'_>, )
A guest’s fall flying state changed on the server. The change has already been applied. Side: server.
fn entity_unleash(
&self,
host: &mut dyn ServerHost,
event: &mut EntityUnleashEvent<'_>,
)
fn entity_unleash( &self, host: &mut dyn ServerHost, event: &mut EntityUnleashEvent<'_>, )
A leashed mob’s leash was removed, before any lead drop is handled
(Bukkit’s EntityUnleashEvent).
Side: server.
fn exp_bottle(&self, host: &mut dyn ServerHost, event: &mut ExpBottleEvent)
fn exp_bottle(&self, host: &mut dyn ServerHost, event: &mut ExpBottleEvent)
An experience bottle broke and its experience was awarded. Side: server.
fn pickup_xp(
&self,
host: &mut dyn ServerHost,
event: &mut PickupXpEvent<'_>,
) -> Flow
fn pickup_xp( &self, host: &mut dyn ServerHost, event: &mut PickupXpEvent<'_>, ) -> Flow
Before player picks up orb orb in dimension. Mutations to value
and count take effect only when not canceled; value is clamped to
1..=i32::MAX and count to at least one.
Canceling leaves the orb and pickup delay unchanged. Server-side. Diverges from upstream: renamed from experience_orb_pickup, to NeoForge’s PlayerXpEvent.PickupXp.
Side: server.
Return Flow::Cancel to take it: this sets canceled, and later mods are skipped unless they
listen with #[listener(receive_cancelled)]; those see event.cancelled and may set it back to
false.
fn mending_repair(
&self,
host: &mut dyn ServerHost,
event: &mut MendingRepairEvent<'_>,
)
fn mending_repair( &self, host: &mut dyn ServerHost, event: &mut MendingRepairEvent<'_>, )
The selected damaged Mending stack and the proposed durability repair
for experience points. The amount is clamped to the stack’s current damage. Zero leaves the
experience unspent when it overrides a positive proposal. If the selected
stack changes, the repair is skipped.
Server-side, including PlayerRef::give_experience_points.
Side: server.
fn explosion_prime(
&self,
host: &mut dyn ServerHost,
event: &mut ExplosionPrimeEvent,
)
fn explosion_prime( &self, host: &mut dyn ServerHost, event: &mut ExplosionPrimeEvent, )
A server explosion is about to begin at center, with radius (Bukkit’s
ExplosionPrimeEvent). This is listen-only: the explosion proceeds as
usual. Server-side, including the single-player server.
Side: server.
fn firework_explode(
&self,
host: &mut dyn ServerHost,
event: &mut FireworkExplodeEvent,
)
fn firework_explode( &self, host: &mut dyn ServerHost, event: &mut FireworkExplodeEvent, )
A firework rocket completed its explosion effects. Side: server.
fn fluid_level_change(
&self,
level: &dyn LevelHost,
event: &mut FluidLevelChangeEvent<'_>,
) -> Flow
fn fluid_level_change( &self, level: &dyn LevelHost, event: &mut FluidLevelChangeEvent<'_>, ) -> Flow
A flowing fluid at pos is about to change level. fluid is water
or lava; the levels are 0 through 8. Set cancel to keep the old
level. Server-side.
Side: server.
Return Flow::Cancel to take it: this sets cancel, and later mods are skipped unless they
listen with #[listener(receive_cancelled)]; those see event.cancelled and may set it back to
false.
fn framerate_limit(
&self,
host: &dyn ClientHost,
event: &mut FramerateLimitEvent,
)
fn framerate_limit( &self, host: &dyn ClientHost, event: &mut FramerateLimitEvent, )
The frame rate this window is about to be held to: Max Framerate after the
inactivity throttle and Battery Mode (260 is unlimited). focused is whether the
window has focus, minimized whether it is minimised and in_world whether a world
is open. A mod may lower limit, as Dynamic FPS does for a window in the background:
Horizon keeps the lower of its own limit and the mod’s, and ignores values below 1.
Side: client.
fn furnace_burn(
&self,
host: &mut dyn ServerHost,
event: &mut FurnaceBurnEvent<'_>,
)
fn furnace_burn( &self, host: &mut dyn ServerHost, event: &mut FurnaceBurnEvent<'_>, )
A furnace at pos consumed fuel and began or resumed burning it.
fuel is the item consumed from its fuel slot. Server-side.
Side: server.
fn furnace_extract(
&self,
host: &mut dyn ServerHost,
event: &mut FurnaceExtractEvent<'_>,
)
fn furnace_extract( &self, host: &mut dyn ServerHost, event: &mut FurnaceExtractEvent<'_>, )
A server player took an output from a furnace at pos; item is the output item id and
count is how many were taken. The player’s state is not swapped in.
Side: server.
fn furnace_smelt(
&self,
host: &mut dyn ServerHost,
event: &mut FurnaceSmeltEvent<'_>,
)
fn furnace_smelt( &self, host: &mut dyn ServerHost, event: &mut FurnaceSmeltEvent<'_>, )
A furnace finished smelting item into result at pos. Server-side.
Side: server.
fn furnace_start_smelt(
&self,
host: &mut dyn ServerHost,
event: &mut FurnaceStartSmeltEvent<'_>,
)
fn furnace_start_smelt( &self, host: &mut dyn ServerHost, event: &mut FurnaceStartSmeltEvent<'_>, )
A furnace at pos began cooking item (its cooking timer advanced
from zero). Server-side.
Side: server.
fn hopper_inventory_search(
&self,
host: &mut dyn ServerHost,
event: &mut HopperInventorySearchEvent,
)
fn hopper_inventory_search( &self, host: &mut dyn ServerHost, event: &mut HopperInventorySearchEvent, )
A hopper selected a container while searching for items to push or
pull. Exactly one of container and entity identifies the target.
Side: server.
fn hopper_pickup_item(
&self,
level: &dyn LevelHost,
event: &mut HopperPickupItemEvent<'_>,
) -> Flow
fn hopper_pickup_item( &self, level: &dyn LevelHost, event: &mut HopperPickupItemEvent<'_>, ) -> Flow
A hopper at pos is about to pick up count of item. Set cancel to leave the dropped stack in the world. Server-side.
Side: server.
Return Flow::Cancel to take it: this sets cancel, and later mods are skipped unless they
listen with #[listener(receive_cancelled)]; those see event.cancelled and may set it back to
false.
fn ingredient(
&self,
context: &dyn DataLoadContext,
event: &mut IngredientEvent<'_>,
)
fn ingredient( &self, context: &dyn DataLoadContext, event: &mut IngredientEvent<'_>, )
A recipe ingredient of a mod’s own kind: the entry named a type in a
namespace outside minecraft:, and the loader kept it for this call.
The kind and the converted NBT compound the file wrote are here; fill items with the
item ids the ingredient matches (item ids only: components are not
checked here; a match-time hook follows separately). Duplicates are
removed keeping first-seen order. The hook is called once per
occurrence of the kind (nested inside a compound, intersection or
difference too, and under any slot a recipe reads an ingredient from) in
each load, before the load’s tables parse the recipes, with the
DataLoadContext of that owning load: the client’s own recipe load has
origin() ClientPreload, the server’s has ServerDataLoad. A server
loads its recipes once, however many tables and copies read them (its
recipe tables, the stations and the copy synchronised to guests, on a
dedicated server too), and a /reload asks again once; a client that
only joins a remote server is never told ServerDataLoad. The answer
must be the same every time. An
unclaimed kind leaves the list empty and the recipe fails, as an unknown
kind does.
Side: both.
Every mod gets event.items in order and may add, change or remove items.
fn inventory_block_start(
&self,
host: &mut dyn ServerHost,
event: &mut InventoryBlockStartEvent<'_>,
) -> Flow
fn inventory_block_start( &self, host: &mut dyn ServerHost, event: &mut InventoryBlockStartEvent<'_>, ) -> Flow
A server player is about to open an inventory supplied by a block at
pos. Set cancel to leave the inventory closed. The player’s state
is not swapped in.
Side: server.
Return Flow::Cancel to take it: this sets cancel, and later mods are skipped unless they
listen with #[listener(receive_cancelled)]; those see event.cancelled and may set it back to
false.
fn inventory_move_item(
&self,
host: &dyn Host,
event: &mut InventoryMoveItemEvent<'_>,
) -> Flow
fn inventory_move_item( &self, host: &dyn Host, event: &mut InventoryMoveItemEvent<'_>, ) -> Flow
A hopper is about to move one item between containers, a composter’s
bone meal included. Set cancel to leave it in its source slot. A chest
boat or minecart is reported at the block it is in.
Side: server.
Return Flow::Cancel to take it: this sets cancel, and later mods are skipped unless they
listen with #[listener(receive_cancelled)]; those see event.cancelled and may set it back to
false.
fn item_crafted(
&self,
host: &mut dyn ServerHost,
event: &mut ItemCraftedEvent<'_>,
)
fn item_crafted( &self, host: &mut dyn ServerHost, event: &mut ItemCraftedEvent<'_>, )
A player took a crafting grid’s result (ResultSlot.onTake, NeoForge’s
PlayerEvent.ItemCraftedEvent): player is the player’s uuid, recipe
the recipe the grid matched (minecraft:oak_planks) and stack the
result it took, with its components. It only hears: the take has
already happened. It fires for the crafting grid of an inventory or a
crafting table, on the integrated server and a dedicated server, guests
included, and not for a stonecutter’s, a smithing table’s or a
furnace’s result. Server-side.
Side: server.
fn item_despawn(
&self,
host: &mut dyn ServerHost,
event: &mut ItemDespawnEvent<'_>,
)
fn item_despawn( &self, host: &mut dyn ServerHost, event: &mut ItemDespawnEvent<'_>, )
A dropped item entity reached its 6000-tick lifetime and is about to be
removed (Bukkit’s ItemDespawnEvent).
Side: server.
fn item_expire(
&self,
host: &mut dyn ServerHost,
event: &mut ItemExpireEvent<'_>,
)
fn item_expire( &self, host: &mut dyn ServerHost, event: &mut ItemExpireEvent<'_>, )
A dropped item reaches its lifetime on the server (ItemEntity.tick,
NeoForge’s ItemExpireEvent). Every mod may set or add to extra_life,
in ticks, which starts at zero; a positive total keeps the item that much
longer, zero or less lets it expire. Extensions are capped at 32766
ticks.
Side: server.
fn item_spawn(&self, host: &mut dyn ServerHost, event: &mut ItemSpawnEvent<'_>)
fn item_spawn(&self, host: &mut dyn ServerHost, event: &mut ItemSpawnEvent<'_>)
A dropped item entity was successfully added to the server level. Side: server.
fn leaves_decay(
&self,
level: &dyn LevelHost,
event: &mut LeavesDecayEvent,
) -> Flow
fn leaves_decay( &self, level: &dyn LevelHost, event: &mut LeavesDecayEvent, ) -> Flow
A non-persistent leaf block at distance 7 is about to decay at pos.
Set cancel to keep it. Server-side.
Side: server.
Return Flow::Cancel to take it: this sets cancel, and later mods are skipped unless they
listen with #[listener(receive_cancelled)]; those see event.cancelled and may set it back to
false.
fn lightning_strike(
&self,
host: &mut dyn ServerHost,
event: &mut LightningStrikeEvent<'_>,
) -> Flow
fn lightning_strike( &self, host: &mut dyn ServerHost, event: &mut LightningStrikeEvent<'_>, ) -> Flow
A server lightning bolt is about to be created. cause is weather,
trident, command or mod (a native mod’s strike_lightning); player is the responsible player when known.
Set cancel to prevent the bolt and its effects.
Side: server.
Return Flow::Cancel to take it: this sets cancel, and later mods are skipped unless they
listen with #[listener(receive_cancelled)]; those see event.cancelled and may set it back to
false.
fn moisture_change(
&self,
level: &dyn LevelHost,
event: &mut MoistureChangeEvent,
) -> Flow
fn moisture_change( &self, level: &dyn LevelHost, event: &mut MoistureChangeEvent, ) -> Flow
Farmland at pos is about to change moisture from from to to.
Set cancel to keep its old moisture. Server-side.
Side: server.
Return Flow::Cancel to take it: this sets cancel, and later mods are skipped unless they
listen with #[listener(receive_cancelled)]; those see event.cancelled and may set it back to
false.
fn anvil_craft_post(
&self,
host: &mut dyn ServerHost,
event: &mut AnvilCraftPostEvent<'_>,
)
fn anvil_craft_post( &self, host: &mut dyn ServerHost, event: &mut AnvilCraftPostEvent<'_>, )
A player took an anvil’s result at pos and the levels, inputs and anvil wear are done (AnvilCraftEvent.Post); a broken anvil is already air. craft holds the inputs and the result as they were before. Not called when native_anvil_craft_pre cancelled.
Side: server.
fn anvil_craft_pre(
&self,
host: &mut dyn ServerHost,
event: &mut AnvilCraftPreEvent<'_>,
) -> Flow
fn anvil_craft_pre( &self, host: &mut dyn ServerHost, event: &mut AnvilCraftPreEvent<'_>, ) -> Flow
A player took an anvil’s result at pos (AnvilCraftEvent.Pre), before the levels are charged, the inputs used up and the anvil worn. craft holds the inputs and the result as they were before. Set cancel to refuse the take: the result stays in its slot and the inputs, levels, inventory and cursor are as before the click.
Side: server.
Return Flow::Cancel to take it: this sets cancel, and later mods are skipped unless they
listen with #[listener(receive_cancelled)]; those see event.cancelled and may set it back to
false.
fn armor_stand_manipulate(
&self,
host: &mut dyn ServerHost,
event: &mut ArmorStandManipulateEvent<'_>,
) -> Flow
fn armor_stand_manipulate( &self, host: &mut dyn ServerHost, event: &mut ArmorStandManipulateEvent<'_>, ) -> Flow
A player takes an item from an armor stand or puts one on it
(ArmorStand.interactAt, after the stand’s disabled-slot checks and
swapItem’s take/put locks, before anything moves): stand_id is the
stand’s Entity.getId and slot the one the click reached
(mainhand, offhand, feet, legs, chest or head). Set
cancel and nothing changes: neither the stand nor the player’s hand,
and the click is spent. The player’s state is swapped in for the call;
player is the UUID the helpers take. Not told of a click that changes
nothing (an empty hand on an empty slot). Not covered, other ways a
stand’s equipment moves: breaking or blasting the stand (its items
drop), a dispenser putting armour on one, a mod’s own changes.
Server-side, for every player of the world.
Side: server.
Return Flow::Cancel to take it: this sets cancel, and later mods are skipped unless they
listen with #[listener(receive_cancelled)]; those see event.cancelled and may set it back to
false.
fn bucket_empty(
&self,
host: &mut dyn ServerHost,
event: &mut BucketEmptyEvent<'_>,
) -> Flow
fn bucket_empty( &self, host: &mut dyn ServerHost, event: &mut BucketEmptyEvent<'_>, ) -> Flow
A server player empties a bucket at pos (fluid: minecraft:water,
minecraft:lava, minecraft:powder_snow; a fish or axolotl bucket
empties minecraft:water): where BucketItem.use has found the block
the fluid goes into and the player may build there, right before it is
placed. Set cancel and nothing is poured and the bucket stays full.
The player’s state is swapped in, so PlayerRef::tell answers them. Only
for guests of a server. native_fill_bucket hears this click too (and
the filling one) without the player and the fluid. Not heard: a
dispenser, a cauldron, and a fluid a block places itself.
Side: server.
Return Flow::Cancel to take it: this sets cancel, and later mods are skipped unless they
listen with #[listener(receive_cancelled)]; those see event.cancelled and may set it back to
false.
fn container_opened(
&self,
host: &mut dyn ServerHost,
event: &mut ContainerOpenedEvent<'_>,
) -> Flow
fn container_opened( &self, host: &mut dyn ServerHost, event: &mut ContainerOpenedEvent<'_>, ) -> Flow
A player opens one of the game’s own menus (ServerPlayer.openMenu; the
job of NeoForge’s PlayerContainerEvent.Open, which comes after the
menu is open and cannot stop it): kind is the menu type
(minecraft:generic_9x3, minecraft:furnace, minecraft:crafting,
minecraft:merchant, minecraft:anvil, minecraft:lectern…; a
horse’s inventory is minecraft:horse_inventory) and pos the block
it belongs to, none for a villager, a mount or a vehicle’s chest.
Heard after the checks that refuse the menu (a locked container, a
spectator) and before the menu that was open closes. Set cancel and
nothing opens: the open menu stays as it was and the click is spent.
The player’s state is swapped in for the call, as for
native_run_mod_command, so host.players().acting_player(), PlayerRef::tell and
the item helpers reach them. Not heard: a menu a mod opens
(native_open_menu), the inventory screen, and the editors (sign,
book, command block). Server-side, for every player of the world.
Side: server.
Return Flow::Cancel to take it: this sets cancel, and later mods are skipped unless they
listen with #[listener(receive_cancelled)]; those see event.cancelled and may set it back to
false.
fn creative_slot(
&self,
host: &mut dyn ServerHost,
event: &mut CreativeSlotEvent<'_>,
) -> Flow
fn creative_slot( &self, host: &mut dyn ServerHost, event: &mut CreativeSlotEvent<'_>, ) -> Flow
A creative-mode player sets a slot of their inventory from the
creative screen (ServerGamePacketListenerImpl.handleSetCreativeModeSlot):
slot is the inventory menu’s slot (5 to 8 armour, 9 to 35 the
inventory, 36 to 44 the hotbar, 45 the off hand; below 0 is a stack
thrown out of the screen, which is dropped) and item (minecraft:air
for an emptied slot) and count what is put there. Heard once the
packet passed vanilla’s checks (a creative player, a real slot, a valid
stack) and before the slot changes or the stack drops. Set cancel
and the packet is ignored. The player’s state is swapped in for the
call, as for native_run_mod_command, so host.players().acting_player(),
PlayerRef::tell and the item helpers reach them. Not heard: stacks a
creative player gets other ways (middle-click pick block, /give).
Server-side, for every player of the world.
Side: server.
Return Flow::Cancel to take it: this sets cancel, and later mods are skipped unless they
listen with #[listener(receive_cancelled)]; those see event.cancelled and may set it back to
false.
fn food_level_changed(
&self,
host: &mut dyn ServerHost,
event: &mut FoodLevelChangedEvent<'_>,
) -> Flow
fn food_level_changed( &self, host: &mut dyn ServerHost, event: &mut FoodLevelChangedEvent<'_>, ) -> Flow
The food level of the server player player (name) is about to change
from from to to (Bukkit’s FoodLevelChangeEvent):
eating, hunger and saturation effects, the exhaustion that costs a
point, starving. Change to (kept between 0 and 20; saturation never
exceeds it) or set cancel to leave the level at from, saturation
included. Heard once for the change a player’s turn made as a whole, so
two changes in one tick arrive as one. Not heard: the full food bar a
respawn gives, the food a player joins with and the host of a LAN
world. The player’s state is swapped in, so host.players().acting_player(),
PlayerRef::tell and the item helpers reach them. On a server.
Side: server.
Return Flow::Cancel to take it: this sets cancel, and later mods are skipped unless they
listen with #[listener(receive_cancelled)]; those see event.cancelled and may set it back to
false.
fn hanging_break(
&self,
host: &mut dyn ServerHost,
event: &mut HangingBreakEvent<'_>,
) -> Flow
fn hanging_break( &self, host: &mut dyn ServerHost, event: &mut HangingBreakEvent<'_>, ) -> Flow
An item frame (minecraft:item_frame, minecraft:glow_item_frame) or
a painting (minecraft:painting), kind its entity type and pos the
block it hangs in, is about to break: a server player’s hit
(player, their state swapped in, so PlayerRef::tell answers them), a
blast, or the wall it hangs on gone (player None for both). Where
BlockAttachedEntity.hurtServer and its survival check would kill
it, before anything drops or sounds. Set cancel and it stays, as it
was. A hit that only takes the item out of a frame does not break the
frame and is not asked. The game’s own player’s hit is not asked, nor
is /kill.
Side: server.
Return Flow::Cancel to take it: this sets cancel, and later mods are skipped unless they
listen with #[listener(receive_cancelled)]; those see event.cancelled and may set it back to
false.
fn hanging_place(
&self,
host: &mut dyn ServerHost,
event: &mut HangingPlaceEvent<'_>,
) -> Flow
fn hanging_place( &self, host: &mut dyn ServerHost, event: &mut HangingPlaceEvent<'_>, ) -> Flow
A server player places a hanging entity: an item frame
(minecraft:item_frame, minecraft:glow_item_frame), a painting
(minecraft:painting) or a leash knot (minecraft:leash_knot, when a
lead is tied to a fence that has none yet), kind its entity type and
pos the block it takes (the fence’s for a knot). Where
HangingEntityItem.useOn and LeadItem.useOn create it, once it is
known to fit and before anything is placed or used up. Set cancel
and nothing is placed: the item stays in the player’s hand. The
player’s state is swapped in, so PlayerRef::tell answers them. Only for
guests of a server; /summon, a dispenser and the game’s own player
are not heard, nor is a lead tied to a mob or a boat.
Side: server.
Return Flow::Cancel to take it: this sets cancel, and later mods are skipped unless they
listen with #[listener(receive_cancelled)]; those see event.cancelled and may set it back to
false.
fn player_changed_dimension(
&self,
host: &mut dyn ServerHost,
event: &mut PlayerChangedDimensionEvent<'_>,
)
fn player_changed_dimension( &self, host: &mut dyn ServerHost, event: &mut PlayerChangedDimensionEvent<'_>, )
player (name) changed dimension (NeoForge’s
PlayerChangedDimensionEvent): from and to are dimension ids
(minecraft:overworld, minecraft:the_nether, minecraft:the_end).
Heard once per move, when it has ended: the portal’s exit is found
and the player stands there (after the destination has loaded), a
command’s teleport has landed, or a respawn in another level than the
death’s is placed for good (a bed or anchor, or the world spawn’s
free column, after the fallback when a respawn block was gone). The
level of to is the one in place, and the player’s state is swapped
in, as for native_run_mod_command: host.players().acting_player(),
PlayerRef::tell, the item helpers and the rest reach them. Heard for:
Nether and End portals (also riding a vehicle, and leaving the End as
its winner), /execute in ... run tp and any other command that
teleports a player into another level, and the death respawn. Not
heard: a move within a level (/tp, an End gateway), a player who
leaves before the move ends, a move that ends where it started (a
respawn in the dimension of the death), and anything outside a
dedicated server.
Side: server.
fn player_clone(
&self,
host: &mut dyn ServerHost,
event: &mut PlayerCloneEvent<'_>,
)
fn player_clone( &self, host: &mut dyn ServerHost, event: &mut PlayerCloneEvent<'_>, )
A player’s data was copied to their new player (NeoForge’s
PlayerEvent.Clone, from ServerPlayer.restoreFrom): was_death is
true after a death, false when they left the End after the credits
(respawn with keepAllPlayerData). The uuid stays the same, so the
old and the new player share player. Heard before the new player is
placed, on a server, with no player’s state swapped in. Not
cancellable.
Side: server.
fn player_commands_sent(
&self,
host: &mut dyn ServerHost,
event: &mut PlayerCommandsSentEvent<'_>,
)
fn player_commands_sent( &self, host: &mut dyn ServerHost, event: &mut PlayerCommandsSentEvent<'_>, )
The command tree a server sends a player (NeoForge’s and Paper’s
“commands sent to a player” stage): when they join and when their
level changes (/op, /deop, the LAN settings). names are the
root commands their client would get, vanilla’s they may use and the
mods’; take a name out and that client gets the tree without it
(and without what it leads to), so it neither completes nor
highlights it. This hides the command from the client only: the
server still runs a typed one, native_player_command stops it.
For a player who is already on, their state is swapped in and the
helpers (PlayerRef::tell…) work; for one who is joining it is not, and
their client has no world to tell yet. The tree the hub sends again by
itself (after a respawn or a change of level) keeps the last answer
and does not ask again; the integrated server’s owner is not asked
when the world’s cheats are switched.
Side: server.
Every mod gets event.names in order and may add, change or remove names.
fn player_destroy_item(
&self,
host: &mut dyn ServerHost,
event: &mut PlayerDestroyItemEvent<'_>,
)
fn player_destroy_item( &self, host: &mut dyn ServerHost, event: &mut PlayerDestroyItemEvent<'_>, )
The item item of the server player player (name) broke in slot
(mainhand, offhand, head, chest, legs, feet, body or
saddle): LivingEntity.onEquippedItemBroken, Bukkit’s
PlayerItemBreakEvent. Listen only; armour has a slot, not a hand.
The player’s state is swapped in. Once for each break, on a server; a
creative player and the host of a LAN world are not heard.
Side: server.
fn player_fish(
&self,
host: &mut dyn ServerHost,
event: &mut PlayerFishEvent<'_>,
) -> Flow
fn player_fish( &self, host: &mut dyn ServerHost, event: &mut PlayerFishEvent<'_>, ) -> Flow
A server player’s fishing rod, with state: 0 the cast
(FishingRodItem.use throwing the bobber), 1 a fish biting
(FishingHook.catchingFish), 2 the reel-in of a bite, which gives the
catch, 3 the reel-in with nothing on the line, 4 the reel-in of a
bobber hooked to an entity or item (like Bukkit’s PlayerFishEvent;
NeoForge’s ItemFishedEvent is later, in FishingHook.retrieve). Set cancel on the cast and nothing
is thrown; on a bite the fish gets away and the wait starts over; on
a reel-in (2 to 4) nothing happens, the bobber stays out and the rod
takes no wear. The bobber ending by itself (too far, the rod put
away, the owner dying), nor the host of a LAN world’s rod. The
player’s state is swapped in, so host.players().acting_player(), PlayerRef::tell
and the item helpers reach them. Once for each cast, bite and reel-in,
on a server.
Side: server.
Return Flow::Cancel to take it: this sets cancel, and later mods are skipped unless they
listen with #[listener(receive_cancelled)]; those see event.cancelled and may set it back to
false.
fn player_flower_pot_manipulate(
&self,
host: &mut dyn ServerHost,
event: &mut PlayerFlowerPotManipulateEvent<'_>,
)
fn player_flower_pot_manipulate( &self, host: &mut dyn ServerHost, event: &mut PlayerFlowerPotManipulateEvent<'_>, )
A server player put a plant into a flower pot, after the potted block state was stored and the
item consumed. plant is the item id and pos the pot position. Server-side.
Side: server.
fn player_game_mode_changed(
&self,
host: &mut dyn ServerHost,
event: &mut PlayerGameModeChangedEvent<'_>,
) -> Flow
fn player_game_mode_changed( &self, host: &mut dyn ServerHost, event: &mut PlayerGameModeChangedEvent<'_>, ) -> Flow
A server player’s game mode is about to change (NeoForge’s
PlayerChangeGameModeEvent): from from to to, both the shared
GameMode used by commands and PlayerRef. player is the UUID and
name the name. Heard for
the /gamemode command, the F3+F4 switcher’s packet and a hardcore
world’s respawn into spectator, once for each change to a different
mode; not for the world’s default mode a player joins with. Return
Flow::Cancel and the player keeps their mode (nothing is sent, the
command counts it as no change). For a change the game makes inside
a player’s turn their state is swapped in; for the hardcore respawn
it is not.
Side: server.
Return Flow::Cancel to take it: this sets cancel, and later mods are skipped unless they
listen with #[listener(receive_cancelled)]; those see event.cancelled and may set it back to
false.
fn player_insert_lectern_book(
&self,
host: &mut dyn ServerHost,
event: &mut PlayerInsertLecternBookEvent<'_>,
)
fn player_insert_lectern_book( &self, host: &mut dyn ServerHost, event: &mut PlayerInsertLecternBookEvent<'_>, )
A server player inserted a book into a lectern, after the block entity and inventory changed.
book is the item id. Server-side.
Side: server.
fn player_item_frame_change(
&self,
host: &mut dyn ServerHost,
event: &mut PlayerItemFrameChangeEvent<'_>,
)
fn player_item_frame_change( &self, host: &mut dyn ServerHost, event: &mut PlayerItemFrameChangeEvent<'_>, )
A server player changed an item frame after its contents or rotation changed. action is
put, rotate, remove_item or break; item is empty when no item remains, and rotation
is the resulting step. Server-side.
Side: server.
fn player_item_mend(
&self,
host: &mut dyn ServerHost,
event: &mut PlayerItemMendEvent<'_>,
)
fn player_item_mend( &self, host: &mut dyn ServerHost, event: &mut PlayerItemMendEvent<'_>, )
Mending repaired a server player’s item with experience from an orb. repair is durability
restored and experience is the orb’s value. Server-side.
Side: server.
fn player_lectern_page_change(
&self,
host: &mut dyn ServerHost,
event: &mut PlayerLecternPageChangeEvent<'_>,
)
fn player_lectern_page_change( &self, host: &mut dyn ServerHost, event: &mut PlayerLecternPageChangeEvent<'_>, )
A server player changed the page of a lectern, after its page and redstone pulse changed.
page is the zero-based new page. Server-side.
Side: server.
fn player_load_from_file(
&self,
host: &mut dyn ServerHost,
event: &mut PlayerLoadFromFileEvent<'_>,
)
fn player_load_from_file( &self, host: &mut dyn ServerHost, event: &mut PlayerLoadFromFileEvent<'_>, )
A player was loaded from the world’s save (NeoForge’s
PlayerEvent.LoadFromFile, PlayerList.loadPlayerData): their .dat
has been read and applied, and they are not placed in a level yet.
directory is the world’s player directory (players/data): a mod
reads its own file there, named <uuid>.<suffix> as
getPlayerFile(suffix) names it. Heard once for each join, for the
owner of an integrated server as for anyone else, on a server, with no
player’s state swapped in. Not cancellable.
Not on wasm: it gives a path in the game’s file system, which a wasm mod has none of; a wasm mod keeps a player’s data in attachments. Side: server.
fn player_login(
&self,
host: &mut dyn ServerHost,
event: &mut PlayerLoginEvent<'_>,
) -> Flow
fn player_login( &self, host: &mut dyn ServerHost, event: &mut PlayerLoginEvent<'_>, ) -> Flow
A player whose login the server has accepted (NeoForge’s
PlayerNegotiationEvent stage): the name, whitelist, ban and
server-full checks have passed and the player holds a place, but their
saved state is not loaded and they are not placed in a level yet. Set
cancel to refuse them: they are disconnected with reason (a plain
“Disconnected” if it is left unset) and nothing else of the join (the
join message, native_player_logged_in) happens. Once for each player
who joins, on a server. The player is not placed yet and their client
has no world to show a message in, so no player’s state is swapped in
and PlayerRef::tell reaches nobody: the refusal reason is the answer.
The checks that need no mod (name, whitelist, bans, a full server,
the proxy’s forwarding) refuse earlier, on the connection, and this
hook does not hear those players.
Side: server.
Return Flow::Cancel to take it: this sets cancel, and later mods are skipped unless they
listen with #[listener(receive_cancelled)]; those see event.cancelled and may set it back to
false.
fn player_save_to_file(
&self,
host: &mut dyn ServerHost,
event: &mut PlayerSaveToFileEvent<'_>,
)
fn player_save_to_file( &self, host: &mut dyn ServerHost, event: &mut PlayerSaveToFileEvent<'_>, )
A player was saved to the world’s store (NeoForge’s
PlayerEvent.SaveToFile, PlayerList.save): when they leave or the
world closes, when a dedicated or integrated server saves its guests,
and for an integrated server’s owner when the world saves them.
Once for each save. directory
is the world’s player directory (players/data): write your own file
there, named <uuid>.<suffix>, never the player’s .dat. The player
may be leaving, so no player’s state is swapped in. Not cancellable.
Autosave snapshots are written asynchronously: this notification runs
on a later server tick after a successful write, possibly after WorldSaved.
Live state may have advanced beyond the saved snapshot; a process exit
before completions are drained can prevent notification delivery.
Not on wasm: it gives a path in the game’s file system, which a wasm mod has none of; a wasm mod keeps a player’s data in attachments. Side: server.
fn player_sprint(
&self,
host: &mut dyn ServerHost,
event: &mut PlayerSprintEvent<'_>,
)
fn player_sprint( &self, host: &mut dyn ServerHost, event: &mut PlayerSprintEvent<'_>, )
A server player’s sprint started or stopped: their client sent
START_SPRINTING or STOP_SPRINTING (the sprint key, a double tap
forward, or letting go) and the server’s player is now sprinting
(vanilla’s setSprinting in handlePlayerCommand). Heard only when it
changes. It cannot be stopped, and it hears what the client asks, not
what the server does: a sprint that ends by itself (a hit’s knockback,
hunger, a wall) is not reported. The player’s state is swapped in, so
the helpers and PlayerRef::tell work. Once for each change, on a server.
Side: server.
fn player_swap_hands(
&self,
host: &mut dyn ServerHost,
event: &mut PlayerSwapHandsEvent<'_>,
) -> Flow
fn player_swap_hands( &self, host: &mut dyn ServerHost, event: &mut PlayerSwapHandsEvent<'_>, ) -> Flow
player (name) pressed the swap-hands key: heard before the main and
off hand items swap (the SWAP_ITEM_WITH_OFFHAND player action that
ServerGamePacketListenerImpl.handlePlayerAction answers; Bukkit’s
PlayerSwapHandItemsEvent), not for a spectator. Set cancel to keep
the items where they are: the player’s client, which swapped them at
once, gets its slots back. The player’s state is swapped in, so
host.players().acting_player(), PlayerRef::tell and the item helpers reach them.
Once for each press, on a server. Not heard: the same swap made in an
open inventory (hovering a slot and pressing the key, a menu click) and
the host of a LAN world.
Side: server.
Return Flow::Cancel to take it: this sets cancel, and later mods are skipped unless they
listen with #[listener(receive_cancelled)]; those see event.cancelled and may set it back to
false.
fn player_take_lectern_book(
&self,
host: &mut dyn ServerHost,
event: &mut PlayerTakeLecternBookEvent<'_>,
)
fn player_take_lectern_book( &self, host: &mut dyn ServerHost, event: &mut PlayerTakeLecternBookEvent<'_>, )
A server player took the book from a lectern, after the menu and block entity changed. book
is the removed item id. Server-side.
Side: server.
fn player_teleported(
&self,
host: &mut dyn ServerHost,
event: &mut PlayerTeleportedEvent<'_>,
)
fn player_teleported( &self, host: &mut dyn ServerHost, event: &mut PlayerTeleportedEvent<'_>, )
A server player a command teleported (NeoForge’s
EntityTeleportEvent, for a player): /tp and /teleport, inside
their level or into another one. from and to are their feet before
and after, dimension the level they are in now. Heard after the move
has reached the player’s state and their client (an inter-level
teleport: when the new level is entered, before it has loaded around
them), so it cannot stop it. The player’s state is swapped in, so the
helpers that read the acting player and PlayerRef::tell work. Once for
each teleported player, on a server. Ender pearls and chorus fruit
have their own hooks; a spectator’s teleport menu is not heard yet;
portals and respawns are not teleports here.
Side: server.
fn player_totem(
&self,
host: &mut dyn ServerHost,
event: &mut PlayerTotemEvent<'_>,
)
fn player_totem( &self, host: &mut dyn ServerHost, event: &mut PlayerTotemEvent<'_>, )
A totem of undying saved the server player player (name): their
hurt would have killed them and the totem held in either hand fired
(LivingEntity.checkTotemDeathProtection; Bukkit’s
EntityResurrectEvent), heard just before it is used up and its
effects apply. Listen only: whether the totem saves is decided inside
the health state machine, before a mod is asked, so a mod cannot veto
it from here. The player’s state is swapped in, so
host.players().acting_player(), PlayerRef::tell and the item helpers reach them.
Once for each totem, on a server; the host of a LAN world’s totem is
not heard.
Side: server.
fn resource_pack_status(
&self,
host: &mut dyn ServerHost,
event: &mut ResourcePackStatusEvent<'_>,
)
fn resource_pack_status( &self, host: &mut dyn ServerHost, event: &mut ResourcePackStatusEvent<'_>, )
A server player’s client answered a resource pack in play (vanilla’s
ServerboundResourcePackPacket): status is Action’s number, 0
successfully loaded, 1 declined, 2 failed download, 3 accepted, 4
downloaded, 5 invalid URL, 6 failed reload, 7 discarded. Heard when the
packet arrives, after the server has handled it; it cannot be stopped.
The player’s state is swapped in, so the helpers and PlayerRef::tell
work. The pack a dedicated server offers in the configuration
(resource-pack in server.properties) is answered before the
player has joined, and those answers are not heard. Once for each
answer, on a server.
Side: server.
fn spawn_change(&self, host: &mut dyn ServerHost, event: &mut SpawnChangeEvent)
fn spawn_change(&self, host: &mut dyn ServerHost, event: &mut SpawnChangeEvent)
The world’s spawn point changed to pos and angle.
Side: server.
fn tnt_primed(
&self,
host: &mut dyn ServerHost,
event: &mut TntPrimedEvent,
) -> Flow
fn tnt_primed( &self, host: &mut dyn ServerHost, event: &mut TntPrimedEvent, ) -> Flow
TNT at pos is about to be lit (primed): a flint and steel or a fire
charge on it, fire burning it, a redstone signal, an arrow, or a
dispenser’s flint and steel or TNT item. player is the server player
whose click lit it, with their state swapped in (so PlayerRef::tell
answers them), None when no player is behind it (fire, redstone, an
arrow, a dispenser). Set cancel and it is not primed: a TNT block
stays where it is (one that fire or a signal had already taken out is
put back, without a block update), a dispenser’s TNT item stays in it.
Not asked: TNT set off by a blast (native_explosion_detonate spares
blocks), a TNT minecart and a sulfur cube. Server-side and in single
player.
Side: server.
Return Flow::Cancel to take it: this sets cancel, and later mods are skipped unless they
listen with #[listener(receive_cancelled)]; those see event.cancelled and may set it back to
false.
fn vehicle_create(
&self,
host: &mut dyn ServerHost,
event: &mut VehicleCreateEvent<'_>,
)
fn vehicle_create( &self, host: &mut dyn ServerHost, event: &mut VehicleCreateEvent<'_>, )
A boat or minecart was created at pos, after it joined the level.
kind is the vehicle type. Server-side.
Side: server.
fn vehicle_damage(
&self,
host: &mut dyn ServerHost,
event: &mut VehicleDamageEvent<'_>,
) -> Flow
fn vehicle_damage( &self, host: &mut dyn ServerHost, event: &mut VehicleDamageEvent<'_>, ) -> Flow
A vehicle is about to take damage from a player’s attack. kind is
boat or the minecart type; mods may change damage or set cancel
to leave its damage and wobble unchanged. The attack itself still
completes. Server-side.
Side: server.
Return Flow::Cancel to take it: this sets cancel, and later mods are skipped unless they
listen with #[listener(receive_cancelled)]; those see event.cancelled and may set it back to
false.
fn vehicle_destroy(
&self,
host: &mut dyn ServerHost,
event: &mut VehicleDestroyEvent<'_>,
)
fn vehicle_destroy( &self, host: &mut dyn ServerHost, event: &mut VehicleDestroyEvent<'_>, )
A boat or minecart is about to be destroyed at pos. TNT minecarts
that prime instead of breaking are not heard. Server-side.
Side: server.
fn vehicle_moved(
&self,
host: &mut dyn ServerHost,
event: &mut VehicleMovedEvent<'_>,
)
fn vehicle_moved( &self, host: &mut dyn ServerHost, event: &mut VehicleMovedEvent<'_>, )
A boat or minecart (kind, minecraft:oak_boat) moved since the last
tick (VehicleMoveEvent): from and to are its positions, heard
after the tick moved it. Once a tick for each vehicle that carries a
server player, whose state is then swapped in (as for
native_run_mod_command: host.players().acting_player(), PlayerRef::tell and
the item helpers reach them; player is their UUID), and for one a
server player rode and left, until it has stood still for ten
seconds (player is none, nobody is swapped in). It only hears.
Cheap when nothing moves: one position compare a tick for each watched
vehicle. Not heard: a vehicle moved before anyone rode it, a mount
(horse, pig…) or a vehicle carrying only a mob. Server-side, in the
level the vehicle is in.
Side: server.
fn world_border_bounds_changed(
&self,
host: &mut dyn ServerHost,
event: &mut WorldBorderBoundsChangedEvent,
)
fn world_border_bounds_changed( &self, host: &mut dyn ServerHost, event: &mut WorldBorderBoundsChangedEvent, )
The server world’s border bounds changed, either immediately or when its timed size change was requested. Side: server.
fn world_border_center_changed(
&self,
host: &mut dyn ServerHost,
event: &mut WorldBorderCenterChangedEvent,
)
fn world_border_center_changed( &self, host: &mut dyn ServerHost, event: &mut WorldBorderCenterChangedEvent, )
The server world’s border center changed. Side: server.
fn player_advancement_done(
&self,
host: &mut dyn ServerHost,
event: &mut PlayerAdvancementDoneEvent<'_>,
)
fn player_advancement_done( &self, host: &mut dyn ServerHost, event: &mut PlayerAdvancementDoneEvent<'_>, )
A server player completed an advancement, after progress was recorded. Side: server.
fn player_advancement_progress(
&self,
host: &mut dyn ServerHost,
event: &mut PlayerAdvancementProgressEvent<'_>,
)
fn player_advancement_progress( &self, host: &mut dyn ServerHost, event: &mut PlayerAdvancementProgressEvent<'_>, )
A criterion of a server player’s advancement was granted or revoked, after its progress changed
and before any completion rewards. A grant or revoke that changes nothing is not heard.
progress is an owned snapshot of every criterion (including its stored grant date),
the requirement groups and their completion at this exact mutation. It belongs to
the mutated progress, including first-tick and reload grants queued by the server hub.
During a nested player turn, a suspended player’s hub record may contain displaced
progress. A listener may retain a clone; later mutations do not change the snapshot.
Side: server.
fn player_arm_swing(
&self,
host: &mut dyn ServerHost,
event: &mut PlayerArmSwingEvent<'_>,
)
fn player_arm_swing( &self, host: &mut dyn ServerHost, event: &mut PlayerArmSwingEvent<'_>, )
A guest’s arm swing was handled by the server. hand is mainhand. Server-side.
Side: server.
fn player_attack_cooldown_reset(
&self,
host: &mut dyn ServerHost,
event: &mut PlayerAttackCooldownResetEvent<'_>,
)
fn player_attack_cooldown_reset( &self, host: &mut dyn ServerHost, event: &mut PlayerAttackCooldownResetEvent<'_>, )
A server player reset their attack strength by swinging (handlePunch). The swing and reset
have already happened. The player’s state is not swapped in. Server-side.
Side: server.
fn player_bed_enter(
&self,
host: &mut dyn ServerHost,
event: &mut PlayerBedEnterEvent<'_>,
) -> Flow
fn player_bed_enter( &self, host: &mut dyn ServerHost, event: &mut PlayerBedEnterEvent<'_>, ) -> Flow
A server player is about to enter a bed after the sleep checks pass. Set cancel to keep them
out. The player’s state is swapped in.
Side: server.
Return Flow::Cancel to take it: this sets cancel, and later mods are skipped unless they
listen with #[listener(receive_cancelled)]; those see event.cancelled and may set it back to
false.
fn player_bed_leave(
&self,
host: &mut dyn ServerHost,
event: &mut PlayerBedLeaveEvent<'_>,
)
fn player_bed_leave( &self, host: &mut dyn ServerHost, event: &mut PlayerBedLeaveEvent<'_>, )
A server player woke or stood up from the bed at pos, after their
sleeping state changed.
Side: server.
fn player_bucket_entity(
&self,
host: &mut dyn ServerHost,
event: &mut PlayerBucketEntityEvent<'_>,
)
fn player_bucket_entity( &self, host: &mut dyn ServerHost, event: &mut PlayerBucketEntityEvent<'_>, )
A server player caught a mob in a bucket, after it was removed and the filled bucket was given. Server-side. Side: server.
fn player_bundle_item_select(
&self,
host: &mut dyn ServerHost,
event: &mut PlayerBundleItemSelectEvent<'_>,
)
fn player_bundle_item_select( &self, host: &mut dyn ServerHost, event: &mut PlayerBundleItemSelectEvent<'_>, )
A server player selected a bundle item in slot at index. The guest’s
state is not swapped in during packet handling.
Side: server.
fn player_change_beacon_effect(
&self,
host: &mut dyn ServerHost,
event: &mut PlayerChangeBeaconEffectEvent<'_>,
)
fn player_change_beacon_effect( &self, host: &mut dyn ServerHost, event: &mut PlayerChangeBeaconEffectEvent<'_>, )
A server player changed a beacon’s selected effects, after they were stored. Each selected
effect is an Option<EffectKey>; None means no effect. Server-side.
Side: server.
fn player_client_loaded_world(
&self,
host: &mut dyn ServerHost,
event: &mut PlayerClientLoadedWorldEvent<'_>,
)
fn player_client_loaded_world( &self, host: &mut dyn ServerHost, event: &mut PlayerClientLoadedWorldEvent<'_>, )
A server player finished loading the world around them after joining, respawning or changing dimension. The guest’s state is not swapped in. Server-side. Side: server.
fn player_deep_sleep(
&self,
host: &mut dyn ServerHost,
event: &mut PlayerDeepSleepEvent<'_>,
)
fn player_deep_sleep( &self, host: &mut dyn ServerHost, event: &mut PlayerDeepSleepEvent<'_>, )
A server player has slept for 100 ticks in a bed and now counts as deeply asleep for the night-skip check. Side: server.
fn player_edit_book(
&self,
host: &mut dyn ServerHost,
event: &mut PlayerEditBookEvent<'_>,
) -> Flow
fn player_edit_book( &self, host: &mut dyn ServerHost, event: &mut PlayerEditBookEvent<'_>, ) -> Flow
A server player’s book edit or signing packet is about to be applied. pages is its page
count; signing means the packet has a title. Set cancel to drop the edit.
Side: server.
Return Flow::Cancel to take it: this sets cancel, and later mods are skipped unless they
listen with #[listener(receive_cancelled)]; those see event.cancelled and may set it back to
false.
fn player_egg_throw(
&self,
host: &mut dyn ServerHost,
event: &mut PlayerEggThrowEvent<'_>,
)
fn player_egg_throw( &self, host: &mut dyn ServerHost, event: &mut PlayerEggThrowEvent<'_>, )
A server player threw an egg, after its projectile was launched and the use was applied. Server-side. Side: server.
fn player_elytra_boost(
&self,
host: &mut dyn ServerHost,
event: &mut PlayerElytraBoostEvent<'_>,
)
fn player_elytra_boost( &self, host: &mut dyn ServerHost, event: &mut PlayerElytraBoostEvent<'_>, )
A server player used a firework rocket to boost while gliding, after the rocket was launched and consumed. Server-side. Side: server.
fn player_exp_cooldown_change(
&self,
host: &mut dyn ServerHost,
event: &mut PlayerExpCooldownChangeEvent<'_>,
)
fn player_exp_cooldown_change( &self, host: &mut dyn ServerHost, event: &mut PlayerExpCooldownChangeEvent<'_>, )
A server player’s XP orb pickup cooldown changed to ticks. It is
reported after the value changes. Server-side.
Side: server.
fn player_input(
&self,
host: &mut dyn ServerHost,
event: &mut PlayerInputEvent<'_>,
)
fn player_input( &self, host: &mut dyn ServerHost, event: &mut PlayerInputEvent<'_>, )
A guest sent the server’s current PlayerInput flags, after they were applied to the hub. The guest’s state is swapped in. Server-side.
Side: server.
fn player_item_cooldown(
&self,
host: &mut dyn ServerHost,
event: &mut PlayerItemCooldownEvent<'_>,
) -> Flow
fn player_item_cooldown( &self, host: &mut dyn ServerHost, event: &mut PlayerItemCooldownEvent<'_>, ) -> Flow
An item cooldown is about to start for a server player. item is the item id and ticks its
duration. The player’s state is not swapped in. Set cancel to skip starting the cooldown.
Server-side.
Side: server.
Return Flow::Cancel to take it: this sets cancel, and later mods are skipped unless they
listen with #[listener(receive_cancelled)]; those see event.cancelled and may set it back to
false.
fn player_switch_hotbar_slot_pre(
&self,
host: &mut dyn ServerHost,
event: &mut PlayerSwitchHotbarSlotPreEvent,
) -> Flow
fn player_switch_hotbar_slot_pre( &self, host: &mut dyn ServerHost, event: &mut PlayerSwitchHotbarSlotPreEvent, ) -> Flow
PlayerSwitchHotbarSlotEvent.Pre: a server player is switching from hotbar slot
old_slot to new_slot (0 to 8), after the slot range check and before the
selected slot changes. Fired only when the slot differs. The player’s state is not
swapped in. Set cancel to keep the old slot; the client is sent that slot again,
and player_switch_hotbar_slot_post doesn’t fire.
Side: server.
Return Flow::Cancel to take it: this sets cancel, and later mods are skipped unless they
listen with #[listener(receive_cancelled)]; those see event.cancelled and may set it back to
false.
fn player_switch_hotbar_slot_post(
&self,
host: &mut dyn ServerHost,
event: &mut PlayerSwitchHotbarSlotPostEvent,
)
fn player_switch_hotbar_slot_post( &self, host: &mut dyn ServerHost, event: &mut PlayerSwitchHotbarSlotPostEvent, )
PlayerSwitchHotbarSlotEvent.Post: a server player switched from hotbar slot
old_slot to new_slot (0 to 8), after the selected slot changed and a main-hand
item use stopped. Fired only when the slot differs and
player_switch_hotbar_slot_pre didn’t cancel it. The player’s state is not swapped in.
Side: server.
fn player_jump(
&self,
host: &mut dyn ServerHost,
event: &mut PlayerJumpEvent<'_>,
)
fn player_jump( &self, host: &mut dyn ServerHost, event: &mut PlayerJumpEvent<'_>, )
A guest’s accepted movement made the server jump them from the ground. Server-side. Side: server.
fn player_kicked(
&self,
host: &mut dyn ServerHost,
event: &mut PlayerKickedEvent<'_>,
)
fn player_kicked( &self, host: &mut dyn ServerHost, event: &mut PlayerKickedEvent<'_>, )
A guest was disconnected by a server kick, after the hub recorded the rendered reason. The guest’s state is
swapped in unless they were already removed in the same poll.
Side: server.
fn player_launch_projectile(
&self,
host: &mut dyn ServerHost,
event: &mut PlayerLaunchProjectileEvent<'_>,
)
fn player_launch_projectile( &self, host: &mut dyn ServerHost, event: &mut PlayerLaunchProjectileEvent<'_>, )
A server player launched a projectile item, after it was created.
item is the projectile’s held item.
Side: server.
fn player_level_change(
&self,
host: &mut dyn ServerHost,
event: &mut PlayerLevelChangeEvent<'_>,
)
fn player_level_change( &self, host: &mut dyn ServerHost, event: &mut PlayerLevelChangeEvent<'_>, )
A server player’s experience level changed, after the new level was applied. Side: server.
fn player_loom_pattern_select(
&self,
host: &mut dyn ServerHost,
event: &mut PlayerLoomPatternSelectEvent<'_>,
)
fn player_loom_pattern_select( &self, host: &mut dyn ServerHost, event: &mut PlayerLoomPatternSelectEvent<'_>, )
A server player selected a loom pattern, after the loom menu accepted the button. pattern is
the zero-based button index. Server-side.
Side: server.
fn player_map_filled(
&self,
host: &mut dyn ServerHost,
event: &mut PlayerMapFilledEvent<'_>,
)
fn player_map_filled( &self, host: &mut dyn ServerHost, event: &mut PlayerMapFilledEvent<'_>, )
A server player filled an empty map, after the filled map and its saved data were created. Server-side. Side: server.
fn player_name_entity(
&self,
host: &mut dyn ServerHost,
event: &mut PlayerNameEntityEvent<'_>,
)
fn player_name_entity( &self, host: &mut dyn ServerHost, event: &mut PlayerNameEntityEvent<'_>, )
A server player named a mob with a name tag, after its name and persistence changed and the tag was consumed. Server-side. Side: server.
fn player_open_sign(
&self,
host: &mut dyn ServerHost,
event: &mut PlayerOpenSignEvent<'_>,
)
fn player_open_sign( &self, host: &mut dyn ServerHost, event: &mut PlayerOpenSignEvent<'_>, )
A server player opened a sign for editing, after the editor state was made. front selects the
front or back side. Server-side.
Side: server.
fn player_pick_item(
&self,
host: &mut dyn ServerHost,
event: &mut PlayerPickItemEvent<'_>,
) -> Flow
fn player_pick_item( &self, host: &mut dyn ServerHost, event: &mut PlayerPickItemEvent<'_>, ) -> Flow
A server player picked an item from a block or entity, before it enters the hotbar. pos is
zero for an entity; entity_id is zero for a block. The player’s state is swapped in. Set
cancel to leave the inventory and client unchanged.
Side: server.
Return Flow::Cancel to take it: this sets cancel, and later mods are skipped unless they
listen with #[listener(receive_cancelled)]; those see event.cancelled and may set it back to
false.
fn player_pickup_arrow(
&self,
host: &mut dyn ServerHost,
event: &mut PlayerPickupArrowEvent<'_>,
)
fn player_pickup_arrow( &self, host: &mut dyn ServerHost, event: &mut PlayerPickupArrowEvent<'_>, )
A server player picked up an arrow after it was removed and its pickup was applied. item is
the arrow’s pickup item id. Server-side.
Side: server.
fn player_ready_arrow(
&self,
host: &mut dyn ServerHost,
event: &mut PlayerReadyArrowEvent<'_>,
)
fn player_ready_arrow( &self, host: &mut dyn ServerHost, event: &mut PlayerReadyArrowEvent<'_>, )
A server player released a drawn bow with arrow selected, by the use-item
key or a mod’s LivingRef::release_using_item. The player’s state is swapped in.
Side: server.
fn player_recipe_book_click(
&self,
host: &mut dyn ServerHost,
event: &mut PlayerRecipeBookClickEvent<'_>,
)
fn player_recipe_book_click( &self, host: &mut dyn ServerHost, event: &mut PlayerRecipeBookClickEvent<'_>, )
A server player’s recipe book requested a known recipe be placed in
their crafting grid. recipe is the recipe id; all is the shift
click form. Server-side.
Side: server.
fn player_recipe_book_settings_change(
&self,
host: &mut dyn ServerHost,
event: &mut PlayerRecipeBookSettingsChangeEvent<'_>,
)
fn player_recipe_book_settings_change( &self, host: &mut dyn ServerHost, event: &mut PlayerRecipeBookSettingsChangeEvent<'_>, )
A server player’s authoritative recipe book pair changed. book is a
typed RecipeBookIdentity, never a custom vanilla ordinal. Rejected and
unchanged custom requests do not notify. The guest is not swapped in.
Side: server.
fn player_recipe_discovered(
&self,
host: &mut dyn ServerHost,
event: &mut PlayerRecipeDiscoveredEvent<'_>,
) -> Flow
fn player_recipe_discovered( &self, host: &mut dyn ServerHost, event: &mut PlayerRecipeDiscoveredEvent<'_>, ) -> Flow
A recipe is about to be unlocked for a server player. Set cancel to keep it locked. The
player’s state is not swapped in. Server-side.
Side: server.
Return Flow::Cancel to take it: this sets cancel, and later mods are skipped unless they
listen with #[listener(receive_cancelled)]; those see event.cancelled and may set it back to
false.
fn player_riptide(
&self,
host: &mut dyn ServerHost,
event: &mut PlayerRiptideEvent<'_>,
)
fn player_riptide( &self, host: &mut dyn ServerHost, event: &mut PlayerRiptideEvent<'_>, )
A server player launched with a riptide trident, after the velocity, spin attack and grounded lift have been applied. The player’s state is swapped in. No reply is needed. Side: server.
fn player_shear_entity(
&self,
host: &mut dyn ServerHost,
event: &mut PlayerShearEntityEvent<'_>,
) -> Flow
fn player_shear_entity( &self, host: &mut dyn ServerHost, event: &mut PlayerShearEntityEvent<'_>, ) -> Flow
A player shearing a mob is about to do so. Set cancel to leave the mob and shears unchanged.
The guest’s state is swapped in.
Side: server.
Return Flow::Cancel to take it: this sets cancel, and later mods are skipped unless they
listen with #[listener(receive_cancelled)]; those see event.cancelled and may set it back to
false.
fn player_shield_disable(
&self,
host: &mut dyn ServerHost,
event: &mut PlayerShieldDisableEvent<'_>,
)
fn player_shield_disable( &self, host: &mut dyn ServerHost, event: &mut PlayerShieldDisableEvent<'_>, )
A server player’s shield was disabled by a blocked melee hit. The shield cooldown is set immediately after this call. Server-side. Side: server.
fn player_stat_award(
&self,
host: &mut dyn ServerHost,
event: &mut PlayerStatAwardEvent<'_>,
) -> Flow
fn player_stat_award( &self, host: &mut dyn ServerHost, event: &mut PlayerStatAwardEvent<'_>, ) -> Flow
A statistic is about to be awarded to a server player, before its count and scoreboard criteria
change. stat_type and stat are ids such as minecraft:mined and minecraft:stone, and
value the amount. Set cancel to award nothing. Server-side. Ordinary interactions
fire at vanilla’s award point; inside a transaction, the award and this hook wait until
the outermost successful commit, after tentative world and inventory writes.
Side: server.
Return Flow::Cancel to take it: this sets cancel, and later mods are skipped unless they
listen with #[listener(receive_cancelled)]; those see event.cancelled and may set it back to
false.
fn player_stonecutter_recipe_select(
&self,
host: &mut dyn ServerHost,
event: &mut PlayerStonecutterRecipeSelectEvent<'_>,
)
fn player_stonecutter_recipe_select( &self, host: &mut dyn ServerHost, event: &mut PlayerStonecutterRecipeSelectEvent<'_>, )
A server player selected a stonecutter recipe, after the menu accepted
its button. recipe is the zero-based button index. Server-side.
Side: server.
fn player_stop_spectating_entity(
&self,
host: &mut dyn ServerHost,
event: &mut PlayerStopSpectatingEntityEvent<'_>,
)
fn player_stop_spectating_entity( &self, host: &mut dyn ServerHost, event: &mut PlayerStopSpectatingEntityEvent<'_>, )
A server player stopped spectating entity_id, after their camera returned to the player.
Side: server.
fn player_stop_using_item(
&self,
host: &mut dyn ServerHost,
event: &mut PlayerStopUsingItemEvent<'_>,
)
fn player_stop_using_item( &self, host: &mut dyn ServerHost, event: &mut PlayerStopUsingItemEvent<'_>, )
A server player released the use-item key, or a mod’s LivingRef::release_using_item did,
before the item finished being used. The player’s state is swapped in.
Side: server.
fn player_swap_with_equipment_slot(
&self,
host: &mut dyn ServerHost,
event: &mut PlayerSwapWithEquipmentSlotEvent<'_>,
)
fn player_swap_with_equipment_slot( &self, host: &mut dyn ServerHost, event: &mut PlayerSwapWithEquipmentSlotEvent<'_>, )
A server player swapped their main and off hands, after both inventory slots changed. Server-side. Side: server.
fn player_teleport_end_gateway(
&self,
host: &mut dyn ServerHost,
event: &mut PlayerTeleportEndGatewayEvent<'_>,
) -> Flow
fn player_teleport_end_gateway( &self, host: &mut dyn ServerHost, event: &mut PlayerTeleportEndGatewayEvent<'_>, ) -> Flow
A server player is about to travel through an End gateway at gateway. Set cancel to leave
them at the entrance; the gateway is not consumed and its cooldown does not start. Server-side.
Side: server.
Return Flow::Cancel to take it: this sets cancel, and later mods are skipped unless they
listen with #[listener(receive_cancelled)]; those see event.cancelled and may set it back to
false.
fn player_toggle_entity_age_lock(
&self,
host: &mut dyn ServerHost,
event: &mut PlayerToggleEntityAgeLockEvent<'_>,
)
fn player_toggle_entity_age_lock( &self, host: &mut dyn ServerHost, event: &mut PlayerToggleEntityAgeLockEvent<'_>, )
A server player toggled an ageable mob’s age lock with a golden dandelion, after the lock and item use changed. Side: server.
fn player_toggle_sneak(
&self,
host: &mut dyn ServerHost,
event: &mut PlayerToggleSneakEvent<'_>,
)
fn player_toggle_sneak( &self, host: &mut dyn ServerHost, event: &mut PlayerToggleSneakEvent<'_>, )
A guest’s client changed sneaking in its player input packet, after the hub applied the new state. The guest’s state is swapped in. Server-side. Side: server.
fn player_trade(
&self,
host: &mut dyn ServerHost,
event: &mut PlayerTradeEvent<'_>,
)
fn player_trade( &self, host: &mut dyn ServerHost, event: &mut PlayerTradeEvent<'_>, )
A server player completed a villager or wandering trader trade. entity_id is the merchant
network id. Server-side.
Side: server.
fn player_unleash_entity(
&self,
host: &mut dyn ServerHost,
event: &mut PlayerUnleashEntityEvent<'_>,
)
fn player_unleash_entity( &self, host: &mut dyn ServerHost, event: &mut PlayerUnleashEntityEvent<'_>, )
A server player removed an entity’s leash, after it was cleared. Side: server.
fn player_velocity(
&self,
host: &mut dyn ServerHost,
event: &mut PlayerVelocityEvent<'_>,
)
fn player_velocity( &self, host: &mut dyn ServerHost, event: &mut PlayerVelocityEvent<'_>, )
A server applied velocity to a player, when syncing changed motion to that player’s client.
Side: server.
fn portal_create(
&self,
host: &mut dyn ServerHost,
event: &mut PortalCreateEvent<'_>,
)
fn portal_create( &self, host: &mut dyn ServerHost, event: &mut PortalCreateEvent<'_>, )
A Nether portal was built for a dimension travel, or an End platform
was made for an arrival. pos is the lower corner of the Nether
portal rectangle or the End platform origin. The completed blocks are
already in the world.
Side: server.
fn potion_splash(
&self,
host: &mut dyn ServerHost,
event: &mut PotionSplashEvent<'_>,
)
fn potion_splash( &self, host: &mut dyn ServerHost, event: &mut PotionSplashEvent<'_>, )
A thrown splash or lingering potion applied its hit effects. Side: server.
fn prepare_hopper_transfer(
&self,
host: &mut dyn ServerHost,
event: &mut PrepareHopperTransferEvent,
)
fn prepare_hopper_transfer( &self, host: &mut dyn ServerHost, event: &mut PrepareHopperTransferEvent, )
A hopper at pos began an item transfer attempt. This runs after its
cooldown and enabled checks, before pushing or pulling any items.
Server-side, including the single-player server.
Side: server.
fn prepare_item_craft(
&self,
host: &mut dyn ServerHost,
event: &mut PrepareItemCraftEvent<'_>,
) -> Option<ItemStack>
fn prepare_item_craft( &self, host: &mut dyn ServerHost, event: &mut PrepareItemCraftEvent<'_>, ) -> Option<ItemStack>
A crafting-grid result was prepared for a server player; pos is the crafting table, or None for the inventory grid. Change result before it is sent.
Side: server.
Return Some to set result; the first mod returning Some wins.
fn prepare_item_enchant(
&self,
host: &mut dyn ServerHost,
event: &mut PrepareItemEnchantEvent<'_>,
)
fn prepare_item_enchant( &self, host: &mut dyn ServerHost, event: &mut PrepareItemEnchantEvent<'_>, )
Enchanting offers were calculated for a server player at pos. Change costs before they are sent to the menu.
Side: server.
fn prepare_smithing(
&self,
host: &mut dyn ServerHost,
event: &mut PrepareSmithingEvent<'_>,
) -> Option<ItemStack>
fn prepare_smithing( &self, host: &mut dyn ServerHost, event: &mut PrepareSmithingEvent<'_>, ) -> Option<ItemStack>
A smithing result was prepared for a server player at pos. Change it before it is sent.
Side: server.
Return Some to set result; the first mod returning Some wins.
fn projectile_launch(
&self,
host: &mut dyn ServerHost,
event: &mut ProjectileLaunchEvent<'_>,
)
fn projectile_launch( &self, host: &mut dyn ServerHost, event: &mut ProjectileLaunchEvent<'_>, )
A server projectile was added to the level. player is set only for
a player launch; other sources have an empty name.
Side: server.
fn raid_spawn_wave(
&self,
host: &mut dyn ServerHost,
event: &mut RaidSpawnWaveEvent,
)
fn raid_spawn_wave( &self, host: &mut dyn ServerHost, event: &mut RaidSpawnWaveEvent, )
A raid wave has been spawned at pos; wave is its one-based wave
number and raiders counts the raiders, not the mobs they ride.
Side: server.
fn raid_state_change(
&self,
host: &mut dyn ServerHost,
event: &mut RaidStateChangeEvent<'_>,
)
fn raid_state_change( &self, host: &mut dyn ServerHost, event: &mut RaidStateChangeEvent<'_>, )
A server raid at pos changed to state (triggered, victory,
loss or stopped). raid identifies its owning level, including a
parked level. A terminal raid already removed from storage cannot be read.
Side: server.
fn sculk_bloom(
&self,
host: &mut dyn ServerHost,
event: &mut SculkBloomEvent<'_>,
)
fn sculk_bloom( &self, host: &mut dyn ServerHost, event: &mut SculkBloomEvent<'_>, )
A sculk catalyst at pos has begun blooming after taking experience.
The catalyst block state has changed. Server-side.
Side: server.
fn sleep_finished_time(
&self,
host: &mut dyn ServerHost,
event: &mut SleepFinishedTimeEvent<'_>,
) -> Flow
fn sleep_finished_time( &self, host: &mut dyn ServerHost, event: &mut SleepFinishedTimeEvent<'_>, ) -> Flow
Enough players have slept through the night in level dimension
and the clock is about to move to the morning (NeoForge’s
SleepFinishedTimeEvent, vanilla’s ServerLevel.tick when it moves
the clock to wake_up_from_sleep): new_time comes in as the next
morning’s day time and may be changed to wake everyone at another
time. A time before current (the day time now) is refused, as
setTimeAddition refuses one, and the morning stays. Unlike
NeoForge, which refuses a bad value as it is set, the check runs once
after every mod, so a later mod sees the value an earlier one left.
On the server, only when the advance_time rule is on;
native_time_skip then hears the jump to the time chosen here and
may still cancel it. The players wake and the weather resets as
usual either way. Set canceled and the clock is left where it is, as NeoForge’s cancel leaves it:
native_time_skip is not asked either.
Side: server.
Return Flow::Cancel to take it: this sets canceled, and later mods are skipped unless they
listen with #[listener(receive_cancelled)]; those see event.cancelled and may set it back to
false.
fn sponge_absorb(&self, level: &dyn LevelHost, event: &mut SpongeAbsorbEvent)
fn sponge_absorb(&self, level: &dyn LevelHost, event: &mut SpongeAbsorbEvent)
A sponge at pos absorbed water and became wet. Server-side.
Side: server.
fn tab_complete(
&self,
host: &mut dyn ServerHost,
event: &mut TabCompleteEvent<'_>,
)
fn tab_complete( &self, host: &mut dyn ServerHost, event: &mut TabCompleteEvent<'_>, )
A guest asked to complete command; owned API Suggestion records may be
added to or filtered from suggestions. range is the replaced byte range.
The game snapshots completions only when a listener subscribes.
Side: server.
Every mod gets event.suggestions in order and may add, change or remove suggestions.
fn target_hit(&self, host: &mut dyn ServerHost, event: &mut TargetHitEvent<'_>)
fn target_hit(&self, host: &mut dyn ServerHost, event: &mut TargetHitEvent<'_>)
A projectile hit the target block at pos, which now has strength
output power. Server-side.
Side: server.
fn thunder_change(
&self,
host: &mut dyn ServerHost,
event: &mut ThunderChangeEvent<'_>,
) -> Flow
fn thunder_change( &self, host: &mut dyn ServerHost, event: &mut ThunderChangeEvent<'_>, ) -> Flow
The server changed its thunder state through /weather. Set cancel
to keep the previous thunder state and timer. Server-side.
Side: server.
Return Flow::Cancel to take it: this sets cancel, and later mods are skipped unless they
listen with #[listener(receive_cancelled)]; those see event.cancelled and may set it back to
false.
fn time_skip(
&self,
host: &mut dyn ServerHost,
event: &mut TimeSkipEvent<'_>,
) -> Flow
fn time_skip( &self, host: &mut dyn ServerHost, event: &mut TimeSkipEvent<'_>, ) -> Flow
The overworld clock is about to jump, from sleep or /time. Set
cancel to keep from.
Side: server.
Return Flow::Cancel to take it: this sets cancel, and later mods are skipped unless they
listen with #[listener(receive_cancelled)]; those see event.cancelled and may set it back to
false.
fn trade_select(
&self,
host: &mut dyn ServerHost,
event: &mut TradeSelectEvent<'_>,
)
fn trade_select( &self, host: &mut dyn ServerHost, event: &mut TradeSelectEvent<'_>, )
A server player selected trade index from villager in the trading menu.
Side: server.
fn trade_with_villager(
&self,
host: &mut dyn ServerHost,
event: &mut TradeWithVillagerEvent<'_>,
)
fn trade_with_villager( &self, host: &mut dyn ServerHost, event: &mut TradeWithVillagerEvent<'_>, )
A trade of a villager or a wandering trader was made
(MerchantResultSlot.onTake once the offer is taken): merchant is
the trader’s entity id and kind its type (minecraft:villager,
minecraft:wandering_trader), offer the live one in the trading
session (not a copy) as the trade left it: uses counted, result
what the player got. Once per trade, so a shift-click that trades
several times is heard for each, after the trade’s statistic and
villager_trade trigger. A mod may change the offer (Bukkit’s
PlayerTradeEvent#getTrade is mutable): uses, max_uses, demand,
special_price_diff, price_multiplier, xp. The change stands: the
next click and the offers sent to the player see it. Not asked for a
trade window without a trader. The player’s state is swapped in
(host.players().acting_player()). Server-side. Version 2: was a listen hook
returning the offer read-only; now collects the live offer as out
(the moment upstream’s separate merchant_offer_traded covered).
Side: server.
Every mod gets event.offer in order and may add, change or remove offer.
fn vault_change_state(
&self,
host: &mut dyn ServerHost,
event: &mut VaultChangeStateEvent<'_>,
)
fn vault_change_state( &self, host: &mut dyn ServerHost, event: &mut VaultChangeStateEvent<'_>, )
A vault at pos changed to state. Its block state is updated.
Server-side.
Side: server.
fn vault_loot(&self, host: &mut dyn ServerHost, event: &mut VaultLootEvent<'_>)
fn vault_loot(&self, host: &mut dyn ServerHost, event: &mut VaultLootEvent<'_>)
A vault at pos is about to eject a loot item.
Side: server.
fn weather_change(
&self,
host: &mut dyn ServerHost,
event: &mut WeatherChangeEvent<'_>,
) -> Flow
fn weather_change( &self, host: &mut dyn ServerHost, event: &mut WeatherChangeEvent<'_>, ) -> Flow
The server changed its weather parameters. raining and thundering
are the requested final states. Set cancel to keep the previous
weather parameters. Server-side.
Side: server.
Return Flow::Cancel to take it: this sets cancel, and later mods are skipped unless they
listen with #[listener(receive_cancelled)]; those see event.cancelled and may set it back to
false.
fn whitelist_state_update(
&self,
host: &mut dyn ServerHost,
event: &mut WhitelistStateUpdateEvent,
)
fn whitelist_state_update( &self, host: &mut dyn ServerHost, event: &mut WhitelistStateUpdateEvent, )
The dedicated server’s whitelist changed to enabled.
Side: server.
fn world_border_bounds_change_finish(
&self,
host: &mut dyn ServerHost,
event: &mut WorldBorderBoundsChangeFinishEvent,
)
fn world_border_bounds_change_finish( &self, host: &mut dyn ServerHost, event: &mut WorldBorderBoundsChangeFinishEvent, )
A timed world-border size change finished on the server, after its final size was applied. Server-side, including the single-player server. Side: server.
fn world_saved(&self, host: &mut dyn ServerHost, event: &mut WorldSavedEvent)
fn world_saved(&self, host: &mut dyn ServerHost, event: &mut WorldSavedEvent)
The server completed a world save cycle. wait says chunk writes were
flushed before returning.
Side: server.
fn living_drown(
&self,
context: &dyn LoopContext,
event: &mut LivingDrownEvent<'_>,
) -> Flow
fn living_drown( &self, context: &dyn LoopContext, event: &mut LivingDrownEvent<'_>, ) -> Flow
An entity that can’t breathe and has no air (LivingDrownEvent, posted
from LivingEntity.baseTick), with vanilla’s answers as the defaults: it
drowns at -20 air, for 2 damage and 8 bubbles. Change is_drowning or
damage_amount, or cancel to skip drowning this tick. Bubble count is
read-only; changes to the event field do not affect the vanilla entity
event. Asked on servers, for the entities native_living_breathe is.
It is given the loop context of the server that ticks the entity (its
registries, settings and mod list), because it fires inside the tick’s
own air and damage update.
Side: server.
Return Flow::Cancel to take it: this sets cancel, and later mods are skipped unless they
listen with #[listener(receive_cancelled)]; those see event.cancelled and may set it back to
false.
fn living_fall(
&self,
context: &dyn LoopContext,
event: &mut LivingFallEvent<'_>,
) -> Flow
fn living_fall( &self, context: &dyn LoopContext, event: &mut LivingFallEvent<'_>, ) -> Flow
A living entity is about to handle a fall (LivingFallEvent). Mods may
change the distance and damage multiplier, or cancel fall handling. It is given the loop context of the side that ticks the entity (its registries, settings and mod list); it fires inside the tick’s own landing, before its damage and block effects, so it takes no Host.
Side: both.
Return Flow::Cancel to take it: this sets cancel, and later mods are skipped unless they
listen with #[listener(receive_cancelled)]; those see event.cancelled and may set it back to
false.
fn living_heal(
&self,
context: &dyn LoopContext,
event: &mut LivingHealEvent,
) -> Flow
fn living_heal( &self, context: &dyn LoopContext, event: &mut LivingHealEvent, ) -> Flow
A living entity is about to heal. Mods may change the amount or cancel.
entity identifies the affected entity. It is given the loop context of the side that ticks the entity (its registries, settings and mod list), because it fires inside the tick’s own health update, where a deferred call would reorder vanilla’s effects.
Side: both.
Return Flow::Cancel to take it: this sets cancel, and later mods are skipped unless they
listen with #[listener(receive_cancelled)]; those see event.cancelled and may set it back to
false.
fn living_jump(
&self,
context: &dyn LoopContext,
event: &mut LivingJumpEvent<'_>,
)
fn living_jump( &self, context: &dyn LoopContext, event: &mut LivingJumpEvent<'_>, )
A living entity jumped (LivingEvent.LivingJumpEvent). It is given the loop context of the side that ticks the entity (its registries, settings and mod list); it fires inside the tick’s own jump, after the velocity write, so it takes no Host.
Side: both.
fn add_attribute_tooltips(
&self,
host: &dyn ClientHost,
event: &mut AddAttributeTooltipsEvent<'_>,
)
fn add_attribute_tooltips( &self, host: &dyn ClientHost, event: &mut AddAttributeTooltipsEvent<'_>, )
AddAttributeTooltipsEvent: the lines that follow a stack’s attribute lines
(ItemStack.addAttributeTooltips), after the modifiers the stack shows and
gather_skipped_attribute_tooltips left in. Push lines to lines, each with a colour as
rgba packs it (u32::MAX keeps the text’s own); they land beside the attribute lines
without finding where those end. shown is whether the stack’s
minecraft:tooltip_display shows the attribute modifiers (shouldShow); the hook is
asked either way. player and player_entity_id are the local player’s,
None for the recipe book’s search text, which has none and drops the colours, and for a stack
nested in another’s tooltip (a crossbow’s loaded projectile); advanced
(F3+H) and creative (a creative tab’s own slot) are the tooltip’s TooltipFlag. Asked
each frame the tooltip shows, only while a mod listens. Client-side.
A component deeper than 512 nodes refuses capture or the whole writeback;
no event field is applied if any Text field fails conversion.
Side: client.
fn add_client_reload_listeners(
&self,
host: &dyn ClientHost,
event: &mut AddClientReloadListenersEvent<'_>,
)
fn add_client_reload_listeners( &self, host: &dyn ClientHost, event: &mut AddClientReloadListenersEvent<'_>, )
Register client asset reload listeners before a reload stages its
assets (NeoForge’s AddClientReloadListenersEvent, the client’s
counterpart of native_add_server_reload_listeners): the first load
on the loader thread, then every later reload — the player
changed resource packs, F3+T was pressed, or a server sent its packs.
The listener’s prepare then reads the merged asset view with
resource-pack overrides resolved, and its returned apply publishes the
parsed state, all applies after all prepares, before
native_client_resources_reloaded. A listener that returns an error
aborts the reload and keeps every listener’s previous assets.
Client-side, in Reloading nested in Setup initially and World later.
Later registration is on the render thread, prepare on the loader,
and apply on the owning game thread; completion restores the entering
phase. Startup’s empty Host grants no extra access.
Side: client.
fn add_pack_finders(
&self,
host: HostSide<'_>,
event: &mut AddPackFindersEvent<'_>,
)
fn add_pack_finders( &self, host: HostSide<'_>, event: &mut AddPackFindersEvent<'_>, )
Add discoverable resource or data packs before a repository selects its
packs (AddPackFindersEvent). The builder reports the repository’s pack
type. Runs at startup and whenever that repository is rediscovered; no
world state is available during startup registration.
Side: both.
fn add_section_geometry(
&self,
context: &RegistrationContext,
event: &mut AddSectionGeometryEvent<'_>,
)
fn add_section_geometry( &self, context: &RegistrationContext, event: &mut AddSectionGeometryEvent<'_>, )
Extra geometry in chunk section meshes (NeoForge’s AddSectionGeometryEvent):
register(renderer) adds the mod’s own SectionGeometry, which the mesher asks to add its
quads every time it meshes a section, on its worker threads. The quads are part of that
section’s mesh: they follow its rebuilds, are never drawn twice, and go when it unloads.
Asked once at start on the client, before resources load.
Side: client.
fn add_server_reload_listeners(
&self,
host: &dyn Host,
event: &mut AddServerReloadListenersEvent<'_>,
)
fn add_server_reload_listeners( &self, host: &dyn Host, event: &mut AddServerReloadListenersEvent<'_>, )
Register server data reload listeners after packs are selected. The
host gives registry access at registration, as
AddServerReloadListenersEvent.getRegistryAccess does. Runs every data
load on the owning server thread in Reloading: only registry facts,
settings and mod-list reads are available through this Host. World
handles, services and transactions panic naming the phase. Existing
data-load callbacks retain their DataLoadContext; no setup event is added.
Side: server.
fn alter_ground(
&self,
context: &dyn WorldgenHost,
event: &mut AlterGroundEvent<'_>,
)
fn alter_ground( &self, context: &dyn WorldgenHost, event: &mut AlterGroundEvent<'_>, )
A tree’s alter_ground decorator (AlterGroundDecorator.place, the
podzol under a big spruce) is about to turn the ground around
positions: the lowest of its trunk or roots (logs if it has no roots,
logs and roots when they start level, else roots); only those at
the first one’s Y are placed around. logs, leaves and roots are the
decorator context’s lists, each sorted by Y. Set provider to your own
GroundProvider::Mod to choose the ground; to change it only where you
like, wrap the provider you found and ask it for the rest, since several
mods may each wrap the one before. Once per decorated tree, before any
ground is placed; the hook itself draws nothing. Server-side, on the
worldgen worker threads (and on the server thread when a sapling grows),
with the server’s worldgen context: no Host, no writes.
Side: server.
Every mod gets event.provider in order and may add, change or remove provider.
fn animal_tame(
&self,
host: &mut dyn ServerHost,
event: &mut AnimalTameEvent<'_>,
) -> Flow
fn animal_tame( &self, host: &mut dyn ServerHost, event: &mut AnimalTameEvent<'_>, ) -> Flow
The player tamer (UUID) and tamer_entity_id is about to tame the
mob entity of kind (AnimalTameEvent): its taming roll succeeded
(a wolf’s bone, a cat’s fish, a parrot’s seeds or a nautilus’s food;
a horse, donkey, mule or llama the player rides). Set cancel for the
attempt to fail instead, as a failed roll does: smoke for a pet, and
a horse bucks its rider off. Before entity_tame. Server-side.
Side: server.
Return Flow::Cancel to take it: this sets cancel, and later mods are skipped unless they
listen with #[listener(receive_cancelled)]; those see event.cancelled and may set it back to
false.
fn anvil_update(
&self,
host: HostSide<'_>,
event: &mut AnvilUpdateEvent<'_>,
) -> Flow
fn anvil_update( &self, host: HostSide<'_>, event: &mut AnvilUpdateEvent<'_>, ) -> Flow
An anvil at pos made vanilla’s result with a left input, for
player (UUID) and player_entity_id (AnvilUpdateEvent, after
AnvilMenu.createResult), whenever an input or the name changed:
update holds the inputs (the right one may be empty, for a rename),
the rename text and vanilla’s result, and its output, xp_cost
and material_cost start at vanilla’s for the mods to change; set
cancel for no result. The signed XP cost is preserved; a cost of
zero or less prevents taking the output, not a level refund. Negative
material costs are clamped to zero. Both sides: the server’s menu,
and a server’s client menu with the local player.
Side: both.
Return Flow::Cancel to take it: this sets cancel, and later mods are skipped unless they
listen with #[listener(receive_cancelled)]; those see event.cancelled and may set it back to
false.
fn arm_pose_transform(
&self,
host: &dyn ClientHost,
event: &mut ArmPoseTransformEvent<'_>,
)
fn arm_pose_transform( &self, host: &dyn ClientHost, event: &mut ArmPoseTransformEvent<'_>, )
Apply a registered pose (HumanoidModel.ArmPose’s transformer).
Asked only for a selected registered pose, once per model and arm during
humanoid extraction, in vanilla’s physical-arm application order. Suppressed
poses do not call the transformer. humanoid contains the selected poses
after get_arm_pose answers. right_arm identifies the physical arm, not the hand.
Write absolute pitch, yaw and roll in radians into angles; initially all
components are non-finite, meaning preserve the base model angle. Each
non-finite component is ignored. The ordinary swing and species animations
still run afterward. Native and wasm mods receive the same value contract.
Side: client.
fn armor_hurt(
&self,
host: &mut dyn ServerHost,
event: &mut ArmorHurtEvent<'_>,
) -> Flow
fn armor_hurt( &self, host: &mut dyn ServerHost, event: &mut ArmorHurtEvent<'_>, ) -> Flow
Armor is about to take durability damage from a hit (NeoForge’s
ArmorHurtEvent, vanilla’s LivingEntity.doHurtEquipment): once per
hit, for the pieces that would wear, and first for the helmet alone when a
falling block hits a player (hurtHelmet). entity is the wearer’s entity id,
player its UUID (None for a mob), kind its type and source the hit’s
damage type (causing and direct are 0: the hit does not carry them here). Each entry has
its slot, the stack, the damage vanilla worked out and a
new_damage a mod may change (0 for none; Unbreaking is applied
after). Canceling means no armor damage. A server player’s feet,
legs, chest and head; a mob’s body (a horse’s armor).
Server-side.
Side: server.
Return Flow::Cancel to take it: this sets cancel, and later mods are skipped unless they
listen with #[listener(receive_cancelled)]; those see event.cancelled and may set it back to
false.
fn arrow_nock(
&self,
host: &mut dyn ServerHost,
event: &mut ArrowNockEvent<'_>,
) -> Flow
fn arrow_nock( &self, host: &mut dyn ServerHost, event: &mut ArrowNockEvent<'_>, ) -> Flow
A player is about to nock bow with hand (BowItem.use, NeoForge’s
ArrowNockEvent): has_ammo is whether getProjectile found ammunition
or the player is in creative. Set cancel to fail the use.
Side: server.
Return Flow::Cancel to take it: this sets cancel, and later mods are skipped unless they
listen with #[listener(receive_cancelled)]; those see event.cancelled and may set it back to
false.
fn baby_entity_spawn(
&self,
host: &mut dyn ServerHost,
event: &mut BabyEntitySpawnEvent<'_>,
) -> Flow
fn baby_entity_spawn( &self, host: &mut dyn ServerHost, event: &mut BabyEntitySpawnEvent<'_>, ) -> Flow
Two animals bred and a baby is about to be made (NeoForge’s
BabyEntitySpawnEvent, vanilla’s Animal.spawnChildFromBreeding):
parent and partner are entity ids, player and player_entity_id
the UUID and entity id of the player who fed them into love
(getCausedByPlayer, None when none), kind the baby’s type (a horse
and a donkey have a mule). NeoForge’s setChild (another baby)
needs a handle to a mob not yet in the world, which Horizon doesn’t
have yet. Set cancel for no baby: the
parents still rest and lose their love (their ages were already set
to 6000), but there is no baby, no experience, no animals_bred
statistic, no advancement and no heart particles. Not fired for
turtles, frogs and sniffers (an egg, no baby), villagers or
armadillos’ own paths. On the server.
Side: server.
Return Flow::Cancel to take it: this sets cancel, and later mods are skipped unless they
listen with #[listener(receive_cancelled)]; those see event.cancelled and may set it back to
false.
fn bake_model_loader(
&self,
context: &RegistrationContext,
event: &mut BakeModelLoaderEvent<'_>,
)
fn bake_model_loader( &self, context: &RegistrationContext, event: &mut BakeModelLoaderEvent<'_>, )
A model whose loader a mod registered (register_model_loaders) is baked: push its
quads to quads for a loader your mod owns. config is the model’s JSON object converted
to a Tag, and model names the model. It is asked once per model on each resource load,
on the resource loader, never per frame.
Side: client.
Every mod gets event.quads in order and may add, change or remove quads.
fn block_drops(
&self,
level: &dyn LevelHost,
event: &mut BlockDropsEvent<'_>,
) -> Flow
fn block_drops( &self, level: &dyn LevelHost, event: &mut BlockDropsEvent<'_>, ) -> Flow
NeoForge’s BlockDropsEvent: a block state broke at pos and Block.dropResources has built the item entities drops it will spawn, but nothing is in the world yet. breaker is the breaking player’s UUID (none for a break the level makes: a piston, water, a neighbour update, /setblock destroy) and tool the stack they used (none when no tool). drops is the list Block.popResource built: each stack with the position, motion and pickup delay its item entity will have, drawn before the event as vanilla draws them, so the level random’s order does not depend on whether a mod listens. Edit the list (take out, change or add drops; empty stacks don’t spawn) or experience, the points spawnAfterBreak would award at the block’s centre (ores, sculk, spawners; silk touch has already zeroed it, as NeoForge’s description says, “the true value, after enchantments”). Set cancel and nothing spawns: no drops, no experience, and none of spawnAfterBreak’s other effects (an infested block’s silverfish); a bee nest’s bees are playerDestroy’s, not spawnAfterBreak’s, and still come out. With the block_drops rule off the list and the experience are emptied after the event. It fires on the player’s break, a mob’s block break that drops loot, explosions and every level-side Block.dropResources (a piston breaking a block, water washing one away, a removed support). Player, explosion and mob block loot passes through loot_drops first; level-side breaks are not asked loot_drops. Explosion events run after the blast has removed its blocks and merged their loot, before any items spawn, with no breaker or tool and zero initial experience. Each block’s event owns only its share of a merged stack, at that entity’s prepared position and velocity; cancellation cannot remove another block’s share. Unchanged shares rejoin the original merged entity, while edited or added entities spawn exactly as returned. Even a block with no loot gets an event (TNT that primes instead does not). Neither registration nor a no-op listener changes the merge or the level random’s draws. It does not fire for dispensers or a block’s own loot-table drop through another path. It runs inside the level’s write, so the level host reads blocks and draws the level’s random in vanilla’s order and writes nothing. Authoritative servers only. Replaces block_exp, whose catalog row named no NeoForge event (none) and fired only on the level-side path: the amount is experience here. Diverges from upstream: block_exp is removed into this hook.
Side: server.
Return Flow::Cancel to take it: this sets cancel, and later mods are skipped unless they
listen with #[listener(receive_cancelled)]; those see event.cancelled and may set it back to
false.
fn block_entity_type_add_blocks(
&self,
context: &RegistrationContext,
event: &mut BlockEntityTypeAddBlocksEvent<'_>,
)
fn block_entity_type_add_blocks( &self, context: &RegistrationContext, event: &mut BlockEntityTypeAddBlocksEvent<'_>, )
Extend existing types’ valid blocks (NeoForge BlockEntityTypeAddBlocksEvent).
Fired after content declarations, before worlds load. types contains every
registered type. Append (type, block) pairs to additions; this never changes
the block’s factory or ticker. Filter types to implement predicate selection.
Use event.modify(kind, blocks) for a direct addition, or
event.modify_matching(predicate, blocks) for all matching registered keys.
Duplicate additions are harmless; unknown keys or incompatible classes fail startup.
Existing sign-template memberships remain valid without a listener.
Blocks must share the common vanilla superclass of the type’s existing blocks.
Side: both.
Every mod gets event.additions in order and may add, change or remove additions.
fn block_grow_feature(
&self,
level: &mut dyn LevelRandomHost,
event: &mut BlockGrowFeatureEvent<'_>,
) -> Flow
fn block_grow_feature( &self, level: &mut dyn LevelRandomHost, event: &mut BlockGrowFeatureEvent<'_>, ) -> Flow
A sapling, azalea, mushroom or fungus at pos is about to grow into the
configured feature, None when vanilla has none to place (a lone dark
oak sapling). Set cancel, or feature to None, to keep the block;
set feature to another key to grow that one. Server-side.
Mods can use level.random() to access the growth random source.
Side: server.
Return Flow::Cancel to take it: this sets cancel, and later mods are skipped unless they
listen with #[listener(receive_cancelled)]; those see event.cancelled and may set it back to
false.
fn block_screen_effect_draw(
&self,
host: &dyn ClientHost,
event: &mut BlockScreenEffectDrawEvent<'_>,
)
fn block_screen_effect_draw( &self, host: &dyn ClientHost, event: &mut BlockScreenEffectDrawEvent<'_>, )
Draw a block overlay a mod said it draws itself (custom_draw in
extract_block_screen_effect), before vanilla’s overlay of that kind, once a frame each.
A canceled overlay is asked too. Set replace_vanilla to leave vanilla’s overlay out.
effect, state and pos are the extract event’s; partial_tick is the world’s and
hide_gui says the HUD is hidden. Every mod is asked about every such overlay, so a mod
ignores those it did not claim. Client-side.
Side: client.
fn block_tool_modification(
&self,
host: &dyn Host,
event: &mut BlockToolModificationEvent<'_>,
) -> Flow
fn block_tool_modification( &self, host: &dyn Host, event: &mut BlockToolModificationEvent<'_>, ) -> Flow
A tool is about to transform a block. Cancel or replace the final state;
None suppresses the transformation.
Side: both.
Return Flow::Cancel to take it: this sets cancel, and later mods are skipped unless they
listen with #[listener(receive_cancelled)]; those see event.cancelled and may set it back to
false.
fn bonemeal(&self, host: HostSide<'_>, event: &mut BonemealEvent<'_>) -> Flow
fn bonemeal(&self, host: HostSide<'_>, event: &mut BonemealEvent<'_>) -> Flow
BonemealEvent: bone meal from stack used on the block state at
pos (BoneMealItem.growCrop), by player or, when it is None, by
a dispenser or a villager. valid_bonemeal_target is the block’s
isValidBonemealTarget. Cancel skips vanilla’s growth, the block’s
own bone meal Parts and the meal’s use: growCrop then answers
successful (setSuccessful), which is false unless a mod sets it.
Fired on both sides; changes to stack stay. Set it to None to consume
the whole stack; a nonempty result is validated before any write-back.
Side: both.
Return Flow::Cancel to take it: this sets canceled, and later mods are skipped unless they
listen with #[listener(receive_cancelled)]; those see event.cancelled and may set it back to
false.
fn build_creative_mode_tab_contents(
&self,
host: &mut dyn ClientHost,
event: &mut BuildCreativeModeTabContentsEvent<'_>,
)
fn build_creative_mode_tab_contents( &self, host: &mut dyn ClientHost, event: &mut BuildCreativeModeTabContentsEvent<'_>, )
The stacks a mod adds to the creative tab tab (minecraft:ingredients, or another mod’s
<mod id>:<name>) while the tabs’ contents are built (NeoForge’s
BuildCreativeModeTabContentsEvent, during vanilla’s CreativeModeTabs.buildAllTabContents):
push each stack to items, in order (accept). They come after the tab’s own items and
those of the mods before, and join the end of the search tab. A stack the tab or the search
tab already lists (the same item and components) is not listed twice there, and an empty
stack is left out. has_permissions is the build’s hasPermissions: whether the operator
items tab is allowed (the player can use game master blocks and the Operator Items Tab
option is on). Asked for every item tab, the operator items tab and the mods’ tabs among
them, not for the search, saved toolbars or survival inventory tabs. Asked when the tabs
are built: the first time the creative inventory opens after the game’s resources load,
and again whenever has_permissions changes. Client-side.
Side: client.
Every mod gets event.items in order and may add, change or remove items.
fn calculate_player_turn(
&self,
host: &dyn ClientHost,
event: &mut CalculatePlayerTurnEvent,
)
fn calculate_player_turn( &self, host: &dyn ClientHost, event: &mut CalculatePlayerTurnEvent, )
The mouse sensitivity and cinematic camera option a grabbed player’s
mouse turn reads this frame (MouseHandler.turnPlayer). Change either
for this turn only; the options are unchanged. Client-side.
Side: client.
fn camera_pose(&self, host: &dyn ClientHost, event: &mut CameraPoseEvent<'_>)
fn camera_pose(&self, host: &dyn ClientHost, event: &mut CameraPoseEvent<'_>)
The camera this frame is drawn from, partial ticks past the last tick, after vanilla
placed it (Camera.setup): its position, and its yaw and pitch in degrees. Set them to
draw the world from anywhere: a cinematic or replay camera. Only the picture, the sound’s
listener and the billboards facing the camera follow it; the player, where they aim, the
first-person hand and which chunks load stay the player’s. Values that aren’t finite keep
vanilla’s. Not called on the title screen’s panorama.
Side: client.
fn camera_type_cycle(
&self,
host: &mut dyn ClientHost,
event: &mut CameraTypeCycleEvent<'_>,
)
fn camera_type_cycle( &self, host: &mut dyn ClientHost, event: &mut CameraTypeCycleEvent<'_>, )
key.togglePerspective (F5) is cycling the window’s camera type (Minecraft.handleKeybinds
calling Options.setCameraType(getCameraType().cycle())): previous is the type it leaves,
and next comes in as vanilla’s next one (first person, third person behind, third person
in front, then first person again); set next to another, to skip a type or keep one.
Once a press, before the type changes; the post effect of the camera entity follows the
answer as it follows vanilla’s. camera_type and set_camera_type read and set the type
at any other moment. Client-side. Beyond NeoForge: there is no counterpart. Diverges from
upstream: new hook.
Side: client.
fn can_continue_sleeping(
&self,
host: &mut dyn ServerHost,
event: &mut CanContinueSleepingEvent<'_>,
) -> Option<bool>
fn can_continue_sleeping( &self, host: &mut dyn ServerHost, event: &mut CanContinueSleepingEvent<'_>, ) -> Option<bool>
CanContinueSleepingEvent: a sleeping living entity’s check that it may go on
sleeping, run each tick for a server player the dead and health checks would not
already wake, and for a sleeping villager or wandering trader. entity is its UUID,
name a player’s name (empty for a mob) and kind its type (minecraft:player).
problem is what vanilla found (getProblem): NotPossibleHere when the bed at pos
is gone, NotPossibleNow when a player’s bed rule no longer lets them sleep (daytime),
none when nothing is wrong. may_continue starts empty, meaning problem.is_none() (mayContinueSleeping);
set it Some(true) to keep them asleep, Some(false) to wake them. The player’s state is not swapped in
on a guest tick.
Side: server.
Return Some to set may_continue; the first mod returning Some wins.
fn can_player_sleep(
&self,
host: &mut dyn ServerHost,
event: &mut CanPlayerSleepEvent<'_>,
)
fn can_player_sleep( &self, host: &mut dyn ServerHost, event: &mut CanPlayerSleepEvent<'_>, )
A server player tries to sleep in the bed whose head is at pos
(NeoForge’s CanPlayerSleepEvent, vanilla’s ServerPlayer.startSleepInBed).
problem is what vanilla found, first problem only: too_far_away,
obstructed, not_possible_now (not night or thunder, the bed rule),
not_safe (monsters near), or None. A mod may set None to let the
player sleep anyway, or one of those names (other_problem refuses
without a message) to refuse. The spawn point is set before it fires,
as in vanilla, only when vanilla found no problem. After it,
native_player_bed_enter still fires and may cancel. Server-side.
Side: server.
fn chat_suggestion_applied(
&self,
host: &dyn ClientHost,
event: &mut ChatSuggestionAppliedEvent<'_>,
)
fn chat_suggestion_applied( &self, host: &dyn ClientHost, event: &mut ChatSuggestionAppliedEvent<'_>, )
native_chat_suggestion_applied(original, start, end, suggestion, input) reports a chat completion after Tab or a click. The range is in UTF-16 units of the list’s original input, including when cycling; input is the resulting length-limited field value. Client-only, read-only. Bundles need “hooks”: @API:chat_suggestion_applied@.
Side: client.
fn chunk_ticket_level_updated(
&self,
host: &mut dyn ServerHost,
event: &mut ChunkTicketLevelUpdatedEvent,
)
fn chunk_ticket_level_updated( &self, host: &mut dyn ServerHost, event: &mut ChunkTicketLevelUpdatedEvent, )
chunk’s ticket level went from old to new (NeoForge’s
ChunkTicketLevelUpdatedEvent, from ChunkMap.updateChunkScheduling):
a player, a forced chunk, a portal or the dragon fight’s arena began or
ceased to keep it alive or ticking. It is the level of the chunk’s
loading tickets (DistanceManager’s chunk tracker), not the
simulation distance’s. A level is a ChunkTicketLevel: the number
ChunkLevel gives, 31 and lower entity ticking, 32 block ticking and 33
loaded without ticking, or Unloaded; none is clamped to the ticking
range. Never told with old == new.
Told in order, once for each time a chunk’s level changed: a chunk that
changes twice in a tick is told twice, the second old the first new.
Within one update of the level’s tickets the chunks come by position (x,
then z), which is not vanilla’s order. A new level’s tickets tell every
chunk they keep loaded as coming from Unloaded. Told once a tick, in
the server’s tick of the level, after the tickets were updated for
every player there; a level with no player in it is not ticked and
tells nothing until it is. NeoForge’s chunkHolder is not given:
Horizon keeps no chunk holders. Server-side.
Side: server.
fn chunk_watch(&self, host: &mut dyn ServerHost, event: &mut ChunkWatchEvent)
fn chunk_watch(&self, host: &mut dyn ServerHost, event: &mut ChunkWatchEvent)
player started watching chunk (NeoForge’s ChunkWatchEvent.Watch):
the chunk came into their view and goes to their client, once until
chunk_unwatch. Vanilla tells it as the chunk is queued
(ChunkMap.markChunkPendingToSend); Horizon picks a chunk only as it
sends it, so this comes just before chunk_sent for the same chunk.
Told after the server’s network step for the level, and a handler sees
the state after that step; the order per player and chunk is vanilla’s.
Not told for the far ring’s columns past the view distance (a Horizon
server option). Server-side.
Side: server.
fn chunk_sent(&self, host: &mut dyn ServerHost, event: &mut ChunkSentEvent)
fn chunk_sent(&self, host: &mut dyn ServerHost, event: &mut ChunkSentEvent)
chunk’s packet went to player (NeoForge’s ChunkWatchEvent.Sent,
at the end of PlayerChunkSender.sendChunk), after chunk_watch, so
a mod can send its own data for the chunk now. Told after the server’s
network step for the level, with the state after that step, as
chunk_watch. Not told for the far ring’s columns. Server-side.
Side: server.
fn chunk_unwatch(
&self,
host: &mut dyn ServerHost,
event: &mut ChunkUnwatchEvent,
)
fn chunk_unwatch( &self, host: &mut dyn ServerHost, event: &mut ChunkUnwatchEvent, )
player stopped watching chunk (NeoForge’s ChunkWatchEvent.UnWatch,
ChunkMap.dropChunk): it left their view, or they leave the level
(through a portal or a teleport, or respawning) or the server. Once for
each chunk chunk_watch told of. After a disconnect the player handle
no longer reads. Told after the server’s network step for the level,
with the state after that step, as chunk_watch. Not told when the
server stops. Server-side.
Side: server.
fn client_attack_target(
&self,
host: &mut dyn ClientHost,
event: &mut ClientAttackTargetEvent<'_>,
) -> Flow
fn client_attack_target( &self, host: &mut dyn ClientHost, event: &mut ClientAttackTargetEvent<'_>, ) -> Flow
Before a client’s ordinary melee click attacks entities (not a spear jab), after the
interaction-key cancellation hook. targets starts with the crosshair entity, if any.
Replace, clear or append targets for redirected or multi-target hits. There is no batch
cap. Duplicates are sent once, in first-occurrence order. Every target is rechecked for
the current client epoch, attackability, reach,
held-item range and occlusion. Clearing an entity hit does not mine the block behind
it; an untouched empty list keeps vanilla’s block/miss path. Server checks and cooldowns
still apply to every attack. Returning Flow::Cancel cancels the whole batch.
No NeoForge bus counterpart; client-side only.
Side: client.
Return Flow::Cancel to take it: this sets canceled, and later mods are skipped unless they
listen with #[listener(receive_cancelled)]; those see event.cancelled and may set it back to
false.
fn client_chat(
&self,
host: &mut dyn ClientHost,
event: &mut ClientChatEvent<'_>,
) -> Flow
fn client_chat( &self, host: &mut dyn ClientHost, event: &mut ClientChatEvent<'_>, ) -> Flow
NeoForge’s ClientChatEvent: a client is about to send message.
original_message is immutable; change message or set cancel to
prevent sending.
Side: client.
Return Flow::Cancel to take it: this sets cancel, and later mods are skipped unless they
listen with #[listener(receive_cancelled)]; those see event.cancelled and may set it back to
false.
fn client_chat_received(
&self,
host: &mut dyn ClientHost,
event: &mut ClientChatReceivedEvent<'_>,
) -> Flow
fn client_chat_received( &self, host: &mut dyn ClientHost, event: &mut ClientChatReceivedEvent<'_>, ) -> Flow
NeoForge’s ClientChatReceivedEvent: a chat line from the server is
about to show, once Chat Delay lets it through. system is a system
message (ClientChatReceivedEvent.System), shown in the action bar
when overlay is set; otherwise a player or disguised message in its
chat type chat_type (getBoundChatType, its registry name; None
for a system message or an inline chat type). sender is the player’s
UUID, 0 (Util.NIL_UUID) for system and disguised messages. message
starts as the decorated line; replace it and the chat shows the new
one, while the narrator still says the original. Set cancel and it
doesn’t show: a delayed message lets the next one through. Lines the
client adds itself and validation errors are not told. Client-side.
Side: client.
Return Flow::Cancel to take it: this sets cancel, and later mods are skipped unless they
listen with #[listener(receive_cancelled)]; those see event.cancelled and may set it back to
false.
fn client_information_updated(
&self,
host: &mut dyn ServerHost,
event: &mut ClientInformationUpdatedEvent<'_>,
)
fn client_information_updated( &self, host: &mut dyn ServerHost, event: &mut ClientInformationUpdatedEvent<'_>, )
NeoForge’s ClientInformationUpdatedEvent: a server player’s client sent new
client information (language, view distance, chat, skin parts, main hand,
filtering, listing, particles) in play. old and new are the values before and
after this packet, one call per packet; they can be equal. The join’s own
information (the configuration phase, ServerPlayer’s constructor) is not
reported. The player is not swapped in. Server-side.
Side: server.
fn client_mining_predict(
&self,
host: &dyn ClientHost,
event: &mut ClientMiningPredictEvent,
) -> Flow
fn client_mining_predict( &self, host: &dyn ClientHost, event: &mut ClientMiningPredictEvent, ) -> Flow
Veto a predicted client dig after the interaction mapping and vanilla eligibility checks. Auto-tool and mining overlay mods can use this instead of a mining prediction mixin. The snapshot is read-only. A veto skips the new mining operation and preserves any retained dig. Release and correction still perform ordinary cleanup. Side: client.
Return Flow::Cancel to take it: this sets canceled, and later mods are skipped unless they
listen with #[listener(receive_cancelled)]; those see event.cancelled and may set it back to
false.
fn client_packet(
&self,
host: &mut dyn ClientHost,
event: &mut ClientPacketEvent<'_>,
)
fn client_packet( &self, host: &mut dyn ClientHost, event: &mut ClientPacketEvent<'_>, )
A play packet from the server reached the window’s game, decoded,
just before the game handles it (Connection.genericsFtw handing it
to ClientPacketListener): every packet of the play phase, custom
payloads included, in the order the server sent them. Packets the
network thread handles itself are not heard: keep-alives, bundle
delimiters, resource pack pushes and pops, cookies, server links,
transfers, disconnects, the configuration switch, minecraft:brand
and far terrain tiles; neither is the configuration phase.
Read-only: the game handles the packet as it would without the mod.
Client-side, on any server, single player’s own included.
Every packet exposes its protocol type id. Custom payloads also expose
their channel and raw bytes; no other decoded fields cross the API.
Side: client.
fn client_packet_send(
&self,
host: &dyn ClientHost,
event: &mut ClientPacketSendEvent<'_>,
) -> Flow
fn client_packet_send( &self, host: &dyn ClientHost, event: &mut ClientPacketSendEvent<'_>, ) -> Flow
A play packet the window’s game is about to send to the server (Connection.send):
every packet of the play phase it sends, in the order it sends them, the selected slot
that goes out before an attack or a use included. Not heard: what the network thread
sends itself (keep-alives, configuration pongs, cookies, the configuration phase), the answers the
connection sends in whichever phase it is in (a resource pack’s status, a dialog’s custom
click action), and far terrain requests. Cancel drops the packet: the game goes on as if
it had been sent, so the server never hears of it. Client-side, on any server, single
player’s own included. Every packet exposes its protocol type id; custom payloads also
expose their channel and raw bytes, as client_packet does for the packets that arrive.
Play-phase pongs pass through this hook; return Flow::Cancel to drop a packet.
Beyond NeoForge: there is no counterpart. Diverges from upstream: new hook.
Side: client.
Return Flow::Cancel to take it: this sets canceled, and later mods are skipped unless they
listen with #[listener(receive_cancelled)]; those see event.cancelled and may set it back to
false.
fn client_pause_change_pre(
&self,
host: &mut dyn ClientHost,
event: &mut ClientPauseChangePreEvent,
) -> Flow
fn client_pause_change_pre( &self, host: &mut dyn ClientHost, event: &mut ClientPauseChangePreEvent, ) -> Flow
NeoForge’s ClientPauseChangeEvent.Pre: cancel a proposed pause change.
Side: client.
Return Flow::Cancel to take it: this sets cancel, and later mods are skipped unless they
listen with #[listener(receive_cancelled)]; those see event.cancelled and may set it back to
false.
fn client_pause_change_post(
&self,
host: &mut dyn ClientHost,
event: &mut ClientPauseChangePostEvent,
)
fn client_pause_change_post( &self, host: &mut dyn ClientHost, event: &mut ClientPauseChangePostEvent, )
NeoForge’s ClientPauseChangeEvent.Post: the pause state changed.
Side: client.
fn client_player_change_game_type(
&self,
host: &mut dyn ClientHost,
event: &mut ClientPlayerChangeGameTypeEvent,
)
fn client_player_change_game_type( &self, host: &mut dyn ClientHost, event: &mut ClientPlayerChangeGameTypeEvent, )
NeoForge’s ClientPlayerChangeGameTypeEvent: observe the local player info game type change.
Side: client.
fn client_player_clone(
&self,
host: &mut dyn ClientHost,
event: &mut ClientPlayerCloneEvent,
)
fn client_player_clone( &self, host: &mut dyn ClientHost, event: &mut ClientPlayerCloneEvent, )
After the client replaces its player on respawn or dimension change
(NeoForge’s ClientPlayerNetworkEvent.Clone). Client-side.
Side: client.
fn client_player_logging_in(
&self,
host: &mut dyn ClientHost,
event: &mut ClientPlayerLoggingInEvent,
)
fn client_player_logging_in( &self, host: &mut dyn ClientHost, event: &mut ClientPlayerLoggingInEvent, )
The client accepted a play login and initialized its level and player
identity (NeoForge’s ClientPlayerNetworkEvent.LoggingIn). player_id
is the server’s entity ID. Client-side,
once per connection, including single player.
Side: client.
fn client_player_logging_out(
&self,
host: &mut dyn ClientHost,
event: &mut ClientPlayerLoggingOutEvent,
)
fn client_player_logging_out( &self, host: &mut dyn ClientHost, event: &mut ClientPlayerLoggingOutEvent, )
Before client disconnect teardown (NeoForge’s
ClientPlayerNetworkEvent.LoggingOut). The player may be absent.
Client-side.
Side: client.
fn client_disconnecting(
&self,
host: &dyn ClientHost,
event: &mut ClientDisconnectingEvent,
)
fn client_disconnecting( &self, host: &dyn ClientHost, event: &mut ClientDisconnectingEvent, )
Before an actual connection is discarded, not on a dimension change. Side: client.
The normal menu blur request, before finite/range validation. None disables it. Side: client.
fn client_setup(&self, host: &mut dyn ClientHost, event: &mut ClientSetupEvent)
fn client_setup(&self, host: &mut dyn ClientHost, event: &mut ClientSetupEvent)
NeoForge’s FMLClientSetupEvent: the client has started. It fires once per game
process, on the render thread, after the first client load has applied (the
atlas, models and every client reload listener’s published state are final)
and before the title screen’s first frame. Returning to the title screen and
opening another world, or adding a splitscreen player, is not a new start, so
it never fires again. This is
the opposite of client_resources_reloaded, which never runs at initial
startup and runs after every later reload. The listener runs on the main thread;
work a mod wants done in parallel is its own. The dedicated server has no client and never fires it
(see server_about_to_start for its FMLDedicatedServerSetupEvent). A
Setup permits client resource reads, not world handles or transactions.
The listener is a pure function of its ClientHost reads and its own state.
Side: client.
fn client_stopped(
&self,
host: &mut dyn ClientHost,
event: &mut ClientStoppedEvent,
)
fn client_stopped( &self, host: &mut dyn ClientHost, event: &mut ClientStoppedEvent, )
The client has finished shutting down, after client_stopping. Fires once
on the render thread for an orderly client exit, not for a dedicated server
or a splitscreen guest. NeoForge’s ClientStoppedEvent.
Side: client.
fn client_stopping(
&self,
host: &mut dyn ClientHost,
event: &mut ClientStoppingEvent,
)
fn client_stopping( &self, host: &mut dyn ClientHost, event: &mut ClientStoppingEvent, )
The client is closing: it fires once per game process, on the render thread,
when the game shuts down, after the world the player was in is left and
saved, while the game still holds its settings and resources, so a listener
can read them through the ClientHost and save its own client state. It is the closing counterpart of client_setup.
Closing the window, a quit shortcut and the process’s stop signals all reach
it; a crash does not. A dedicated server has no client and never fires it
(server_stopping is its stop), and neither does a splitscreen guest’s game, as
client_setup skips it. Fabric’s ClientLifecycleEvents.CLIENT_STOPPING
fires earlier, before the integrated server stops, so it is not a counterpart.
NeoForge has no event for this moment. A listener is a pure function of its
ClientHost reads and its own state.
Side: client.
fn client_tick_post(
&self,
host: &mut dyn ClientHost,
event: &mut ClientTickPostEvent,
)
fn client_tick_post( &self, host: &mut dyn ClientHost, event: &mut ClientTickPostEvent, )
Once every client tick, paused or not and on the title screen too, after the window’s tick ran (NeoForge’s
ClientTickEvent.Post): the window’s Game only, so not on a server’s
own tick (server_tick is that moment). Client-side.
Side: client.
fn client_tick_pre(
&self,
host: &mut dyn ClientHost,
event: &mut ClientTickPreEvent,
)
fn client_tick_pre( &self, host: &mut dyn ClientHost, event: &mut ClientTickPreEvent, )
Once every client tick, paused or not and on the title screen too, before the window’s tick runs (NeoForge’s
ClientTickEvent.Pre): the window’s Game only, so not on a server’s
own tick (server_tick is that moment). Client-side.
Side: client.
fn component_hover(
&self,
host: &dyn ClientHost,
event: &mut ComponentHoverEvent<'_>,
) -> Flow
fn component_hover( &self, host: &dyn ClientHost, event: &mut ComponentHoverEvent<'_>, ) -> Flow
GuiGraphicsExtractor.componentHoverEffect: the hover of the text component under the
cursor, about to be drawn, in the chat, a book or a dialog. hover is the component’s
hover action: its text, an item or an entity. x and y are the cursor in GUI pixels.
Set cancel and the game draws nothing for it: no text tooltip, no item tooltip and no
entity lines. A mod can draw its own with draw. Left alone, a text hover is wrapped at
half the screen’s width (at least 200) as vanilla wraps it, an item hover draws its stack’s
tooltip (which asks item_tooltip and the render_tooltip_* hooks as any item tooltip
does), and an entity hover shows its name, type and UUID while advanced tooltips are on.
Asked each frame a hovered component shows, only while a mod listens. Client-side.
Side: client.
Return Flow::Cancel to take it: this sets cancel, and later mods are skipped unless they
listen with #[listener(receive_cancelled)]; those see event.cancelled and may set it back to
false.
fn compute_fov_modifier(
&self,
host: &dyn ClientHost,
event: &mut ComputeFovModifierEvent<'_>,
)
fn compute_fov_modifier( &self, host: &dyn ClientHost, event: &mut ComputeFovModifierEvent<'_>, )
Player FOV scale, once per client tick with a player, after vanilla effects and before zoom and easing. Invalid values or values outside 0.01..=10 revert to base. Side: client.
fn create_fluid_source(
&self,
level: &dyn LevelHost,
event: &mut CreateFluidSourceEvent,
)
fn create_fluid_source( &self, level: &dyn LevelHost, event: &mut CreateFluidSourceEvent, )
A fluid source at pos (state) is about to count towards turning
the flowing fluid beside it into a source (NeoForge’s
CreateFluidSourceEvent, FlowingFluid.getNewLiquid): two counted
sources beside a block over a solid block or a source make it one.
Asked for each horizontal neighbour source, whenever the game works
out a block’s new fluid, spread checks included: answer fast.
can_convert starts as the fluid’s rule (water_source_conversion
or lava_source_conversion). Server-side.
Side: server.
fn create_spawn_position(
&self,
host: &mut dyn ServerHost,
event: &mut CreateSpawnPositionEvent<'_>,
) -> Flow
fn create_spawn_position( &self, host: &mut dyn ServerHost, event: &mut CreateSpawnPositionEvent<'_>, ) -> Flow
Before a new server level selects its initial world spawn
(NeoForge’s LevelEvent.CreateSpawnPosition).
Side: server.
Return Flow::Cancel to take it: this sets cancel, and later mods are skipped unless they
listen with #[listener(receive_cancelled)]; those see event.cancelled and may set it back to
false.
fn crop_grow_pre(
&self,
level: &mut dyn LevelRandomHost,
event: &mut CropGrowPreEvent<'_>,
)
fn crop_grow_pre( &self, level: &mut dyn LevelRandomHost, event: &mut CropGrowPreEvent<'_>, )
A crop-like block at pos is about to grow on a random tick
(NeoForge’s CropGrowEvent.Pre): crops, stems, nether wart, cocoa,
sweet berries and bamboo at their own position; cactus and chorus
flowers at the block above; sugar cane at its own position; kelp,
weeping and twisting vines and cave vines at the block they grow
into. state is the growing block. Leave result at Default for
vanilla’s own chance, or set True to grow now or False to stop
it (DO_NOT_GROW). Vanilla’s random roll is drawn either way, in
vanilla’s order. Server-side.
Side: server.
fn crop_grow_post(
&self,
level: &mut dyn LevelRandomHost,
event: &mut CropGrowPostEvent,
)
fn crop_grow_post( &self, level: &mut dyn LevelRandomHost, event: &mut CropGrowPostEvent, )
A crop-like block grew (NeoForge’s CropGrowEvent.Post).
original_state is the block before it grew and state what is at
pos now. Sugar cane reports the new cane above it, and kelp and
vines the new head, as both states. Server-side.
Side: server.
fn custom_click_action(
&self,
host: &mut dyn ServerHost,
event: &mut CustomClickActionEvent<'_>,
) -> Flow
fn custom_click_action( &self, host: &mut dyn ServerHost, event: &mut CustomClickActionEvent<'_>, ) -> Flow
NeoForge’s CustomClickActionEvent: a server player’s client sent a custom
click action (a dialog button or a text component’s click event): its id and
optional payload. Vanilla only logs it; set cancel to skip that. Only play-phase
clicks are reported: one sent during configuration (no player yet) is not. The
player is not swapped in. Server-side.
Side: server.
Return Flow::Cancel to take it: this sets cancel, and later mods are skipped unless they
listen with #[listener(receive_cancelled)]; those see event.cancelled and may set it back to
false.
fn modify_custom_spawners(
&self,
host: &dyn Host,
event: &mut ModifyCustomSpawnersEvent<'_>,
)
fn modify_custom_spawners( &self, host: &dyn Host, event: &mut ModifyCustomSpawnersEvent<'_>, )
NeoForge’s ModifyCustomSpawnersEvent: the level dimension is about to tick its custom
spawners for the first time. spawners is the list ServerLevel ticks, in order, and it
starts with vanilla’s (WanderingTrader, Patrol, Cat, VillageSiege and Phantom,
in the order Horizon ticks them). Take a vanilla spawner out with remove and it never
ticks, so its random draws are gone with it; add a spawner of the mod’s own with add and
a SpawnerKey the mod owns, and custom_spawner_tick runs for it every tick, after the
ones before it in the list. A key identifies the custom spawner
because an object a guest implements cannot cross to a wasm mod (Beyond NeoForge). With
no listener, or one that leaves the list alone, the level ticks exactly vanilla’s
spawners. The phantom spawner runs after the level’s mobs have ticked, as the game runs
it today, wherever it is in the list; moving the others to vanilla’s order is a separate
parity change. It fires once per level, on the server, and listeners run on replayed ticks,
so they must be pure functions of their inputs. Not cancellable.
Side: server.
fn custom_spawner_tick(
&self,
host: &mut dyn ServerHost,
event: &mut CustomSpawnerTickEvent<'_>,
)
fn custom_spawner_tick( &self, host: &mut dyn ServerHost, event: &mut CustomSpawnerTickEvent<'_>, )
CustomSpawner.tick for a spawner a mod added with modify_custom_spawners: the level
dimension ticks the spawner key, once per tick in the list’s order, with
spawn_enemies as ServerLevel.isSpawningMonsters (the spawn_monsters rule, and not
peaceful). Every mod gets the call, and the mod that owns key spawns through host
(its spawns go through finalize_spawn and the spawn checks like any other); the rest
ignore it. It is called only while the spawn_mobs rule is on, as vanilla’s custom
spawners are, and only for a key in the list, so a level with no mod spawner pays one
check per tick. Beyond NeoForge: a key and this hook stand in for the CustomSpawner
object. Server-side.
Side: server.
fn customize_boss_event_progress(
&self,
host: &dyn ClientHost,
event: &mut CustomizeBossEventProgressEvent<'_>,
) -> Flow
fn customize_boss_event_progress( &self, host: &dyn ClientHost, event: &mut CustomizeBossEventProgressEvent<'_>, ) -> Flow
One boss bar is about to be drawn (NeoForge’s CustomizeGuiOverlayEvent.BossEventProgress,
in BossHealthOverlay): bar is the bar, x and y come in as its top-left corner in GUI
pixels (91 left of the screen’s centre; 12 for the first bar), and increment as the
spacing to the next bar’s y (19). Move x and y to draw this bar, and its title, there;
set increment to space the next bar, which comes in that far below where this one came in
(moving y does not move the bars after it). Set cancel and this bar is not drawn; the
increment is still applied, leaving room for what a mod draws in its place. Asked once a
frame per bar, in the order the server added them, until the next bar would start a third
of the way down the screen; not under F1. Client-side.
Side: client.
Return Flow::Cancel to take it: this sets cancel, and later mods are skipped unless they
listen with #[listener(receive_cancelled)]; those see event.cancelled and may set it back to
false.
fn customize_chat_overlay(
&self,
host: &mut dyn ClientHost,
event: &mut CustomizeChatOverlayEvent,
)
fn customize_chat_overlay( &self, host: &mut dyn ClientHost, event: &mut CustomizeChatOverlayEvent, )
The in-game chat is about to be drawn (NeoForge’s CustomizeGuiOverlayEvent.Chat, in
Gui.renderChat): x and y come in as the chat’s bottom-left corner in GUI pixels
(0 and the GUI height minus 40, vanilla’s place); move them to draw the chat elsewhere.
focused is whether the chat screen is open, and gui_width/gui_height the scaled GUI
size. Asked once a frame the chat layer draws, focused or not; not while the chat is
hidden (F1 with the chat closed). Only the drawing moves: the chat screen’s input box, and
clicks and hovers on messages, stay where vanilla puts them, as with NeoForge.
Client-side.
Side: client.
fn data_maps_updated(
&self,
host: HostSide<'_>,
event: &mut DataMapsUpdatedEvent<'_>,
)
fn data_maps_updated( &self, host: HostSide<'_>, event: &mut DataMapsUpdatedEvent<'_>, )
The data maps of a registry were reloaded on the server or synced to the
client (NeoForge’s DataMapsUpdatedEvent): the place to build caches
from the new values or post-process them. registry is the registry’s id
(minecraft:item, minecraft:block) and cause says how they arrived.
A listener cannot cancel or change anything.
ServerReload: the server merged the values of the types mods registered
(native_data_map_types) from the world’s data packs and mods’ files.
Fires once for each registry that has a type, right after
tags_updated’s ServerDataLoad (tags are bound), on a world’s first open
and after every /reload. ItemKey::data and BlockKey::data read the
new values.
ClientSync: data maps are server-side and not synced to clients yet, so
this cause does not fire; it comes with the sync.
Runs in Reloading: published asset/data queries can rebind caches, including on first open; world handles and transactions remain unavailable. Side: both.
fn debug_entry_lines(
&self,
host: &dyn ClientHost,
event: &mut DebugEntryLinesEvent<'_>,
)
fn debug_entry_lines( &self, host: &dyn ClientHost, event: &mut DebugEntryLinesEvent<'_>, )
The lines of one enabled F3 debug entry a mod registered (register_debug_entries), asked each
frame the overlay draws it. id is the entry’s id; push its lines to lines, legacy colour
codes (§) work. A disabled entry is never asked. Client-side.
Side: client.
Every mod gets event.lines in order and may add, change or remove lines.
fn debug_renderer_draw(
&self,
host: &dyn ClientHost,
event: &mut DebugRendererDrawEvent<'_>,
)
fn debug_renderer_draw( &self, host: &dyn ClientHost, event: &mut DebugRendererDrawEvent<'_>, )
Draw one active debug renderer (register_debug_renderers), asked for each view of a world,
after submit_custom_geometry. id is the renderer’s id and every mod is asked about every id,
so a mod ignores ids it does not own. draw shares its limits with that hook and clears every
view, so nothing outlives a frame. A renderer that is not active is never asked, and neither is
one without a world to draw in. Client-side.
Side: client.
fn dimension_transition_screen_draw(
&self,
host: &dyn ClientHost,
event: &mut DimensionTransitionScreenDrawEvent<'_>,
)
fn dimension_transition_screen_draw( &self, host: &dyn ClientHost, event: &mut DimensionTransitionScreenDrawEvent<'_>, )
Draw the complete selected loading screen with its GUI drawing context. screen is the
id registered at startup; ignore ids you do not own. progress is the integrated server’s
smoothed progress, or None without server progress. The game’s existing tracker closes
this screen when ready; drawing cannot change readiness or the timeout. Client only.
Side: client.
fn effect_particle_modification(
&self,
host: &dyn Host,
event: &mut EffectParticleModificationEvent<'_>,
)
fn effect_particle_modification( &self, host: &dyn Host, event: &mut EffectParticleModificationEvent<'_>, )
NeoForge’s EffectParticleModificationEvent, vanilla’s LivingEntity.updateSynchronizedMobEffectParticles: asked for each active effect effect of the living entity entity (a LivingRef, a mob or a player), the ones vanilla hides included, as the server is about to send their swirls in its synched data (DATA_EFFECT_PARTICLES, DATA_EFFECT_AMBIENCE_ID). original_particle is vanilla’s for the effect: an entity_effect in its colour (alpha 38 of 255 when ambient), the omens’ own particles. particle starts as it: replace it, or set it to None to go back to the original. visible starts as the effect’s own: set it to show a hidden effect’s swirl or hide a visible one. The visible effects’ particles are sent in the order the effects are kept; particles that need a block state, and item, trail and vibration particles, can’t be sent and are left out. A mod’s own particle (ParticleOptions::simple with its registered ParticleKey) goes only to Horizon clients: the others get the list without it. Whether the swirls are ambient (drawn fainter and rarer) follows from the answers as vanilla’s areAllEffectsAmbient does: a visible effect that is not ambient makes it false, an effect a mod made visible counts as visible and one it hid doesn’t, and it is true when none is visible. Asked when the entity’s effects change (one is added, removed, or changes its amplifier, visibility or ambience), as vanilla recomputes them only then, and only while a mod listens; the answers are sent until the next change. The window’s own player draws its swirls from its own effects, not from these answers. Server-side.
Side: server.
fn enchanted_block_loot(
&self,
level_: &dyn LevelHost,
event: &mut EnchantedBlockLootEvent<'_>,
)
fn enchanted_block_loot( &self, level_: &dyn LevelHost, event: &mut EnchantedBlockLootEvent<'_>, )
NeoForge’s EnchantedBlockLootEvent: a block’s loot table is reading the level of enchantment on tool to decide what state at pos drops, in ApplyBonusCount.run or BonusLevelTableCondition.test. level starts as the tool’s level, after get_enchantment_level; what is left in it is what that one count or condition uses, and the tool keeps its own. A u32 can’t be negative, the case setEnchantmentLevel refuses; one above 1024 counts as 1024, as vanilla’s levels stop at 255 and a level sizes a formula’s loop. tool is none for an empty hand or a break with no tool, and the read is still asked, at level 0. entity is LootContextParams.THIS_ENTITY: the player mining, the mob breaking the block, the blast’s direct source (primed TNT, TNT cart, exploding mob, fireball, wither skull, end crystal), the enderman whose carried block drops, the source of /loot ... mine, the projectile that broke a chorus flower or a decorated pot, the villager harvesting, the ravager walking through a crop, or none for a break with no entity (a neighbour update, a piston, water, a trident through a speleothem). A boat through a lily pad also gives none, though vanilla names it. Asked once per read, so a table may ask several times per break, or not at all, and the table’s draws stay in vanilla’s order. It runs inside the roll, so it gets the read-only level host: no writes, no draws, and entity is a handle a listener can keep and compare but not read until it has a Host. Authoritative servers only. Use get_enchantment_level when the block doesn’t matter. Tick-time effect: one listened test per roll when no mod listens.
Side: server.
fn enchanted_entity_loot(
&self,
host: &mut dyn ServerHost,
event: &mut EnchantedEntityLootEvent<'_>,
)
fn enchanted_entity_loot( &self, host: &mut dyn ServerHost, event: &mut EnchantedEntityLootEvent<'_>, )
An entity’s loot table reads an enchantment’s level (NeoForge’s
EnchantedEntityLootEvent): asked in the middle of the roll, each
time an enchanted_count_increase function or a
random_chance_with_enchanted_bonus condition is evaluated, for a
death and for /loot ... kill. entity is the living entity dropping
the loot, source the killing blow (minecraft:magic for the command)
and attacker the attacking entity (getAttacker): the one that
caused the blow, or the command’s source, even when source names
nobody. It is None without one, and it need not be living: such a read
is asked too, from a level of 0. level comes in as the living
attacker’s level of enchantment; what a mod leaves in it is what the
table uses, so a level raised from 0 counts even with no attacker. A
level can’t be negative, and one above 1024 counts as 1024: vanilla’s
levels stop at 255, and a table’s count grows with the level. Mods that don’t need the entities prefer
get_enchantment_level; a mob’s equipment drop chance isn’t this
hook’s (get_equipment_drop_chance). Not asked for a /loot ... kill
of an entity that isn’t living, nor for a table rolled any other way.
The draws a mod makes from the level’s random stay in order with the
roll’s. Server-side.
Side: server.
fn enchantment_level_set(
&self,
host: &mut dyn ServerHost,
event: &mut EnchantmentLevelSetEvent<'_>,
)
fn enchantment_level_set( &self, host: &mut dyn ServerHost, event: &mut EnchantmentLevelSetEvent<'_>, )
An enchanting table at pos drew the level of one offer
(EnchantmentMenu.slotsChanged, after getEnchantmentCost): offer
holds the server player whose table it is, the row (0 to 2), the
power (bookshelves counted), the item and the level drawn. Change
level to change the offer; a level below row + 1 offers nothing,
as vanilla’s. Asked for each row in order, before
prepare_item_enchant. Server-side.
Side: server.
fn ender_entity_teleport(
&self,
context: &dyn LoopContext,
event: &mut EnderEntityTeleportEvent<'_>,
) -> Flow
fn ender_entity_teleport( &self, context: &dyn LoopContext, event: &mut EnderEntityTeleportEvent<'_>, ) -> Flow
An enderman or a shulker is about to teleport on its own
(EntityTeleportEvent.EnderEntity). A mod may move target or cancel. It is given the loop context of the side that ticks the entity (its registries, settings and mod list); it fires inside the tick’s own AI step, before the teleport’s own random draws, so it takes no Host.
Side: server.
Return Flow::Cancel to take it: this sets cancel, and later mods are skipped unless they
listen with #[listener(receive_cancelled)]; those see event.cancelled and may set it back to
false.
fn enderman_anger(
&self,
host: &dyn Host,
event: &mut EndermanAngerEvent,
) -> Flow
fn enderman_anger( &self, host: &dyn Host, event: &mut EndermanAngerEvent, ) -> Flow
player stares at enderman (NeoForge’s EndermanAngerEvent, at
the end of Enderman.isBeingStaredBy): the look is within the
enderman’s cone, in line of sight, and no carved pumpkin hides the
face. Asked each time the enderman’s goals check the stare: to get
angry, to freeze while looked at and to teleport away up close. Set
cancel and that stare doesn’t count. Server-side.
Side: server.
Return Flow::Cancel to take it: this sets cancel, and later mods are skipped unless they
listen with #[listener(receive_cancelled)]; those see event.cancelled and may set it back to
false.
fn entity_change_block_pre(
&self,
host: &mut dyn ServerHost,
event: &mut EntityChangeBlockPreEvent<'_>,
) -> Flow
fn entity_change_block_pre( &self, host: &mut dyn ServerHost, event: &mut EntityChangeBlockPreEvent<'_>, ) -> Flow
A mob or a player is about to change the block at pos: a landing’s
trampling (farmland to dirt, a turtle egg breaking), before its
neighbour updates and events. player is the player whose landing it
was, entity and kind the mob for a mob’s landing (None and the
player’s type here). from and to are resolved block states. Set cancel
and the block stays as it was and nothing the change would have caused
happens, as Bukkit’s EntityChangeBlockEvent (@API:entity_change_block_v2@).
The fork names this pre-change veto entity_change_block_pre; entity_change_block is the separate post-change notice.
Side: server.
Return Flow::Cancel to take it: this sets cancel, and later mods are skipped unless they
listen with #[listener(receive_cancelled)]; those see event.cancelled and may set it back to
false.
fn entity_constructing(
&self,
host: HostSide<'_>,
event: &mut EntityConstructingEvent<'_>,
)
fn entity_constructing( &self, host: HostSide<'_>, event: &mut EntityConstructingEvent<'_>, )
A new entity is being made (NeoForge’s EntityEvent.EntityConstructing, vanilla’s
Entity.<init>): kind is its type (minecraft:zombie, minecraft:player for a
player) and holder holds its attachments. Set attachments here and the entity starts
with them: this runs before any mod reads them, and an entity read from disk or from a
summon’s NBT reads its saved attachments over what you set. The entity may not be in
the level yet, so read nothing else of it. Nothing can be cancelled.
Told once per entity on each side that makes it, as vanilla’s server and client each
construct their own: on the server (single player’s included) for a spawned, summoned,
bred or loaded entity and for a guest’s player when it joins and when it respawns; on
a client for each entity and player its server adds to its view, and for its own
player at login and at each respawn, a dimension change’s included (vanilla makes a
new LocalPlayer there). A guest’s file, or what its player keeps through a respawn,
is read over what you set. An entity whose chunk unloads and loads again is a new
entity, told again, as in vanilla. An entity changing dimension keeps its attachments
and is not told again, where vanilla constructs the copy it moves
(Entity.teleportCrossDimension, then restoreFrom).
Side: both.
fn entity_interact_specific(
&self,
host: &mut dyn ServerHost,
event: &mut EntityInteractSpecificEvent<'_>,
) -> Flow
fn entity_interact_specific( &self, host: &mut dyn ServerHost, event: &mut EntityInteractSpecificEvent<'_>, ) -> Flow
a right-click on an entity with the point clicked: native_entity_interact_specific hears the entity, its type, the held stack and the point clicked, measured from the entity’s position, before native_interact_entity (NeoForge’s PlayerInteractEvent.EntityInteractSpecific counterpart); a claim swings the hand and ends the click. Server-side. Bundles need “hooks”: @API:entity_interact_specific@.
Side: server.
Return Flow::Cancel to take it: this sets claimed, and later mods are skipped unless they
listen with #[listener(receive_cancelled)]; those see event.cancelled and may set it back to
false.
fn entity_invulnerability_check(
&self,
level: &mut dyn LevelRandomHost,
event: &mut EntityInvulnerabilityCheckEvent<'_>,
)
fn entity_invulnerability_check( &self, level: &mut dyn LevelRandomHost, event: &mut EntityInvulnerabilityCheckEvent<'_>, )
Decide whether an entity is invulnerable to this specific damage source.
original_invulnerability is the vanilla answer and invulnerable starts
with that value. Listeners may change it before the hit is applied. This
fires once per server player or mob hit that enters the invulnerability
predicate, including creative/PvP, death, fire-resistance, shield and
cooldown refusals. Nested player predicates and equipment continuations
reuse the same base decision; a new attempt asks again. Ghast and warden
overrides are observed too, including reflected fireballs and digging.
No amount is supplied: vanilla’s predicate takes a source, not an amount.
Amount mutation remains on living_incoming_damage, before cooldown.
Zero-damage projectile collisions and player pearl teleport damage still
ask before the zero-damage refusal. Skull impact and its explosion are
separate attempts. Fireworks directly hurt their attached entity; their
splash query excludes spectators, not dead or unloaded residents.
Vanilla paths that do not enter the predicate do not synthesize a call:
poison at one health, spectator or team-filtered explosion targets, and
a sulfur cube’s body-immune override. Dragon part/phase/source refusals
before reallyHurt likewise do not reach the living predicate. Creative
explosion, damaging-effect and starvation attempts do reach it. Falling
blocks exclude creative, spectator and dead targets in their query;
evoker fangs exclude dead targets, and pufferfish contact excludes dead
or spectator players before the damage call.
Selected armor stand, item, vehicle and experience orb damage paths also
fire this hook; other non-living paths are not yet covered. Explicit
invulnerability queries are separate from hit attempts.
The supplied level is the one where the hit occurs.
Side: server.
fn entity_mob_griefing(
&self,
host: &dyn Host,
event: &mut EntityMobGriefingEvent,
)
fn entity_mob_griefing( &self, host: &dyn Host, event: &mut EntityMobGriefingEvent, )
May entity change the world? (NeoForge’s EntityMobGriefingEvent,
EventHooks.canEntityGrief.) can_grief starts as the mob_griefing
game rule; set it either way. Asked for a mob
explosion (ExplosionInteraction.MOB, for the creeper, wither, ghast
fireball or wither skull), a mob picking up items, an enderman taking
or placing a block, a sheep eating grass, a mob trampling
farmland or turtle eggs, a ravager breaking leaves or crops, a wither
breaking blocks or leaving a wither rose, a silverfish leaving or
entering stone, a snow golem’s snow, a fox’s berries, a rabbit’s
carrots, a villager’s farming, an evoker’s sheep, a zombie trampling
eggs, an allay’s pickup, and a mob’s arrow or small fireball changing
a block (asked for its owner). For doors, the dragon, pitcher crops,
weaving, and decorations and items in explosions, the rule decides. Asked often: answer fast. Server-side.
Side: server.
fn entity_outline(
&self,
host: &dyn ClientHost,
event: &mut EntityOutlineEvent<'_>,
)
fn entity_outline( &self, host: &dyn ClientHost, event: &mut EntityOutlineEvent<'_>, )
Whether an entity the client draws has the glowing outline, and in which
colour (Entity.isCurrentlyGlowing and getTeamColor, what Fabric’s and
NeoForge’s glowing and team colour overrides change). outline comes
in as vanilla’s answer: Some(0xRRGGBB), the team’s colour or white,
when the entity glows, None when it doesn’t. Set Some to make any
entity glow in that colour, None to take its outline away. It changes
only what this client draws: the entity’s Glowing flag, what the
server and other players see, stays. Asked each frame for every mob,
player (yourself in third person), dropped item and projectile drawn.
API @API:entity_outline@.
Side: client.
fn entity_place(
&self,
host: &mut dyn ServerHost,
event: &mut EntityPlaceEvent,
) -> Flow
fn entity_place( &self, host: &mut dyn ServerHost, event: &mut EntityPlaceEvent, ) -> Flow
BlockEvent.EntityPlaceEvent (and EntityMultiPlaceEvent, which extends it): placer set the block state at pos against placed_against, before it is written. placer is the player for BlockItem.place (before the stack shrinks), or the mob for an enderman putting its carried block down and a snow golem’s trail; None is reserved for a placement with no entity. placement is Single, or Multi with every block the placement writes (a bed’s foot and head, a door’s halves, a tall plant), where state and pos stay the primary block (the foot, the lower half). For players, placed_against is the state adjacent to the primary placement position opposite the clicked face, including when the clicked block is replaceable. For mobs it is the state below the placement. Cancel stops the whole placement: no block is written, the stack is kept and an enderman keeps carrying its block. Server-side. Diverges from upstream: replaces the listen-only place_block; a mod that stopped placements by claiming native_use_on cancels here.
Side: server.
Return Flow::Cancel to take it: this sets canceled, and later mods are skipped unless they
listen with #[listener(receive_cancelled)]; those see event.cancelled and may set it back to
false.
fn entity_size(&self, host: &dyn Host, event: &mut EntitySizeEvent<'_>)
fn entity_size(&self, host: &dyn Host, event: &mut EntitySizeEvent<'_>)
An entity’s size was recalculated (NeoForge’s EntityEvent.Size, vanilla’s
Entity.refreshDimensions): its pose changed to pose, it grew up, its
minecraft:scale changed, or it is new. size (width, height and eye height, in
blocks) starts as vanilla’s new size and old_size is the size it had. Change size
and the entity’s box and eyes take it; later mods see earlier mods’ edits. The answer
holds while the entity keeps that pose and vanilla size; the next change asks again,
starting from vanilla’s. Changing the width or height leaves the eye height as it is:
set it too. Zero-size answers are valid. An answer is ignored if any component is
non-finite, negative or greater than 32 blocks. This bounds collision and pathfinding
work while allowing sizes larger than naturally occurring vanilla entities. host
reads the side that asks; the entity may be new, so read only what you need of it.
Asked on the server for its mobs (before and after their ticks) and for each LAN guest’s player (once a tick), and on a client for its own player (after its tick): a size changed within a tick takes the answer at the next of those. Not asked yet: other kinds of entity, whose vanilla sizes are fixed, and a client’s copies of other entities, which keep vanilla’s size. Not cancellable. Side: both.
Every mod gets event.size in order and may add, change or remove size.
fn entity_struck_by_lightning(
&self,
host: &mut dyn ServerHost,
event: &mut EntityStruckByLightningEvent,
) -> Flow
fn entity_struck_by_lightning( &self, host: &mut dyn ServerHost, event: &mut EntityStruckByLightningEvent, ) -> Flow
A lightning bolt is about to hit entity (NeoForge’s
EntityStruckByLightningEvent, before Entity.thunderHit): once per
bolt strike for each entity whose box meets the strike box (3 blocks
around, 9 up), players included. bolt is the lightning bolt. Set
cancel to spare the entity: no fire or damage, and no conversion
(pig, villager, mooshroom, creeper, copper golem). It still counts
as struck for Channeling’s advancement. Not asked for a visual-only
bolt, which hits nothing. Server-side.
Side: server.
Return Flow::Cancel to take it: this sets cancel, and later mods are skipped unless they
listen with #[listener(receive_cancelled)]; those see event.cancelled and may set it back to
false.
fn entity_travel_to_dimension(
&self,
host: &mut dyn ServerHost,
event: &mut EntityTravelToDimensionEvent<'_>,
) -> Flow
fn entity_travel_to_dimension( &self, host: &mut dyn ServerHost, event: &mut EntityTravelToDimensionEvent<'_>, ) -> Flow
entity is about to travel to the level dimension (NeoForge’s
EntityTravelToDimensionEvent), before anything of it moves: the
entity is still where it is, in its own level. cause is why:
nether_portal, end_portal or end_gateway for a portal, or
teleport for a teleport that changes level (/tp and /teleport,
a spectator’s teleport to a player in another level). Set cancel to
keep it where it is: a portal’s wait is forgotten, a teleport is
dropped and /tp still reports success. An End gateway leads to
the level the entity is already in, so its dimension is the entity’s
own.
Asked for server players, and for the other entities that cross a
portal or a command’s teleport: items, mobs, boats, minecarts, arrows
and other projectiles, experience orbs, primed TNT, tridents,
fireworks and falling blocks. A vehicle and its passengers are asked
recursively. A refused passenger stays in the source level, dismounted,
with its own passengers; it does not veto the vehicle’s travel. An entity
discarded during a callback never travels. A falling block is held out of the level while it
ticks, so its handle reads nothing yet. A respawn and a world’s join
are not travel; the return from the End credits is end_portal.
Server-side. Diverges
from upstream: replaces player_portal, which covered only server
players through portals.
Side: server.
Return Flow::Cancel to take it: this sets cancel, and later mods are skipped unless they
listen with #[listener(receive_cancelled)]; those see event.cancelled and may set it back to
false.
fn explosion_knockback(
&self,
host: &mut dyn ServerHost,
event: &mut ExplosionKnockbackEvent<'_>,
)
fn explosion_knockback( &self, host: &mut dyn ServerHost, event: &mut ExplosionKnockbackEvent<'_>, )
An explosion at center in dimension, about to break blocks, pushes
entity (None for a player, whom host.players().acting_player() names):
ServerExplosion.hurtEntities, after the knockback is calculated. Change knockback_velocity to change
what is added to the entity’s velocity; a player’s client is sent the
same. Wind bursts too, except dragons and end crystals. End crystals
are also omitted from ordinary blasts: Horizon removes them without a
velocity to change. Server-side.
Side: server.
Every mod gets event.knockback_velocity in order and may add, change or remove knockback_velocity.
fn explosion_start(
&self,
host: &mut dyn ServerHost,
event: &mut ExplosionStartEvent<'_>,
) -> Flow
fn explosion_start( &self, host: &mut dyn ServerHost, event: &mut ExplosionStartEvent<'_>, ) -> Flow
A server explosion is about to happen (ExplosionEvent.Start, in
ServerLevel.explode before ServerExplosion.explode): every one,
TNT, creepers, beds and anchors, fireballs, withers, end crystals and
wind bursts. Set cancel and nothing of it happens: no blocks, no
damage or knockback, no sound, particles or game event. Before
explosion_prime, which a cancel skips. Server-side.
Side: server.
Return Flow::Cancel to take it: this sets cancel, and later mods are skipped unless they
listen with #[listener(receive_cancelled)]; those see event.cancelled and may set it back to
false.
fn extend_poi_types(
&self,
context: &RegistrationContext,
event: &mut ExtendPoiTypesEvent<'_>,
)
fn extend_poi_types( &self, context: &RegistrationContext, event: &mut ExtendPoiTypesEvent<'_>, )
Add block states to an existing POI type (NeoForge ExtendPoiTypesEvent): a mod’s
bed to minecraft:home, its workstation to minecraft:armorer. Asked once the block
registry is resolved, before any world’s POI tables are built, and again on a
resource reload. Build each predicate on event.extensions.metadata() and hand it
to event.extensions.extend(poi_type, states); a block predicate with no
constraints means all of the block’s states. The engine resolves the additions
and refuses, one logged warning each naming both types, an unknown POI type and a
state vanilla or an earlier addition already gives to a different type; the rest
of a mod’s additions still apply. A state added to the type it already has is a
no-op. A tag predicate is refused: additions name blocks.
Wasm subscriptions refuse at load, naming the borrowed metadata capability;
this hook is not silently skipped when its context cannot cross Wire.
Side: server.
Every mod gets event.extensions in order and may add, change or remove extensions.
fn extract_block_screen_effect(
&self,
host: &dyn ClientHost,
event: &mut ExtractBlockScreenEffectEvent,
) -> Flow
fn extract_block_screen_effect( &self, host: &dyn ClientHost, event: &mut ExtractBlockScreenEffectEvent, ) -> Flow
Before one of the first-person view’s block overlays (ScreenEffectRenderer) is drawn,
once a frame each is shown: Block with the view-blocking state at pos the camera is
inside, Water with the state at the eye’s block pos while the eye is under water, and
Fire with fire’s default state at the player’s block pos while they burn. Never for a
spectator; Fire only in first person. Set canceled to leave that overlay out; the
frame, the other block overlays and the HUD’s camera overlays are drawn as before. Set
custom_draw to draw it yourself (block_screen_effect_draw), canceled or not.
partial_tick is the world’s.
Client-side.
Side: client.
Return Flow::Cancel to take it: this sets canceled, and later mods are skipped unless they
listen with #[listener(receive_cancelled)]; those see event.cancelled and may set it back to
false.
fn farmland_trample(
&self,
context: &dyn LoopContext,
event: &mut FarmlandTrampleEvent,
) -> Flow
fn farmland_trample( &self, context: &dyn LoopContext, event: &mut FarmlandTrampleEvent, ) -> Flow
Called on the server before a landing converts farmland to its base block. It is given the loop context of the side that ticks the entity (its registries, settings and mod list); it fires inside the tick’s own landing, before the block is written, so it takes no Host.
Side: server.
Return Flow::Cancel to take it: this sets cancel, and later mods are skipped unless they
listen with #[listener(receive_cancelled)]; those see event.cancelled and may set it back to
false.
fn finalize_spawn(
&self,
host: &dyn Host,
event: &mut FinalizeSpawnEvent<'_>,
) -> Flow
fn finalize_spawn( &self, host: &dyn Host, event: &mut FinalizeSpawnEvent<'_>, ) -> Flow
NeoForge’s FinalizeSpawnEvent: the new mob of type kind is at pos and Mob.finalizeSpawn (equipment, attributes, variants, the class’s own setup) is about to run for reason. spawner is the spawner block for a spawner or trial spawner spawn, none otherwise (a minecart spawner too). difficulty is the local difficulty finalization reads: change it to change what the mob gets. There are two cancels. Return Flow::Cancel to skip finalization: no finalizeSpawn runs, and the mob still spawns uninitialised (no equipment, attributes or class setup). Set spawn_cancelled to stop the spawn: no mob is added and finalization does not run. It draws nothing itself; skipped finalization skips its draws, and with no listener or an untouched event the draws are vanilla’s. Fired only where vanilla 26.3 calls finalizeSpawn on a mob the game makes, with vanilla’s reason at that call: natural spawning, chunk generation’s animals, spawners, trial spawners, patrols, raids and sieges, zombie reinforcements, a cat spawner’s cat, phantoms, jockeys, /summon and /raid, spawn eggs and dispensers, the nether portal’s piglin (Structure), a skeleton trap’s horse and riders, an evoker’s vexes and wandering traders. A conversion fires with Conversion, and a cancel there leaves the converted mob as it is. Not fired where vanilla creates the mob without finalizeSpawn: breeding and a baby from a spawn egg, an infested block’s or effect’s silverfish, a thrown egg’s chick, a thrown pearl’s endermite, a hatching egg’s turtle, sniffer or tadpole, a copper golem built from blocks, a slime from the oozing effect and a lightning trap’s horse. Nor for entities loaded from disk or structure mobs placed by world generation. mob is the mob itself, not yet in a level: read it through the host (mob.kind(host), mob.equipment(host, slot), mob.attribute_base(host, id)) and change it through edits (edits.set_equipment(mob, slot, item), edits.set_attribute_base(mob, id, base), tags and the custom name); the handle and the editor reach only this mob, and after the hook returns the handle answers Expired. Listeners run before finalization: finalization’s own rolls (equipment, attribute bonuses, variants) still run after them and overwrite what a listener put in the same slot or attribute; Flow::Cancel keeps every edit, since no finalization follows. A mob finalization itself makes (a chicken jockey’s chicken, a zombie horse’s rider) is lent with its own handle. group is the pack’s spawn group data (SpawnGroupData, SpawnGroup): what the listener leaves there is what finalization reads for this mob. Today every site this hook fires at hands it None: the game threads no group data through a live pack yet; chunk generation’s animals share it only inside the generator, out of the hook’s reach. The host is the read-only one, and edits changes nothing but this mob: listeners run on replayed ticks, so they must be pure functions of their inputs and edit only mob and group. Server-side.
Side: server.
Return Flow::Cancel to take it: this sets cancel, and later mods are skipped unless they
listen with #[listener(receive_cancelled)]; those see event.cancelled and may set it back to
false.
fn flip_frame(&self, host: &mut dyn ClientHost, event: &mut FlipFrameEvent)
fn flip_frame(&self, host: &mut dyn ClientHost, event: &mut FlipFrameEvent)
Once for each frame presented, in a world or not, after that frame’s
render_frame_post (NeoForge’s FlipFrameEvent): the place to rotate
per-frame GPU data. Not cancellable. A frame that was not presented does
not fire it. Client-side.
Side: client.
fn fluid_flow(&self, context: &dyn LoopContext, event: &mut FluidFlowEvent<'_>)
fn fluid_flow(&self, context: &dyn LoopContext, event: &mut FluidFlowEvent<'_>)
The current of the fluid block at pos (FlowingFluid.getFlow, the vector that pushes an entity standing in it) is about to push a player, mob, item, experience orb, armor stand or arrow. fluid is the fluid’s id (minecraft:water, minecraft:flowing_lava…); a mod may change flow, so it can rotate, strengthen or still a current. It runs for each fluid block the entity touches, so keep it short. The vector the renderer reads to turn a fluid’s texture is not changed. Fires on both sides, on the client’s replayed ticks too, with the loop context of the side that ticks the entity (its registries, settings and mod list): register the mod on both, and keep the listener a pure function of its inputs so prediction and the server agree. Beyond NeoForge: there is no counterpart. Diverges from upstream: new hook.
Side: both.
fn fluid_place_block(
&self,
level: &dyn LevelHost,
event: &mut FluidPlaceBlockEvent<'_>,
) -> Flow
fn fluid_place_block( &self, level: &dyn LevelHost, event: &mut FluidPlaceBlockEvent<'_>, ) -> Flow
Liquid at liquid_pos is about to place state at pos. Set
cancel to prevent placement or change new_state to replace it.
Server-side.
Side: server.
Return Flow::Cancel to take it: this sets cancel, and later mods are skipped unless they
listen with #[listener(receive_cancelled)]; those see event.cancelled and may set it back to
false.
fn fluid_tick(
&self,
level: &dyn LevelHost,
event: &mut FluidTickEvent<'_>,
) -> Flow
fn fluid_tick( &self, level: &dyn LevelHost, event: &mut FluidTickEvent<'_>, ) -> Flow
The fluid at pos is about to run its scheduled tick (FlowingFluid.tick). fluid is
water, lava or a mod fluid’s id. Set cancel and the tick does nothing at all: no
level change, no spreading and no new tick. For a mod that simulates a fluid itself;
fluid_level_change and block_spread still ask about each change of a tick that runs.
A cancelled tick schedules nothing; a mod taking over must re-schedule itself.
It’s asked once per tick, so keep it cheap. Server-side.
Side: server.
Return Flow::Cancel to take it: this sets cancel, and later mods are skipped unless they
listen with #[listener(receive_cancelled)]; those see event.cancelled and may set it back to
false.
fn fluid_tooltip(
&self,
host: &dyn ClientHost,
event: &mut FluidTooltipEvent<'_>,
)
fn fluid_tooltip( &self, host: &dyn ClientHost, event: &mut FluidTooltipEvent<'_>, )
FluidTooltipEvent: the tooltip of stack, a fluid the game draws a slot of (the recipe
viewer’s fluid wells), once its name, its amount in millibuckets and, with F3+H, its id
are in lines, each with a colour as rgba packs it (u32::MAX keeps the text’s own).
Add, change, reorder or remove lines, and an empty list draws nothing. It fires before
the tooltip is laid out or drawn, with no item and no item_tooltip involved: a tank’s
or a fluid slot’s tooltip has neither. Asked each frame the tooltip shows, only while a
mod listens. Client-side.
Side: client.
fn game_rule_changed(
&self,
host: &mut dyn ServerHost,
event: &mut GameRuleChangedEvent<'_>,
)
fn game_rule_changed( &self, host: &mut dyn ServerHost, event: &mut GameRuleChangedEvent<'_>, )
A server game rule rule (minecraft:keep_inventory) was set to
value (GameRuleChangedEvent, from GameRules.set with a server:
/gamerule, the game rules screen, the management protocol, a test
environment, server.properties). actor is present when a player
caused the change. level.game_rules(host) of any of the server’s
levels reads every rule, the new value included. Server-side.
Side: server.
fn game_shutting_down(
&self,
host: HostSide<'_>,
event: &mut GameShuttingDownEvent,
)
fn game_shutting_down( &self, host: HostSide<'_>, event: &mut GameShuttingDownEvent, )
The game process is shutting down, after the client or dedicated server
has stopped. Fires once on the process’s game thread on an orderly exit,
with the host for that side. NeoForge’s GameShuttingDownEvent.
Side: both.
fn gather_effect_screen_tooltips(
&self,
host: &dyn ClientHost,
event: &mut GatherEffectScreenTooltipsEvent<'_>,
)
fn gather_effect_screen_tooltips( &self, host: &dyn ClientHost, event: &mut GatherEffectScreenTooltipsEvent<'_>, )
GatherEffectScreenTooltipsEvent: the tooltip of the effect panel the
cursor is over beside the survival or creative inventory. tooltip
starts empty when the panel’s information is fully visible, or holds
the full name then duration when compact or clipped. Each line has a
colour as rgba packs it (u32::MAX keeps the text’s own); add, change,
reorder or remove lines, and an empty list draws nothing. effect is
the effect the panel shows, screen the inventory. Asked each frame
a rendered panel is hovered, only while a mod listens. Client-side.
Side: client.
fn gather_skipped_attribute_tooltips(
&self,
host: &dyn ClientHost,
event: &mut GatherSkippedAttributeTooltipsEvent<'_>,
)
fn gather_skipped_attribute_tooltips( &self, host: &dyn ClientHost, event: &mut GatherSkippedAttributeTooltipsEvent<'_>, )
GatherSkippedAttributeTooltipsEvent: the attribute modifiers a stack’s tooltip leaves out
(ItemStack.addAttributeTooltips), asked once before its attribute lines are built. Set
skip_all to hide every one, push modifier ids (minecraft:base_attack_damage, a bare
name is minecraft:’s) to skipped_ids, or EquipmentSlotGroup names (mainhand,
armor, any) to skipped_groups; a slot group with nothing left shows no heading. Not
asked for a stack whose minecraft:tooltip_display hides the attribute modifiers. player
and player_entity_id are the local player’s, None for the recipe book’s search text and for a stack nested in another’s tooltip (a
crossbow’s loaded projectile),
which has none; advanced (F3+H) and creative are the tooltip’s TooltipFlag. Asked each
frame the tooltip shows, only while a mod listens. Client-side.
Side: client.
fn get_arm_pose(
&self,
host: &dyn ClientHost,
event: &mut GetArmPoseEvent<'_>,
) -> Option<ArmPose>
fn get_arm_pose( &self, host: &dyn ClientHost, event: &mut GetArmPoseEvent<'_>, ) -> Option<ArmPose>
NeoForge’s IClientItemExtensions.getArmPose: the pose of the arm that holds stack in
hand, as a humanoid model draws it (local and remote players and humanoid mobs).
humanoid borrows both held stacks, the main arm, use state and selected poses
before listeners answer; item declarations are included in those poses.
Set pose to a vanilla or registered custom pose and it
replaces what the item would give, whatever the use animation, a loaded crossbow or the
item’s own arm_pose declaration say; leave it unset to keep those. Asked once a
tick per humanoid model and non-empty hand, never for an empty hand. A two-handed
pose (bow_and_arrow, crossbow_hold, crossbow_charge) still poses the other hand as
vanilla’s does. Vanilla’s spear pose poses an arm only for an
item with a kinetic weapon. Register a custom pose with ArmPosesRegistrar,
return ArmPose::Custom here, and write its angles in arm_pose_transform.
Unknown registration slots are ignored. Mob-specific animations still run after
the humanoid base pose, as in vanilla. Client-side, with a ClientHost.
Side: client.
Return Some to set pose; the first mod returning Some wins.
fn get_enchantment_level(&self, event: &mut GetEnchantmentLevelEvent<'_>)
fn get_enchantment_level(&self, event: &mut GetEnchantmentLevelEvent<'_>)
GetEnchantmentLevelEvent: the enchantments gameplay sees on stack,
starting from its own minecraft:enchantments. target is the one
enchantment a read asks for (ItemStack.getEnchantmentLevel), and then
only its level counts; None when every one is read
(ItemStack.getAllEnchantments). Set, upgrade or remove levels in
enchantments: what is left is what fights, mining, fishing, tridents,
crossbows, armor, loot and every other enchantment effect use. Tooltips,
the anvil, the grindstone, the enchanting table, saves and the network
keep the stack’s own component. Asked on every such read, often many
times a tick, on the server and on a client (its tooltip modifiers).
Side: both.
fn grindstone_place(
&self,
host: &mut dyn ServerHost,
event: &mut GrindstonePlaceEvent<'_>,
) -> Flow
fn grindstone_place( &self, host: &mut dyn ServerHost, event: &mut GrindstonePlaceEvent<'_>, ) -> Flow
A grindstone at pos made its result after its inputs changed, for
the server player player (UUID) and player_entity_id
(GrindstoneEvent.OnPlaceItem, in GrindstoneMenu.createResult):
place holds the inputs, the vanilla result and an initially empty
override. Set output to replace the result and xp (0 or more)
for what taking it gives; set cancel for no result.
Server-side.
Side: server.
Return Flow::Cancel to take it: this sets cancel, and later mods are skipped unless they
listen with #[listener(receive_cancelled)]; those see event.cancelled and may set it back to
false.
fn grindstone_take(
&self,
host: &mut dyn ServerHost,
event: &mut GrindstoneTakeEvent<'_>,
) -> Flow
fn grindstone_take( &self, host: &mut dyn ServerHost, event: &mut GrindstoneTakeEvent<'_>, ) -> Flow
The server player player (UUID) and player_entity_id took a
grindstone’s result at pos (GrindstoneEvent.OnTakeItem, in its
result slot’s onTake): take holds the inputs, the experience (-1
for vanilla’s, or what grindstone_place set) and what the inputs
hold afterwards (empty). Set xp (0 or more) to give that much
experience, new_top and new_bottom to leave items in the inputs.
Set cancel to skip the rest of onTake: the result is still taken,
but no experience, no sound, and the inputs stay. Server-side.
Side: server.
Return Flow::Cancel to take it: this sets cancel, and later mods are skipped unless they
listen with #[listener(receive_cancelled)]; those see event.cancelled and may set it back to
false.
fn gui_layer_draw(
&self,
host: &dyn ClientHost,
event: &mut GuiLayerDrawEvent<'_>,
)
fn gui_layer_draw( &self, host: &dyn ClientHost, event: &mut GuiLayerDrawEvent<'_>, )
Draw one HUD layer a mod registered (register_gui_layers), each frame the HUD shows,
between that layer’s gui_layer_pre and gui_layer_post; not asked when a mod’s
gui_layer_pre hid it. layer is the layer’s id and every mod is asked about every id,
so a mod ignores ids it does not own. Draw with the drawing context; draw.size() is
the GUI size. Client-side.
Side: client.
fn gui_render_post(
&self,
host: &dyn ClientHost,
event: &mut GuiRenderPostEvent<'_>,
)
fn gui_render_post( &self, host: &dyn ClientHost, event: &mut GuiRenderPostEvent<'_>, )
After the complete normal GUI batch, including screens, prompts, toasts,
debug overlays, the pad cursor and IME. Fires even with F1 or a menu open;
file/world loading and resource-reload overlays do not fire it. The batch
is in GUI pixels. native_camera is this frame’s world camera (None on
the panorama). gui_hidden is the F1 setting; focused is window focus.
A mod decides whether its foreground indicator respects those flags.
Client only; the host is read-only. API @API:gui_render_post@.
Side: client.
fn ingredient_test(
&self,
context: &dyn LoopContext,
event: &mut IngredientTestEvent<'_>,
)
fn ingredient_test( &self, context: &dyn LoopContext, event: &mut IngredientTestEvent<'_>, )
A mod’s own ingredient kind, matching a concrete stack at craft time:
the ingredient’s test calls here with the kind, its NBT compound and the
stack being matched, accept already true (the load-time list named
the item). Set accept to false to refuse the stack — its components
are the usual reason. The hook may be called many times a craft; the
answer must be the same for the same stack. It is given the loop context of the side that runs the match (its registries, settings and mod list); it fires inside recipe matching, so it takes no Host.
Side: both.
fn item_attribute_modifier(&self, event: &mut ItemAttributeModifierEvent<'_>)
fn item_attribute_modifier(&self, event: &mut ItemAttributeModifierEvent<'_>)
ItemAttributeModifierEvent: the attribute modifiers stack grants
(ItemStack.getAttributeModifiers), starting from its own
minecraft:attribute_modifiers or its item’s. Add, replace or remove
entries in modifiers; what is left is what every reader of the stack’s
modifiers uses: the equipment of players, mobs, armor stands and the
dragon when it changes, mobs’ gear knockback and pickup choices, the
attribute sync and the tooltip. A worn stack is asked again only when it
changes (ItemStack.matches), so the answer must be the same for the
same stack. Asked on the server and on a client (its tooltips).
Side: both.
fn item_container(
&self,
host: &dyn Host,
event: &mut ItemContainerEvent<'_>,
) -> Option<u32>
fn item_container( &self, host: &dyn Host, event: &mut ItemContainerEvent<'_>, ) -> Option<u32>
Item item (mod_id:name) holds items (Capabilities.Item.ITEM): set
slots when the item is yours, for a backpack, a storage cell or a
toolbox. Clamped to 1..=256, ItemContainerContents’ limit; 0 leaves
the item without slots, and vanilla’s items have none. Asked at each
call of the item container helpers (native_item_container_slots,
native_item_container_insert, native_item_container_extract, in
native_item_container.rs). The contents are kept in the stack’s
minecraft:container, as a shulker box item keeps them.
Side: both.
Return Some to set slots; the first mod returning Some wins.
fn item_fished(
&self,
host: &mut dyn ServerHost,
event: &mut ItemFishedEvent<'_>,
) -> Flow
fn item_fished( &self, host: &mut dyn ServerHost, event: &mut ItemFishedEvent<'_>, ) -> Flow
A server player player (UUID) and player_entity_id reeled in a
catch (ItemFishedEvent, in FishingHook.retrieve after the fishing
loot rolled): fished holds the bobber and the items, and
rod_damage the damage the rod takes (vanilla’s 1, or 2 with the
bobber on the ground), which the mods may set (damageRodBy, not
negative). Set cancel and the player receives nothing: no items,
experience or statistic, and no fishing_rod_hooked trigger; the
bobber is gone and the rod
still takes rod_damage. After player_fish’s reel-in. Server-side.
Side: server.
Return Flow::Cancel to take it: this sets cancel, and later mods are skipped unless they
listen with #[listener(receive_cancelled)]; those see event.cancelled and may set it back to
false.
fn item_model_property(
&self,
host: &dyn ClientHost,
event: &mut ItemModelPropertyEvent<'_>,
)
fn item_model_property( &self, host: &dyn ClientHost, event: &mut ItemModelPropertyEvent<'_>, )
Client-side evaluation of a mod’s namespaced conditional item model property.
Set value only for a property your mod owns; unhandled properties stay false.
The owned stack snapshot is the one being resolved, including nested bundle items.
bundle_selected is the runtime bundle selection index; -1 means none.
Side: client.
fn item_model_range_property(
&self,
host: &dyn ClientHost,
event: &mut ItemModelRangePropertyEvent<'_>,
)
fn item_model_range_property( &self, host: &dyn ClientHost, event: &mut ItemModelRangePropertyEvent<'_>, )
Client-side value of a numeric item model property a mod registered
(register_range_select_item_model_property), asked each time a minecraft:range_dispatch
on it picks a branch. Set value only for a property your mod owns; unanswered it stays 0.
The model’s scale is applied afterwards. The owned stack snapshot is the one being resolved,
including nested bundle items.
bundle_selected is the runtime bundle selection index; -1 means none.
Side: client.
fn item_model_select_property(
&self,
host: &dyn ClientHost,
event: &mut ItemModelSelectPropertyEvent<'_>,
)
fn item_model_select_property( &self, host: &dyn ClientHost, event: &mut ItemModelSelectPropertyEvent<'_>, )
Client-side value of a categorical item model property a mod registered
(register_select_item_model_property), asked each time a minecraft:select on it picks a
case. Set value only for a property your mod owns; left None, the model’s fallback is drawn.
The owned stack snapshot is the one being resolved, including nested bundle items.
bundle_selected is the runtime bundle selection index; -1 means none.
Side: client.
fn item_model_update(
&self,
host: &dyn ClientHost,
event: &mut ItemModelUpdateEvent<'_>,
)
fn item_model_update( &self, host: &dyn ClientHost, event: &mut ItemModelUpdateEvent<'_>, )
A node of a type a mod registered (register_item_models, vanilla’s ItemModel.update)
is resolved for a stack, in hand, in a screen or on the ground: push the names of the
node’s models to draw, in order, only for a type your mod owns. config borrows the
node’s JSON object, converted once at load. The owned stack snapshot is the one being
resolved, including nested bundle items. bundle_selected is the runtime bundle selection
index; -1 means none. As ItemModel.update reads them: display is where the item is
drawn (a screen, a hand, the ground), owner the living entity holding it (None in a
screen with no holder), level the level it is drawn in (None outside a world), and
seed the draw’s random seed.
Side: client.
fn item_smelted(
&self,
host: &mut dyn ServerHost,
event: &mut ItemSmeltedEvent<'_>,
)
fn item_smelted( &self, host: &mut dyn ServerHost, event: &mut ItemSmeltedEvent<'_>, )
FurnaceResultSlot.checkTakeAchievements ran for a server player at a
furnace, blast furnace or smoker’s result slot: player is their UUID
and player_entity_id their network id; stack and amount_removed
are what vanilla passes there (getSmelting, getAmountRemoved). A
click or a throw passes the taken stack and its count; a shift-click
passes the slot’s stack as it was with the count moved, then what
stayed in the slot (None once it is empty) with 0; a hotbar swap
passes the taken stack with 0. Fires before furnace_extract.
Server-side.
Side: server.
fn item_stacked_on_other(
&self,
context: &dyn LoopContext,
event_: &mut ItemStackedOnOtherEvent<'_, '_>,
) -> Flow
fn item_stacked_on_other( &self, context: &dyn LoopContext, event_: &mut ItemStackedOnOtherEvent<'_, '_>, ) -> Flow
NeoForge’s ItemStackedOnOtherEvent, before either item override. It runs inside a pickup click. Answer from the arguments and context alone, and fast: context holds the side, the registries and the settings of the resource generation, and a /reload builds the next one.
Side: both.
Return Flow::Cancel to take it: this sets canceled, and later mods are skipped unless they
listen with #[listener(receive_cancelled)]; those see event_.cancelled and may set it back to
false.
fn item_tint_source(
&self,
host: &dyn ClientHost,
event: &mut ItemTintSourceEvent<'_>,
)
fn item_tint_source( &self, host: &dyn ClientHost, event: &mut ItemTintSourceEvent<'_>, )
Client-side colour of an item tint source a mod registered (register_item_tint_sources,
vanilla’s ItemTintSource.calculate), asked for each entry on it each time the item is
resolved, in hand, in a screen or on the ground. config borrows the entry converted once to a Tag at load from the JSON object in the
model’s tints, so a source reads its own fields there. Set color, ARGB with an alpha of
0xFF as vanilla’s sources give, only for a source your mod owns; left alone, the entry draws
white. The owned stack snapshot is the one being resolved, including nested bundle items.
bundle_selected is the runtime bundle selection index; -1 means none.
Side: client.
fn item_tooltip(&self, host: &dyn ClientHost, event: &mut ItemTooltipEvent<'_>)
fn item_tooltip(&self, host: &dyn ClientHost, event: &mut ItemTooltipEvent<'_>)
ItemTooltipEvent: the whole tooltip of stack (ItemStack.getTooltipLines),
once its name, the item’s own lines, the components’ lines, the
advanced lines and the operator warning are in lines, each with a
colour as rgba packs it (u32::MAX keeps the text’s own). Add,
change, reorder or remove lines. player and player_entity_id are
the local player’s, display the stack’s minecraft:tooltip_display,
advanced (F3+H) and creative (a creative tab’s own slot) its
TooltipFlag. Asked each frame the tooltip shows, never for one the
stack hides or a crossbow’s loaded projectile. Client-side.
This global event is distinct from ItemPart::tooltip, which runs at
the earlier Item.appendHoverText position, before component lines.
Parts’ lines therefore come first; this event sees the finished list
including them, for any item, even one with no attached parts.
A component deeper than 512 nodes refuses capture or the whole writeback;
no event field is applied if any Text field fails conversion.
Side: client.
fn item_toss(
&self,
host: &mut dyn ServerHost,
event: &mut ItemTossEvent<'_>,
) -> Flow
fn item_toss( &self, host: &mut dyn ServerHost, event: &mut ItemTossEvent<'_>, ) -> Flow
ItemTossEvent: player tosses count of item (Player.drop: the drop key, a menu’s throw, what no longer fits in the inventory), not what scatters when they die. Set canceled and no item entity is made; the items are already out of the inventory and are lost. A canceled toss awards no drop statistic, as vanilla awards one only when an item entity came of it. Server-side. Diverges from upstream: replaces the listen-only item_dropped, which fired for the drop key and menu throws only.
Side: server.
Return Flow::Cancel to take it: this sets canceled, and later mods are skipped unless they
listen with #[listener(receive_cancelled)]; those see event.cancelled and may set it back to
false.
fn key_mapping_pre(
&self,
host: &mut dyn ClientHost,
event: &mut KeyMappingPreEvent<'_>,
) -> Flow
fn key_mapping_pre( &self, host: &mut dyn ClientHost, event: &mut KeyMappingPreEvent<'_>, ) -> Flow
A physical key or mouse button bound to the gameplay mapping mapping (key.jump,
key.attack…) changes state while playing, before the game acts on it. pressed is true
for a press (a key’s repeat counts as one, as the game takes it) and false for a release.
Cancel a press to drop it for every mapping bound to its input: the game holds nothing and
acts on nothing. A release cannot be canceled, so what the game holds is always let go.
Told for the keys and mouse buttons the window takes (agent control’s included), after the
window’s own shortcuts (fullscreen, screenshot, debug keys), and only with no screen open;
not for a controller, whose presses go straight to the mappings. No NeoForge counterpart.
Client-side.
Side: client.
Return Flow::Cancel to take it: this sets canceled, and later mods are skipped unless they
listen with #[listener(receive_cancelled)]; those see event.cancelled and may set it back to
false.
fn left_click_empty(
&self,
host: &mut dyn ClientHost,
event: &mut LeftClickEmptyEvent,
)
fn left_click_empty( &self, host: &mut dyn ClientHost, event: &mut LeftClickEmptyEvent, )
The local player left-clicks empty space, with any main-hand stack. Client-side only; the server does not receive this event. Side: client.
fn level_save(&self, host: &mut dyn ServerHost, event: &mut LevelSaveEvent<'_>)
fn level_save(&self, host: &mut dyn ServerHost, event: &mut LevelSaveEvent<'_>)
dimension’s level was saved (NeoForge’s LevelEvent.Save, in
ServerLevel.save): its level data, chunks and entities, by the
autosave, /save-all, a pause, a closing level or the server
stopping; each level of a world save in turn. Server-side.
Side: server.
fn play_level_sound_at_position(
&self,
host: HostSide<'_>,
event: &mut PlayLevelSoundAtPositionEvent<'_>,
) -> Flow
fn play_level_sound_at_position( &self, host: HostSide<'_>, event: &mut PlayLevelSoundAtPositionEvent<'_>, ) -> Flow
A sound is about to play at position in level (NeoForge’s
PlayLevelSoundEvent.AtPosition, in Level.playSeededSound):
every server sound not bound to an entity, mobs’ own sounds included
(Entity.playSound plays at the entity’s position). A mod may change
sound, source, volume and pitch, or set cancel and no player
hears it; original_volume and original_pitch are as asked. A sound
left unplayable (a volume or pitch that isn’t finite and at least 0)
is dropped. Sounds the server’s level plays during
the tick are asked as they go out, at the end of the tick, with the state
then. /playsound sends its packet directly and isn’t asked, as in
vanilla on the server. On the client, incoming sound packets ask before
playback, including /playsound; client-predicted and game-event level
requests ask here too. Canceling a sound does not cancel its action or prediction.
Server and client requests are separate:
HostSide identifies which one is being edited. UI and sound-engine-only
playback do not ask this hook. Both sides.
Side: both.
Return Flow::Cancel to take it: this sets cancel, and later mods are skipped unless they
listen with #[listener(receive_cancelled)]; those see event.cancelled and may set it back to
false.
fn play_level_sound_at_entity(
&self,
host: HostSide<'_>,
event: &mut PlayLevelSoundAtEntityEvent<'_>,
) -> Flow
fn play_level_sound_at_entity( &self, host: HostSide<'_>, event: &mut PlayLevelSoundAtEntityEvent<'_>, ) -> Flow
A sound bound to entity is about to play (NeoForge’s
PlayLevelSoundEvent.AtEntity, in Level.playSeededSound’s entity
overload, playSound(except, sourceEntity, ...)): a goat horn, a frog’s
tongue, eating and spawn, an animal eating (frog, goat, sniffer), a long
jump, a goat’s ram, a breeze’s charge and deflection, shearing (sheep,
mooshroom, snow golem, bogged, copper golem), dye on a sheep, an axe on a
copper golem, an allay’s item and duplication, a ghastling hatching, a
trident thrown (the trident) or riptide (the player), and a mod’s sound
bound to an entity. Asked after the tick’s other sounds. The fields and
their rules are play_level_sound_at_position’s. Client entity-sound
packets ask before playback and keep following their emitter; an absent
emitter plays nothing. LocalPlayer.playSound also asks this hook,
including steps, falls, hurt, bundle clicks and consumption; these remain
positional sounds, not following sounds. Both sides, distinguished by HostSide.
Side: both.
Return Flow::Cancel to take it: this sets cancel, and later mods are skipped unless they
listen with #[listener(receive_cancelled)]; those see event.cancelled and may set it back to
false.
fn living_change_target(
&self,
host: &dyn Host,
event: &mut LivingChangeTargetEvent<'_>,
) -> Flow
fn living_change_target( &self, host: &dyn Host, event: &mut LivingChangeTargetEvent<'_>, ) -> Flow
A mob is about to change its target. original_target is the target
requested by the game, or none when it is clearing the target.
new_target starts as that value; a listener can redirect or clear it.
Set cancel to retain the mob’s existing target. is_brain identifies
a brain-driven target change; false identifies a goal or other mob target
setter. Handles refer to live entities and may be read through the host.
A stale or invalid replacement, including a fake player, is refused.
Authoritative server only.
Side: server.
Return Flow::Cancel to take it: this sets cancel, and later mods are skipped unless they
listen with #[listener(receive_cancelled)]; those see event.cancelled and may set it back to
false.
fn living_conversion_post(
&self,
host: &mut dyn ServerHost,
event: &mut LivingConversionPostEvent<'_>,
)
fn living_conversion_post( &self, host: &mut dyn ServerHost, event: &mut LivingConversionPostEvent<'_>, )
A mob converted into another type (NeoForge’s
LivingConversionEvent.Post): converted replaces entity. Fires
after the finalized new mob joined the level and before the old mob
is removed, for the conversions native_living_conversion_pre tells.
Side: server.
fn living_conversion_pre(
&self,
host: &mut dyn ServerHost,
event: &mut LivingConversionPreEvent<'_>,
) -> Flow
fn living_conversion_pre( &self, host: &mut dyn ServerHost, event: &mut LivingConversionPreEvent<'_>, ) -> Flow
A mob is about to convert into another type (NeoForge’s
LivingConversionEvent.Pre, vanilla’s Mob.convertTo): a zombie
drowning, a piglin or hoglin in the Overworld, a tadpole growing, a
mooshroom sheared by a dispenser, a pig or villager struck by
lightning. outcome is the new type. Set cancel to keep the mob as
it is; a drowning zombie starts its timers again. Not told: a
mooshroom a player shears, a zombie villager’s cure, a villager turned
by a zombie.
Side: server.
Return Flow::Cancel to take it: this sets cancel, and later mods are skipped unless they
listen with #[listener(receive_cancelled)]; those see event.cancelled and may set it back to
false.
fn living_damage_post(
&self,
level: &mut dyn LevelRandomHost,
event: &mut LivingDamagePostEvent<'_>,
)
fn living_damage_post( &self, level: &mut dyn LevelRandomHost, event: &mut LivingDamagePostEvent<'_>, )
NeoForge’s LivingDamageEvent.Post: the health of entity entity of type kind has
just lost the hit container describes, with its final values (health damage, the
reductions, the post-attack invulnerability ticks). container.should_cause_side_effects()
carries hurtServer’s fresh-hit decision (shouldCauseSideEffects): false for a stronger
hit inside the cooldown unless its source bypasses it, independent of the final damage
or modded invulnerability ticks. It only listens, and fires where
native_living_damage_pre does once the health took more than 0. It can’t write the
entity or the world’s blocks: the level host gives the hit’s random and level attachments.
The container is an API-owned scalar snapshot; the engine retains sequencing and normalization.
Side: server.
fn living_damage_pre(
&self,
level: &mut dyn LevelRandomHost,
event: &mut LivingDamagePreEvent<'_>,
)
fn living_damage_pre( &self, level: &mut dyn LevelRandomHost, event: &mut LivingDamagePreEvent<'_>, )
NeoForge’s LivingDamageEvent.Pre: LivingEntity.actuallyHurt of entity entity of
type kind (minecraft:player, minecraft:zombie) by source (named as
native_living_incoming_damage names it) has taken armor and magic, and the absorption
hearts are next: container holds the damage it started with, what it is now
(new_damage, which may be 0) and each reduction so far (armor, enchantments, mob
effects). Change its
new_damage and the health takes that; set its post-attack invulnerability ticks and the
entity keeps them instead of vanilla’s. A value that is not a number is put back as it
was. It fires for players, mobs and the ender dragon; a wolf whose armor takes the hit and
armor stands do not fire it. The level is the hit’s: its blocks, random and own
attachments; the hurt entity is in the middle of its hit.
The container is an API-owned scalar snapshot; the engine retains sequencing and normalization.
Side: server.
fn living_death(
&self,
host: &mut dyn ServerHost,
event: &mut LivingDeathEvent<'_>,
) -> Flow
fn living_death( &self, host: &mut dyn ServerHost, event: &mut LivingDeathEvent<'_>, ) -> Flow
A mob or server player is about to die (NeoForge’s LivingDeathEvent,
vanilla’s LivingEntity.die): its health has run out, and the loot,
experience and death message have not run. entity is its id and
kind its type (minecraft:zombie, minecraft:player); damage_type
names the last blow (minecraft:player_attack) and attacker is the
mob that dealt it, 0 for none or a player. Set cancel to keep it alive:
Horizon decides death by health, so it stays at 1 health. The hook
fires once per death attempt. Armor stands, boats and other non-mob
entities are not told.
Side: server.
Return Flow::Cancel to take it: this sets cancel, and later mods are skipped unless they
listen with #[listener(receive_cancelled)]; those see event.cancelled and may set it back to
false.
fn living_death_post(
&self,
host: &mut dyn ServerHost,
event: &mut LivingDeathPostEvent<'_>,
)
fn living_death_post( &self, host: &mut dyn ServerHost, event: &mut LivingDeathPostEvent<'_>, )
A mob or server player’s death has finished (Fabric’s
ServerLivingEntityEvents.AFTER_DEATH, vanilla’s LivingEntity.die
at its broadcastEntityEvent): the loot, equipment and experience
dropped and the death message went out. entity is its id;
damage_type names the killing blow (minecraft:player_attack) and
attacker is the mob that dealt it, 0 for none or a player. It only
hears. The tail of living_death, a separate moment, and not fired
when that hook cancelled the death. Server-side, once per death, for
every ordinary living entity. The ender dragon uses a separate death
sequence and fires neither living death hook. Armor stands, boats and other non-mob entities
are not told.
Side: server.
fn living_destroy_block(
&self,
host: &mut dyn ServerHost,
event: &mut LivingDestroyBlockEvent<'_>,
) -> Flow
fn living_destroy_block( &self, host: &mut dyn ServerHost, event: &mut LivingDestroyBlockEvent<'_>, ) -> Flow
A mob is about to destroy a block (NeoForge’s LivingDestroyBlockEvent):
a wither breaking blocks around it, a ravager breaking leaves, the ender
dragon’s wall check, an enderman picking a block up, a silverfish waking
its friends (the infested blocks break), a zombie breaking a door or a
turtle egg. entity is its entity id, kind its type (minecraft:wither),
pos the block and state its state. Canceling keeps the block (an
enderman then holds nothing). Asked once per block, only while a mod is
loaded. Server-side.
Side: server.
Return Flow::Cancel to take it: this sets cancel, and later mods are skipped unless they
listen with #[listener(receive_cancelled)]; those see event.cancelled and may set it back to
false.
fn living_drops(
&self,
host: &mut dyn ServerHost,
event: &mut LivingDropsEvent<'_>,
) -> Flow
fn living_drops( &self, host: &mut dyn ServerHost, event: &mut LivingDropsEvent<'_>, ) -> Flow
Not native_loot_drops: that is the loot-modifier step, which edits
the stacks a table rolled (blocks, shearing, a mob’s table). This hook
fires once after it, on the entity’s whole collected drop list, and
nothing is spawned until it returns.
A dying mob, server player or armor stand entity of kind (player
is a player’s UUID) is about to drop drops, the items
LivingEntity.dropAllDeathLoot collected (NeoForge’s
LivingDropsEvent): the loot tables’ stacks (after native_loot_drops),
the equipment that rolled to drop, a mob’s own extras (an enderman’s
carried block, a fox’s mouth item, a piglin’s inventory, a copper golem’s
preserved equipment) and a player’s inventory, each with the position,
motion and pickup delay its item entity will have. Edit the list (take
out, change or add drops) or set cancel for no drops at all; empty
stacks don’t drop. source is the killing blow (causing and direct
entity ids, 0 when none or not known) and recently_hit is whether a
player hurt it within 100 ticks, which is what lets a mob drop its
equipment. An armor stand fires it from brokenByAnything with an
empty list (its stand item and its equipment pop outside the list, as
in vanilla). Experience orbs are not in the list
(native_living_experience_drop); a spectator, who drops nothing,
doesn’t call this. Item entity state such as no-gravity, owner and
lifetime isn’t in ItemDrop. Server-side.
Side: server.
Return Flow::Cancel to take it: this sets cancel, and later mods are skipped unless they
listen with #[listener(receive_cancelled)]; those see event.cancelled and may set it back to
false.
fn get_equipment_drop_chance(
&self,
host: &mut dyn ServerHost,
event: &mut GetEquipmentDropChanceEvent<'_>,
)
fn get_equipment_drop_chance( &self, host: &mut dyn ServerHost, event: &mut GetEquipmentDropChanceEvent<'_>, )
A dying mob entity of kind is about to roll its drop chance for
the item stack in slot (Mob.dropCustomDeathLoot, NeoForge’s
GetEquipmentDropChanceEvent). original_chance is
DropChances.byEquipment; chance starts as the chance after the
enchantments of the attacker and the victim (getOriginalChance and
getDropChance); change chance (1.0 or more always drops, 0 or less
never does). preserved is DropChances.isPreserved: the slot drops
without a player kill, whatever the mod chooses. Each slot is asked
at its own point of the loop, after the mob’s loot table was rolled
and just before the slot’s roll, only when it holds an item and its
recorded chance isn’t 0, in EquipmentSlot order. The roll is drawn
whatever the chance is, so the mob’s random follows vanilla’s order.
source and recently_hit are as in native_living_drops.
Server-side.
Side: server.
fn living_experience_drop(
&self,
host: &mut dyn ServerHost,
event: &mut LivingExperienceDropEvent<'_>,
) -> Flow
fn living_experience_drop( &self, host: &mut dyn ServerHost, event: &mut LivingExperienceDropEvent<'_>, ) -> Flow
A dying mob or player entity of kind is about to drop original
points of experience; the vanilla conditions have been checked.
attacking_player is the player who last hurt it, if any. Change
amount (0 or less drops nothing), or set cancel to drop none. A
sculk catalyst that takes the experience does not call this.
Server-side.
Side: server.
Return Flow::Cancel to take it: this sets cancel, and later mods are skipped unless they
listen with #[listener(receive_cancelled)]; those see event.cancelled and may set it back to
false.
fn living_get_projectile(
&self,
host: HostSide<'_>,
event: &mut LivingGetProjectileEvent<'_>,
)
fn living_get_projectile( &self, host: HostSide<'_>, event: &mut LivingGetProjectileEvent<'_>, )
LivingEntity.getProjectile(weapon) (NeoForge’s
LivingGetProjectileEvent) for a player (player and name) or a
mob (entity, kind): a skeleton or illusioner’s shot, or the crossbow
load of a pillager or piglin. projectile is the vanilla
ammunition; replace it to choose another. A replaced stack is not taken
from the inventory.
Side: both.
Every mod gets event.projectile in order and may add, change or remove projectile.
fn living_jump_power(
&self,
context: &dyn LoopContext,
event: &mut LivingJumpPowerEvent<'_>,
)
fn living_jump_power( &self, context: &dyn LoopContext, event: &mut LivingJumpPowerEvent<'_>, )
A living entity’s jump power (LivingEntity.getJumpPower: jump strength attribute, block jump factor and Jump Boost) is about to be used by jumpFromGround. entity is its id and kind its type; a mod may change power. The rabbit’s own hop and the player, cube, panda and ordinary mob jumps all pass through it. Fires on both sides, on the client’s replayed ticks too, with the loop context of the side that ticks the entity (its registries, settings and mod list): register the mod on both, and keep the listener a pure function of its inputs so prediction and the server agree. Beyond NeoForge: there is no counterpart. Diverges from upstream: new hook.
Side: both.
fn living_speed(
&self,
context: &dyn LoopContext,
event: &mut LivingSpeedEvent<'_>,
)
fn living_speed( &self, context: &dyn LoopContext, event: &mut LivingSpeedEvent<'_>, )
A living entity’s movement speed (LivingEntity.getSpeed) is about to drive its travel on the ground and through fluids. entity is its id and kind its type; a mod may change speed. Fires on both sides, on the client’s replayed ticks too, with the loop context of the side that ticks the entity (its registries, settings and mod list): register the mod on both, and keep the listener a pure function of its inputs so prediction and the server agree. Beyond NeoForge: there is no counterpart. Diverges from upstream: new hook.
Side: both.
fn living_flying_speed(
&self,
context: &dyn LoopContext,
event: &mut LivingFlyingSpeedEvent<'_>,
)
fn living_flying_speed( &self, context: &dyn LoopContext, event: &mut LivingFlyingSpeedEvent<'_>, )
A living entity’s airborne acceleration (LivingEntity.getFlyingSpeed) is about to be used by its travel. entity is its id and kind its type; a mod may change speed. Fires on both sides, on the client’s replayed ticks too, with the loop context of the side that ticks the entity (its registries, settings and mod list): register the mod on both, and keep the listener a pure function of its inputs so prediction and the server agree. Beyond NeoForge: there is no counterpart. Diverges from upstream: new hook.
Side: both.
fn living_shield_block(
&self,
level: &mut dyn LevelRandomHost,
event: &mut LivingShieldBlockEvent<'_>,
)
fn living_shield_block( &self, level: &mut dyn LevelRandomHost, event: &mut LivingShieldBlockEvent<'_>, )
NeoForge’s LivingShieldBlockEvent: entity entity of type kind
(minecraft:player, minecraft:zombie) is hit for damage from source (its
type and entities, as native_living_incoming_damage names them), and
LivingEntity.applyItemBlocking is
about to resolve what a raised blocks_attacks item stops. Every hit with damage
asks, raised item or not: original_blocked is whether vanilla blocks (only a
player raises one). Change block: blocked makes the entity block or not (a block
forced on a hit vanilla lets through stops all of it), blocked_damage what is
stopped (kept within 0 and damage) and shield_damage the durability a raised
item loses (below 0: vanilla’s itemDamage of what is stopped). Set blocked to false and nothing is blocked, as NeoForge’s setBlocked(false); the event has no cancel. The level is the hit’s: its blocks, random and own
attachments.
Side: server.
fn living_use_totem(
&self,
level: &mut dyn LevelRandomHost,
event: &mut LivingUseTotemEvent<'_>,
) -> Flow
fn living_use_totem( &self, level: &mut dyn LevelRandomHost, event: &mut LivingUseTotemEvent<'_>, ) -> Flow
NeoForge’s LivingUseTotemEvent: a killing blow on entity entity of type kind
from source (named as native_living_incoming_damage names it) would be taken by the
death_protection item item in its hand (main or off;
LivingEntity.checkTotemDeathProtection). Set cancel and the entity gets no
protection: it dies and the item is kept. A player or a mob holding a totem fires it; a
source that bypasses invulnerability never reaches it. native_player_totem still
hears a server player’s totem that did save them, after this. The level is the hit’s: its blocks, random and own
attachments.
Side: server.
Return Flow::Cancel to take it: this sets cancel, and later mods are skipped unless they
listen with #[listener(receive_cancelled)]; those see event.cancelled and may set it back to
false.
fn living_visibility(&self, host: &dyn Host, event: &mut LivingVisibilityEvent)
fn living_visibility(&self, host: &dyn Host, event: &mut LivingVisibilityEvent)
How visible entity is to looking (NeoForge’s
LivingVisibilityEvent, last in LivingEntity.getVisibilityPercent):
the range a mob’s targeting check sees it from is scaled by
visibility. It comes in as vanilla’s percent (sneaking 0.8,
invisibility by armour cover, a worn head’s mob_visibility: 0.5 to
its own mob type); multiply it to scale. Values below 0 count as 0,
and the result is clamped to 10. Asked for a player, by the mobs whose targeting checks scale by
visibility (hostile targeting, sensors, the happy ghast’s tempt).
Server-side.
Side: server.
fn map_decoration_types(
&self,
context: &RegistrationContext,
event: &mut MapDecorationTypesEvent<'_>,
)
fn map_decoration_types( &self, context: &RegistrationContext, event: &mut MapDecorationTypesEvent<'_>, )
The map decoration types a mod adds (NeoForge’s RegisterEvent for
Registries.MAP_DECORATION_TYPE): push a MapDecorationType per type. Asked once at
start, on every side.
Side: both.
Every mod gets event.types in order and may add, change or remove types.
Block block at pos opens its mod menu type menu for server
player player: set data to hand the menu’s screen bytes of your
own (a machine’s tier, mode or recipes), up to 32 KiB, which the
client reads with native_screen_extra_data while the screen is open
(NeoForge’s openMenu with an extra-data writer). The first mod to
set it wins, so answer only for your blocks. The player’s state is not
swapped in.
Side: server.
Return Some to set data; the first mod returning Some wins.
fn mob_despawn(&self, host: &dyn Host, event: &mut MobDespawnEvent<'_>)
fn mob_despawn(&self, host: &dyn Host, event: &mut MobDespawnEvent<'_>)
NeoForge’s MobDespawnEvent: the mob mob (of type kind, at pos, given as data because a mob taken out for its tick does not resolve through its handle yet) is about to run Mob.checkDespawn, which fires once per tick for every mob that is ticked or only checked for despawning, persistent ones and peaceful-mode ones included. Set result: Allow discards the mob now, Deny keeps it this tick, and Default (the starting value) leaves vanilla’s rules to decide. Anything but Default skips vanilla’s checks, including the nextInt(800) draw of the idle-despawn roll, so the hook fires before that draw: a mob a mod denies does not consume it. A listener is a pure function of its inputs, because the hook fires on replayed ticks. The wither and the ender dragon override checkDespawn without super, so the event is not fired for them. Server-side. Tick-time effect: one listened branch per mob per tick with no listeners.
Side: server.
fn mob_effect_applicable(
&self,
host: &mut dyn ServerHost,
event: &mut MobEffectApplicableEvent,
) -> Option<EffectApplicable>
fn mob_effect_applicable( &self, host: &mut dyn ServerHost, event: &mut MobEffectApplicableEvent, ) -> Option<EffectApplicable>
NeoForge’s MobEffectEvent.Applicable, vanilla’s LivingEntity.canBeAffected: asked wherever the game checks whether the resolved EffectKey effect (minecraft:poison) can land on the living entity entity (a LivingRef, the player’s own included), before addEffect accepts it. Unlike the effect hooks above this fires for every effect, vanilla’s included, and only when an add is in flight. The first mod to answer decides: Allow or Deny overrides the vanilla tag check; an unanswered hook falls back to it. Server-side.
Side: server.
Return Some to set applicable; the first mod returning Some wins.
fn mob_effect_expired(
&self,
host: &dyn Host,
event: &mut MobEffectExpiredEvent,
) -> Flow
fn mob_effect_expired( &self, host: &dyn Host, event: &mut MobEffectExpiredEvent, ) -> Flow
NeoForge’s MobEffectEvent.Expired, vanilla LivingEntity.tickEffects: the resolved EffectKey effect (minecraft:speed, amplifier amplifier) on the living entity entity (a LivingRef, the player’s own included) counted down to nothing and is about to leave. Cancel and the effect stays, kept at no ticks and asked again next tick; unanswered, the expiry runs. Fires only on the tick an effect actually expires, never per tick. Server-side.
Side: server.
Return Flow::Cancel to take it: this sets cancel, and later mods are skipped unless they
listen with #[listener(receive_cancelled)]; those see event.cancelled and may set it back to
false.
fn mob_effect_remove(
&self,
host: &mut dyn ServerHost,
event: &mut MobEffectRemoveEvent,
) -> Flow
fn mob_effect_remove( &self, host: &mut dyn ServerHost, event: &mut MobEffectRemoveEvent, ) -> Flow
NeoForge’s MobEffectEvent.Remove, vanilla LivingEntity.removeEffect: the resolved EffectKey effect (minecraft:speed, amplifier amplifier) on the living entity entity (a LivingRef, the player’s own included) is about to be removed by any path that walks the vanilla funnel: a command or milk for the player, a cure for a zombie villager, a mod’s removal helper. Cancel and the effect stays. Server-side.
Side: server.
Return Flow::Cancel to take it: this sets cancel, and later mods are skipped unless they
listen with #[listener(receive_cancelled)]; those see event.cancelled and may set it back to
false.
fn mob_spawn_placement_check(
&self,
host: &dyn Host,
event: &mut MobSpawnPlacementCheckEvent<'_>,
)
fn mob_spawn_placement_check( &self, host: &dyn Host, event: &mut MobSpawnPlacementCheckEvent<'_>, )
NeoForge’s MobSpawnEvent.SpawnPlacementCheck: may the entity type kind spawn at pos in level for reason? It is asked after vanilla’s own spawn predicate (SpawnPlacements.checkSpawnRules: light, the ground it needs, the biome, slime chunks, the peaceful rule) has run: default_result is what it answered, and result starts as Default, which keeps that answer. Set Succeed or Fail to force the check. It runs wherever the game calls checkSpawnRules with the game’s level: natural spawning, a village siege’s zombies, a patrol, a zombie’s reinforcements, a spawner and a trial spawner. level is the level the mob would spawn in (dimension names it too), so a listener can read the blocks around pos through the host. spawner is the block that asked: Spawner::Block for a spawner block, Spawner::Trial for a trial spawner, and None for natural spawning, sieges, patrols, reinforcements and a spawner minecart. A spawner whose spawn data carries custom spawn rules never reaches it. The predicate always runs first, as default_result is its answer, so its random draws are vanilla’s whatever a mod answers; a listener should be a pure function of its inputs, because the checks run again when a tick is replayed. The host is the read-only one: a listener reads the world and writes nothing. Not told of /summon or a spawn egg, which do not check placements. Server-side. Beyond NeoForge: one SpawnCheck answers this event and mob_spawn_position_check, which NeoForge gives two nested enums with the same three constants.
Side: server.
fn mob_spawn_position_check(
&self,
host: &dyn Host,
event: &mut MobSpawnPositionCheckEvent<'_>,
)
fn mob_spawn_position_check( &self, host: &dyn Host, event: &mut MobSpawnPositionCheckEvent<'_>, )
NeoForge’s MobSpawnEvent.PositionCheck: may the freshly created mob of type kind stand at pos (its position, a mob’s centre) in level for reason? Vanilla’s two checks are Mob.checkSpawnRules (the type’s own rules) and Mob.checkSpawnObstruction (inside blocks or fluids, an ocelot’s grass and sea level). result starts as Default, which runs them; Succeed or Fail answers instead and they are skipped. It runs on natural spawning, chunk generation’s creature packs and spawner blocks (where a spawner with custom spawn rules skips Mob.checkSpawnRules on Default, as vanilla does). A trial spawner runs only checkSpawnObstruction, so only that is skipped. spawner is the block that asked (Spawner::Block or Spawner::Trial), None for natural spawning, chunk generation and a spawner minecart. mob is the mob itself, in no level yet: read it through the host (mob.kind(host), mob.position(host), mob.equipment(host, slot)); after the hook returns the handle answers Expired. It is the mob that spawns if the check passes, handed on rather than created again, and dropped without trace if it fails. Where the game does not create the mob fresh (chunk generation’s packs, a spawner whose spawn data carries entity data) the handle answers its kind and position and Unsupported for the rest. Server-side. With no listener or Default the checks and their random draws are vanilla’s (creating the mob for the listener draws nothing from the level’s random); Succeed and Fail skip the checks and so their draws, and the level random’s order changes only then; a listener should be a pure function of its inputs, because ticks are replayed.
Side: server.
fn mob_split(
&self,
host: &mut dyn ServerHost,
event: &mut MobSplitEvent<'_>,
) -> Flow
fn mob_split( &self, host: &mut dyn ServerHost, event: &mut MobSplitEvent<'_>, ) -> Flow
A slime, magma cube or sulfur cube is dying and about to split into
smaller ones (NeoForge’s MobSplitEvent, vanilla’s
AbstractCubeMob.remove): parent is its entity id, kind its type,
size its size, child_size the size of the children (half of it)
and count how many vanilla made (2 to 4 for a slime or magma cube,
2 for a sulfur cube; a primed one makes none and isn’t asked). A mod
may change count (0 spawns none, at most 64) or set cancel to
spawn no children. Only for a parent above size 1, once the child
count is drawn. NeoForge’s list of child mobs is this count:
changing a child or adding one of another kind needs a handle to a
mob not yet in the world, which Horizon doesn’t have yet. On the
server.
Side: server.
Return Flow::Cancel to take it: this sets cancel, and later mods are skipped unless they
listen with #[listener(receive_cancelled)]; those see event.cancelled and may set it back to
false.
fn register_configs(
&self,
host: HostSide<'_>,
event: &mut RegisterConfigsEvent<'_>,
)
fn register_configs( &self, host: HostSide<'_>, event: &mut RegisterConfigsEvent<'_>, )
The config files native mods keep (NeoForge’s registerConfig):
push yours, each of a kind, with the text written to config/ when
the file is missing. Asked by the window when the game starts (its
Client and Common configs), by a dedicated server when it starts
(Common and Server) and by a server before each world it opens
(Server); a game reads only its own kinds, so push them all every
time. Runs in Config: settings reads and the scoped ConfigFiles service
are available; world handles and transactions panic naming the phase. A file outside config/, or one already registered, is skipped.
Side: both.
Every mod gets event.configs in order and may add, change or remove configs.
fn config_loading(&self, host: HostSide<'_>, event: &mut ConfigLoadingEvent<'_>)
fn config_loading(&self, host: HostSide<'_>, event: &mut ConfigLoadingEvent<'_>)
A registered config was read (ModConfigEvent.Loading): config
says whose, which file and its text, which the mod parses (TOML by
convention). Every mod hears every config, so check mod_id. Fired
where the config’s kind loads (native_register_configs), a Server
one before native_server_about_to_start. Config allows settings reads
and the scoped ConfigFiles service, not world handles or transactions. Client and Common load once on their
owning side, Server once per world.
Side: both.
fn config_reloading(
&self,
host: HostSide<'_>,
event: &mut ConfigReloadingEvent<'_>,
)
fn config_reloading( &self, host: HostSide<'_>, event: &mut ConfigReloadingEvent<'_>, )
A loaded config’s file changed on disk (ModConfigEvent.Reloading):
its new text. The game looks at the files’ modification times once a
second, on the window and on the server’s tick; a file saved with the
same text, removed or unreadable fires nothing and keeps its last
text. Polling does not change the current phase.
Side: both.
fn config_unloading(
&self,
host: &mut dyn ServerHost,
event: &mut ConfigUnloadingEvent<'_>,
)
fn config_unloading( &self, host: &mut dyn ServerHost, event: &mut ConfigUnloadingEvent<'_>, )
A Server config is dropped as its server stops
(ModConfigEvent.Unloading), after native_server_stopping; the next
world reads it again. Client and Common configs stay until the
game quits. This notification leaves the World phase unchanged.
Side: server.
fn mod_mismatch(&self, host: HostSide<'_>, event: &mut ModMismatchEvent<'_>)
fn mod_mismatch(&self, host: HostSide<'_>, event: &mut ModMismatchEvent<'_>)
A saved mod list was read while opening a world. Fires even when the list
is empty or unchanged, never when absent. Both logical sides may open worlds;
singleplayer opens once on its integrated server. No cancellation or GUI warning.
Versions use the loader’s comparison; minecraft is excluded. Newly added mods
are not differences. Push a mod id converted with .into() into resolved.
Dispatch assigns the first resolving listener and preserves earlier markers.
The Host boundary is before world-state restoration, but after preparation:
raw-read-before-upgrade timing requires a pre-world Host which does not exist.
Side: both.
Every mod gets event.resolved in order and may add, change or remove resolved.
fn model_baking_completed(
&self,
host: &mut dyn ClientHost,
event: &mut ModelBakingCompletedEvent,
)
fn model_baking_completed( &self, host: &mut dyn ClientHost, event: &mut ModelBakingCompletedEvent, )
Every model of a resource load is baked and published (ModelEvent.BakingCompleted): the
block and item models and the standalone ones mods asked for (standalone_models), in the
store model now reads. Fires once per successful model load, after both
texture_atlas_stitched calls: on the first load before client_setup, and after every
successful resource reload (F3+T, a pack turned on or off, a server’s pack) before
client_resources_reloaded; a reload that fails fires nothing, and the old handles stay
right. Look the models a mod draws up here, once, through render_assets().model, and
keep the ModelRefs until the next model_baking_completed, when the old ones answer
ModelError::StaleModel. Never look them up by name every frame. Client-side.
Side: client.
fn movement_input(&self, host: &dyn ClientHost, event: &mut MovementInputEvent)
fn movement_input(&self, host: &dyn ClientHost, event: &mut MovementInputEvent)
Local player movement input, after reading it and before applying it. Side: client.
fn note_block_change(
&self,
level: &dyn LevelHost,
event: &mut NoteBlockChangeEvent<'_>,
) -> Flow
fn note_block_change( &self, level: &dyn LevelHost, event: &mut NoteBlockChangeEvent<'_>, ) -> Flow
A player is tuning a note block on the authoritative server, not in
client prediction. context gives its dimension, position, instrument
and old note; new_note starts as vanilla’s cycled note. Set it to 0
through 24; an out-of-range value keeps vanilla’s. Cancel to leave the
note unchanged and prevent playback.
Side: server.
Return Flow::Cancel to take it: this sets cancel, and later mods are skipped unless they
listen with #[listener(receive_cancelled)]; those see event.cancelled and may set it back to
false.
fn potential_spawns(
&self,
host: &dyn Host,
event: &mut PotentialSpawnsEvent<'_>,
) -> Flow
fn potential_spawns( &self, host: &dyn Host, event: &mut PotentialSpawnsEvent<'_>, ) -> Flow
Possible natural spawns at a server position (NeoForge’s
LevelEvent.PotentialSpawns, NaturalSpawner.mobsAt). Mods may add or
remove entries, or cancel to make the list empty. Mods can read the world,
but cannot write it during the spawn pass.
Side: server.
Return Flow::Cancel to take it: this sets canceled, and later mods are skipped unless they
listen with #[listener(receive_cancelled)]; those see event.cancelled and may set it back to
false.
fn village_siege(
&self,
host: &mut dyn ServerHost,
event: &mut VillageSiegeEvent<'_>,
) -> Flow
fn village_siege( &self, host: &mut dyn ServerHost, event: &mut VillageSiegeEvent<'_>, ) -> Flow
A village siege found a spawn position on the server. Set canceled
to stop the siege. There is one siege per dimension.
Side: server.
Return Flow::Cancel to take it: this sets canceled, and later mods are skipped unless they
listen with #[listener(receive_cancelled)]; those see event.cancelled and may set it back to
false.
fn neighbor_notify(
&self,
level: &dyn LevelHost,
event: &mut NeighborNotifyEvent,
) -> Flow
fn neighbor_notify( &self, level: &dyn LevelHost, event: &mut NeighborNotifyEvent, ) -> Flow
The block at pos (state) is about to tell its neighbours it
changed (NeoForge’s BlockEvent.NeighborNotifyEvent): at
ServerLevel.updateNeighborsAt, which notifies all six sides
(skipped_side is None), and updateNeighborsAtExceptFromFacing,
which notifies all but skipped_side. Set cancel and no neighbour
hears, on both paths. Asked for every such update, redstone
included: answer fast. Server-side.
Side: server.
Return Flow::Cancel to take it: this sets cancel, and later mods are skipped unless they
listen with #[listener(receive_cancelled)]; those see event.cancelled and may set it back to
false.
fn note_block_play(
&self,
level: &dyn LevelHost,
event: &mut NoteBlockPlayEvent<'_>,
) -> Flow
fn note_block_play( &self, level: &dyn LevelHost, event: &mut NoteBlockPlayEvent<'_>, ) -> Flow
The note block at pos is about to play (NeoForge’s
NoteBlockEvent.Play, in NoteBlock.playNote), once a block above
no longer mutes it. player and player_entity_id name the player
who tuned or punched it, and are None for redstone.
instrument is its instrument and note its note, 0 to 24; change
either to play another (a note out of range keeps the block’s own).
Set cancel and it doesn’t play: no sound, no particle, no
note_block_play game event. Server-side.
Side: server.
Return Flow::Cancel to take it: this sets cancel, and later mods are skipped unless they
listen with #[listener(receive_cancelled)]; those see event.cancelled and may set it back to
false.
fn permissions_changed(
&self,
host: &mut dyn ServerHost,
event: &mut PermissionsChangedEvent<'_>,
) -> Flow
fn permissions_changed( &self, host: &mut dyn ServerHost, event: &mut PermissionsChangedEvent<'_>, ) -> Flow
NeoForge’s PermissionsChangedEvent: the operator list is about to give player
player (name) the permission level new in place of old, through PlayerList.op
(/op, the console’s op, the management API’s operators/add and operators/set)
or PlayerList.deop (/deop and the same on the console and the management API;
new is then All). Set cancel and the list keeps the old level. The player need
not be online: player_entity_id is their server entity id when they are. Clearing
the list (operators/clear) is not a call to either, as in vanilla. Dedicated
servers only; a single-player world has no operator list. Server-side.
Side: server.
Return Flow::Cancel to take it: this sets cancel, and later mods are skipped unless they
listen with #[listener(receive_cancelled)]; those see event.cancelled and may set it back to
false.
fn player_break_speed(
&self,
host: HostSide<'_>,
event: &mut PlayerBreakSpeedEvent,
) -> Flow
fn player_break_speed( &self, host: HostSide<'_>, event: &mut PlayerBreakSpeedEvent, ) -> Flow
A player’s destroy speed for the block at pos may be changed or canceled.
Side: both.
Return Flow::Cancel to take it: this sets canceled, and later mods are skipped unless they
listen with #[listener(receive_cancelled)]; those see event.cancelled and may set it back to
false.
fn player_brewed_potion(
&self,
host: &mut dyn ServerHost,
event: &mut PlayerBrewedPotionEvent<'_>,
)
fn player_brewed_potion( &self, host: &mut dyn ServerHost, event: &mut PlayerBrewedPotionEvent<'_>, )
A server player took stack from a brewing stand bottle slot
(BrewingStandMenu.PotionSlot.onTake): player is their UUID and
player_entity_id their network id.
Side: server.
fn player_enchant_item(
&self,
host: &mut dyn ServerHost,
event: &mut PlayerEnchantItemEvent<'_>,
)
fn player_enchant_item( &self, host: &mut dyn ServerHost, event: &mut PlayerEnchantItemEvent<'_>, )
A server player enchanted item at an enchanting table
(EnchantmentMenu.clickMenuButton): enchantments are the ones it was
given, in order, as (id, level). item is the enchanted stack (an
enchanted book for a book). Fires after the levels are paid, before
enchant_item. Server-side.
Side: server.
fn player_flyable_fall(
&self,
host: &mut dyn ServerHost,
event: &mut PlayerFlyableFallEvent<'_>,
)
fn player_flyable_fall( &self, host: &mut dyn ServerHost, event: &mut PlayerFlyableFallEvent<'_>, )
NeoForge’s PlayerFlyableFallEvent: server player player (name) landed after
falling distance blocks at damage multiplier multiplier while allowed to fly (a
creative or spectator player walking), so Player.causeFallDamage returned early
and nothing was hurt. Listen only. Once for each landing, after the fall’s
block reaction. The player’s state is swapped in. Server-side.
Side: server.
fn player_harvest_check(
&self,
host: HostSide<'_>,
event: &mut PlayerHarvestCheckEvent,
)
fn player_harvest_check( &self, host: HostSide<'_>, event: &mut PlayerHarvestCheckEvent, )
A player’s ability to harvest the block at pos may be changed.
Side: both.
Every mod gets event.can_harvest in order and may add, change or remove can_harvest.
fn player_heart_type(
&self,
host: &mut dyn ClientHost,
event: &mut PlayerHeartTypeEvent<'_>,
)
fn player_heart_type( &self, host: &mut dyn ClientHost, event: &mut PlayerHeartTypeEvent<'_>, )
Which hearts the local player’s health bar draws this frame (NeoForge’s
PlayerHeartTypeEvent, from Gui.HeartType.forPlayer): kind comes in as vanilla’s pick
(poisoned, else withered, else frozen when fully frozen, else normal); set it to draw
another kind. Asked once a frame while the HUD draws the hearts (not in creative or
spectator, not under F1), before health_hud, whose inputs.kind carries the answer.
Only the heart sprites change: health, regeneration and the other rows stay vanilla’s.
Client-side.
Side: client.
fn player_inventory_changed(
&self,
host: &mut dyn ServerHost,
event: &mut PlayerInventoryChangedEvent<'_>,
)
fn player_inventory_changed( &self, host: &mut dyn ServerHost, event: &mut PlayerInventoryChangedEvent<'_>, )
native_player_inventory_changed(player, stacks): a server player’s inventory changed, at the moment vanilla’s InventoryChangeTrigger is checked (the per-tick check found another item or count in a slot), heard before any criterion and whether or not the tree has inventory_changed advancements. stacks are the 41 slots in Inventory numbering: 0..36 the main inventory (0..9 the hotbar), 36..40 the armour (feet, legs, chest, head), 40 the off hand. It also fires at a player’s first check after joining, so a mod sees what they log in with. The player’s state is swapped in, so the helpers read that player. Single player, LAN guests and a dedicated server’s players; never on a client of a remote server. Quest, collection and ‘obtain an item’ mods need it instead of polling every inventory. Bundles need “hooks”: @API:player_inventory_changed@.
Side: server.
fn player_item_smithed(
&self,
host: &mut dyn ServerHost,
event: &mut PlayerItemSmithedEvent<'_>,
)
fn player_item_smithed( &self, host: &mut dyn ServerHost, event: &mut PlayerItemSmithedEvent<'_>, )
PlayerEvent.ItemSmithedEvent: a server player took result from a
smithing table (SmithingMenu.onTake, or onQuickCraft for a
shift-click): player is their UUID and player_entity_id their
network id, inputs the template, base and addition as they were
before the take used them (None for an empty slot). It comes once the click is done, so the
menu already holds the used inputs, but before the table sounds.
Server-side.
Side: server.
fn player_name_format(
&self,
context: &dyn LoopContext,
event: &mut PlayerNameFormatEvent<'_>,
)
fn player_name_format( &self, context: &dyn LoopContext, event: &mut PlayerNameFormatEvent<'_>, )
A player’s display name was formatted. Replace displayname to change it.
Both sides: context.side() says which. It runs while a chat line or a command’s feedback is built. Answer from the arguments and context alone, and fast: context holds the side, the registries and the settings of the resource generation, and a /reload builds the next one.
Side: both.
Every mod gets event.displayname in order and may add, change or remove displayname.
fn player_set_spawn(
&self,
host: &mut dyn ServerHost,
event: &mut PlayerSetSpawnEvent<'_>,
) -> Flow
fn player_set_spawn( &self, host: &mut dyn ServerHost, event: &mut PlayerSetSpawnEvent<'_>, ) -> Flow
NeoForge’s PlayerSetSpawnEvent: a server player’s respawn point is about to be
set (ServerPlayer.setRespawnPosition), once for each call vanilla makes: every sleep
in a bed (the same bed too, which refreshes its angle), an anchor that is a new
point, /spawnpoint, and the copy to the new player when a player respawns and their
respawn block was found (pos is none for a player with no point). A respawn block
that is gone makes no call. pos is the block position and dimension its level;
forced is /spawnpoint’s flag. Set cancel and the point stays as it was (the
respawned player is left with none). player_entity_id is the server’s entity id for
the player. Server-side.
Side: server.
Return Flow::Cancel to take it: this sets cancel, and later mods are skipped unless they
listen with #[listener(receive_cancelled)]; those see event.cancelled and may set it back to
false.
fn player_spawn_phantoms(
&self,
host: &mut dyn ServerHost,
event: &mut PlayerSpawnPhantomsEvent<'_>,
) -> Option<PhantomSpawnResult>
fn player_spawn_phantoms( &self, host: &mut dyn ServerHost, event: &mut PlayerSpawnPhantomsEvent<'_>, ) -> Option<PhantomSpawnResult>
PlayerSpawnPhantomsEvent: the phantom spawner is about to decide whether to try a
spawn near a non-spectator server player, before its difficulty and rest rolls.
result starts empty, meaning Default (skylight and sea level check); Allow skips
that check and Deny stops the attempt. phantoms starts with a randomly drawn
group size; set it to override the count. Without mods the original draw order is kept.
Side: server.
Return Some to set result; the first mod returning Some wins.
fn player_stays_on_ground_surface(
&self,
context: &dyn LoopContext,
event: &mut PlayerStaysOnGroundSurfaceEvent,
)
fn player_stays_on_ground_surface( &self, context: &dyn LoopContext, event: &mut PlayerStaysOnGroundSurfaceEvent, )
The player’s crouch edge backoff (Player.maybeBackOffFromEdge) asks whether the player is staying on the ground surface (Player.isStayingOnGroundSurface, vanilla: the shift key is down). entity is the player’s id; a mod may change staying, so a mod can make the player hold to an edge without crouching, or walk off while crouching. Fires on both sides, on the client’s replayed ticks too, with the loop context of the side that ticks the player (its registries, settings and mod list): register the mod on both, and keep the listener a pure function of its inputs so prediction and the server agree. Beyond NeoForge: there is no counterpart. Diverges from upstream: new hook.
Side: both.
fn player_tab_list_name_format(
&self,
context: &dyn LoopContext,
event: &mut PlayerTabListNameFormatEvent<'_>,
)
fn player_tab_list_name_format( &self, context: &dyn LoopContext, event: &mut PlayerTabListNameFormatEvent<'_>, )
ServerPlayer.getTabListDisplayName: the name the Tab list shows for
player, None to let the client choose it. Replace display_name to
change it. It runs while the Tab list is built. Answer from the arguments and context alone, and fast: context holds the side, the registries and the settings of the resource generation, and a /reload builds the next one.
Side: server.
Every mod gets event.display_name in order and may add, change or remove display_name.
fn player_xp_change(
&self,
host: &mut dyn ServerHost,
event: &mut PlayerXpChangeEvent<'_>,
) -> Flow
fn player_xp_change( &self, host: &mut dyn ServerHost, event: &mut PlayerXpChangeEvent<'_>, ) -> Flow
A server player’s experience points are about to change through
Player.giveExperiencePoints (NeoForge’s PlayerXpEvent.XpChange): an
orb pickup after mending, an advancement reward, or /xp add ... points.
Change the signed amount (in points) or set cancel to give nothing.
Experience bottles and furnaces make orbs, so they come through the orb
path. Server-side.
Side: server.
Return Flow::Cancel to take it: this sets cancel, and later mods are skipped unless they
listen with #[listener(receive_cancelled)]; those see event.cancelled and may set it back to
false.
fn player_xp_level_change(
&self,
host: &mut dyn ServerHost,
event: &mut PlayerXpLevelChangeEvent<'_>,
) -> Flow
fn player_xp_level_change( &self, host: &mut dyn ServerHost, event: &mut PlayerXpLevelChangeEvent<'_>, ) -> Flow
A server player’s level is about to change through
Player.giveExperienceLevels: once per level gained or lost by points,
and for the anvil, /experience add ... levels and PlayerRef::give_levels.
Change levels, or set cancel to leave the level unchanged. The
player’s state is swapped in, so host.players().acting_player(), PlayerRef::tell
and the item helpers reach them. Server-side.
Side: server.
Return Flow::Cancel to take it: this sets cancel, and later mods are skipped unless they
listen with #[listener(receive_cancelled)]; those see event.cancelled and may set it back to
false.
fn portal_spawn(
&self,
level: &dyn LevelHost,
event: &mut PortalSpawnEvent,
) -> Flow
fn portal_spawn( &self, level: &dyn LevelHost, event: &mut PortalSpawnEvent, ) -> Flow
A fire placed at pos (state) found an empty obsidian frame, shape,
and is about to fill it with a nether portal (BlockEvent.PortalSpawnEvent,
in BaseFireBlock.onPlace), in the Overworld or the Nether. Set
cancel and no portal forms: the fire stays where it can survive, as
without a frame. Server-side.
Side: server.
Return Flow::Cancel to take it: this sets cancel, and later mods are skipped unless they
listen with #[listener(receive_cancelled)]; those see event.cancelled and may set it back to
false.
fn potion_brew_post(
&self,
host: &mut dyn ServerHost,
event: &mut PotionBrewPostEvent<'_>,
)
fn potion_brew_post( &self, host: &mut dyn ServerHost, event: &mut PotionBrewPostEvent<'_>, )
A brewing stand at pos brewed (PotionBrewEvent.Post, at the end of
BrewingStandBlockEntity.doBrew), or potion_brew_pre was cancelled:
stacks holds its five slots after the brew (or as the cancelling
mods left them), and what the mods leave there is the stand’s. Fires
last, as doBrew ends: after brewing_complete, the brew sound and
the ingredient’s remainder dropping. Server-side.
Side: server.
fn potion_brew_pre(
&self,
host: &mut dyn ServerHost,
event: &mut PotionBrewPreEvent<'_>,
) -> Flow
fn potion_brew_pre( &self, host: &mut dyn ServerHost, event: &mut PotionBrewPreEvent<'_>, ) -> Flow
A brewing stand at pos is about to brew (PotionBrewEvent.Pre,
in BrewingStandBlockEntity.doBrew): stacks is a copy of its five
slots (three bottles, the ingredient, the fuel). Set cancel to skip
vanilla’s brew: the stand then takes stacks as the mods left them,
uses no ingredient and plays no brew sound, and potion_brew_post
fires with those slots; brewing_complete doesn’t, as nothing was
brewed. Uncancelled, changes to stacks are dropped. Server-side.
Side: server.
Return Flow::Cancel to take it: this sets cancel, and later mods are skipped unless they
listen with #[listener(receive_cancelled)]; those see event.cancelled and may set it back to
false.
fn recipe_book_categories(
&self,
host: HostSide<'_>,
event: &mut RecipeBookCategoriesEvent<'_>,
)
fn recipe_book_categories( &self, host: HostSide<'_>, event: &mut RecipeBookCategoriesEvent<'_>, )
Supply categories and vanilla-shaped displays for custom recipe types.
Asked lazily once per recipe table. Use the Host’s recipe table to build
RecipeBookCategory::displays from the type’s own opaque recipe JSON.
Each category names its menu, book identity and per-book search group.
The display/index load boundary returns typed errors; screen integration
is separate. This declaration does not register a settings book (#2415).
Side: both.
fn recipe_property_sets(
&self,
context: &dyn DataLoadContext,
event: &mut RecipePropertySetsEvent<'_>,
)
fn recipe_property_sets( &self, context: &dyn DataLoadContext, event: &mut RecipePropertySetsEvent<'_>, )
Items a mod’s own recipe type takes in a station slot, added to the
recipe property sets (RecipeManager.RECIPE_PROPERTY_SETS): what a
furnace, blast furnace, smoker, campfire, smithing table slot or brewing
stand slot accepts, and what a client predicts it accepts. Push one
RecipePropertyAddition per set to add to; the vanilla recipes’ own
items stay in. Called once per load, after the recipes are resolved, with
the DataLoadContext of the load that owns them (origin()
ServerDataLoad on a server, ClientPreload on a client’s own load),
and again after /reload. A new namespaced key creates a set when its
namespace belongs to the listener’s manifest (its ID or namespaces).
Later listeners may extend existing sets. Invalid or foreign new keys,
unknown vanilla keys, and air are logged and skipped; unknown items are
ignored. Custom sets are synced to clients alongside vanilla sets. The
answer must be the same every time.
Side: both.
Every mod gets event.additions in order and may add, change or remove additions.
fn register_block_tint_sources(
&self,
context: &RegistrationContext,
event: &mut RegisterBlockTintSourcesEvent<'_>,
)
fn register_block_tint_sources( &self, context: &RegistrationContext, event: &mut RegisterBlockTintSourcesEvent<'_>, )
The tint sources of blocks (NeoForge’s RegisterColorHandlersEvent.BlockTintSources,
vanilla’s BlockColors.register): register(layers, blocks), and a model face with
tintindex i is multiplied by layer i of its block’s list; a face past the list is not
tinted. A layer is one of vanilla’s sources (VanillaTint) or the mod’s own
BlockTintSource. Blocks are ids, a mod’s or vanilla’s, and a later registration for a
block replaces the earlier one, vanilla’s own colours included. Asked once at start on the
client, before resources load; every resource load, a pack reload included, applies the
registrations again. An id no block has is logged and skipped.
Side: client.
fn register_cauldron_fluid_content(
&self,
context: &RegistrationContext,
event: &mut RegisterCauldronFluidContentEvent<'_>,
)
fn register_cauldron_fluid_content( &self, context: &RegistrationContext, event: &mut RegisterCauldronFluidContentEvent<'_>, )
Say which fluid, and how much, one of your cauldron blocks holds (NeoForge
RegisterCauldronFluidContentEvent), so the fluid capability (FLUIDS) fills and
drains it as it does vanilla’s water and lava cauldrons. Asked once the block registry
is resolved, before any world opens, and again on a resource reload. Give
event.contents.register(block, fluid, total, level) the block and fluid keys your
register hook requested, the millibuckets the cauldron holds when full, and the name
of its integer level property, or none for a cauldron only ever full. The engine
refuses, with one logged warning naming both sides, a block that already has a content,
a fluid that already has a cauldron, an unknown block or fluid, a level property the
block lacks or that isn’t an integer, and a total of 0 or one that doesn’t divide
evenly by the levels; the rest of a mod’s contents still apply.
Side: server.
Every mod gets event.contents in order and may add, change or remove contents.
fn register_cauldron_interaction(
&self,
context: &RegistrationContext,
event: &mut RegisterCauldronInteractionEvent<'_>,
)
fn register_cauldron_interaction( &self, context: &RegistrationContext, event: &mut RegisterCauldronInteractionEvent<'_>, )
Register exact cauldron item interactions on both sides before snapshot publication. Vanilla dye tags take precedence, and duplicate entries refuse preparation. Side: both.
fn register_color_resolvers(
&self,
context: &RegistrationContext,
event: &mut RegisterColorResolversEvent<'_>,
)
fn register_color_resolvers( &self, context: &RegistrationContext, event: &mut RegisterColorResolversEvent<'_>, )
The colour resolvers block tints blend over the biomes around a block (NeoForge’s
RegisterColorHandlersEvent.ColorResolvers): register(resolver) adds the mod’s own
BiomeColorResolver and returns the ColorResolver its block tint sources pass to
BlockAndTintGetter::block_tint. The game blends a mod’s resolver over the biome blend
radius and caches it per section while it meshes, as it does vanilla’s grass, foliage and
water. Asked once at start on the client, before register_block_tint_sources and before
resources load.
Side: client.
fn register_debug_entries(
&self,
context: &RegistrationContext,
event: &mut RegisterDebugEntriesEvent<'_>,
)
fn register_debug_entries( &self, context: &RegistrationContext, event: &mut RegisterDebugEntriesEvent<'_>, )
The F3 debug entries a mod adds (NeoForge’s RegisterDebugEntriesEvent): push a DebugEntry
per entry, its id <mod id>:<path> and the vanilla group its lines join. Asked once at start,
on the client. An id in vanilla’s namespace, not of that form, or registered already is logged
and left out. Each entry is listed and switched on or off with vanilla’s, and debug_entry_lines
fills it while it is on.
Side: client.
Every mod gets event.entries in order and may add, change or remove entries.
fn register_debug_renderers(
&self,
context: &RegistrationContext,
event: &mut RegisterDebugRenderersEvent<'_>,
)
fn register_debug_renderers( &self, context: &RegistrationContext, event: &mut RegisterDebugRenderersEvent<'_>, )
The world-space debug renderers a mod has now (NeoForge’s RegisterDebugRenderersEvent): push a
DebugRenderer per renderer. Asked at each renderer list refresh, on the client.
Side: client.
Every mod gets event.renderers in order and may add, change or remove renderers.
fn register_dimension_transition_screen(
&self,
context: &RegistrationContext,
event: &mut RegisterDimensionTransitionScreenEvent<'_>,
)
fn register_dimension_transition_screen( &self, context: &RegistrationContext, event: &mut RegisterDimensionTransitionScreenEvent<'_>, )
Register loading screens once at client startup (NeoForge’s
RegisterDimensionTransitionScreenEvent). Conditional source/destination pairs take
priority over incoming registrations, which take priority over outgoing registrations.
Duplicate transition registrations keep the first; invalid ids are logged and skipped.
An unmatched transition uses vanilla’s screen and every screen uses the existing tracker.
Side: client.
Every mod gets event.screens in order and may add, change or remove screens.
fn register_enchantment_damage_effects(
&self,
context: &RegistrationContext,
event: &mut RegisterEnchantmentDamageEffectsEvent<'_>,
)
fn register_enchantment_damage_effects( &self, context: &RegistrationContext, event: &mut RegisterEnchantmentDamageEffectsEvent<'_>, )
Register namespaced enchantment damage value effects once before content loads.
Custom nodes in minecraft:damage, including nested minecraft:all_of, resolve to
these callbacks at load. Unknown identifiers reject the enchantment with a diagnostic.
Callbacks receive a read-only ServerHost, actual attacker and victim handles and the
pre-hit weapon snapshot. Vanilla nodes and requirements retain their traversal and RNG
order. This is vanilla EnchantmentHelper.modifyDamage, not an incoming-damage event.
Side: server.
Every mod gets event.effects in order and may add, change or remove effects.
fn register_entity_spectator_shaders(
&self,
context: &RegistrationContext,
event: &mut RegisterEntitySpectatorShadersEvent<'_>,
)
fn register_entity_spectator_shaders( &self, context: &RegistrationContext, event: &mut RegisterEntitySpectatorShadersEvent<'_>, )
Register the screen effect spectating an entity type puts on, once at client startup
(NeoForge’s RegisterEntitySpectatorShadersEvent), as vanilla’s creeper, spider and
enderman do. The first registration for an entity type wins, vanilla’s own counting as
first, so a mod can’t change what the vanilla mobs show; a skipped or malformed
registration is logged. The effect applies while the first-person view follows that
entity, and the third-person view or leaving it clears it.
Side: client.
Every mod gets event.shaders in order and may add, change or remove shaders.
fn register_fluid_models(
&self,
context: &RegistrationContext,
event: &mut RegisterFluidModelsEvent<'_>,
)
fn register_fluid_models( &self, context: &RegistrationContext, event: &mut RegisterFluidModelsEvent<'_>, )
The models of your world fluids (NeoForge’s RegisterFluidModelsEvent): push a
mod_api::FluidModel per fluid whose look doesn’t say all of it. Its
sprites are block atlas textures, baked at every resource load from that pack’s files; the
tint stays the look’s. A fluid without one draws its look’s sprite on every surface, or
water’s textures when it has none. Asked at startup and on resource reload before baking, and
only on the client.
Side: client.
Every mod gets event.models in order and may add, change or remove models.
fn register_game_tests(
&self,
host: &dyn Host,
event: &mut RegisterGameTestsEvent<'_>,
)
fn register_game_tests( &self, host: &dyn Host, event: &mut RegisterGameTestsEvent<'_>, )
Register namespaced test functions before the world’s test definitions load. Each function runs with a ServerHost once per attempt in the real test level. The runner retains ownership of retries, timeout and completion. Side: server.
fn register_gui_layers(
&self,
context: &RegistrationContext,
event: &mut RegisterGuiLayersEvent<'_>,
)
fn register_gui_layers( &self, context: &RegistrationContext, event: &mut RegisterGuiLayersEvent<'_>, )
The HUD layers a mod adds among vanilla’s (NeoForge’s RegisterGuiLayersEvent): push a
GuiLayer per layer, its id <mod id>:<path> and its GuiLayerPlacement. Asked once at
start, on the client. gui_layer_draw draws each layer, between gui_layer_pre and
gui_layer_post like a vanilla layer, so other mods can hide it or draw around it.
Side: client.
Every mod gets event.layers in order and may add, change or remove layers.
fn register_item_models(
&self,
context: &RegistrationContext,
event: &mut RegisterItemModelsEvent<'_>,
)
fn register_item_models( &self, context: &RegistrationContext, event: &mut RegisterItemModelsEvent<'_>, )
The item model node types a mod adds (NeoForge’s RegisterItemModelsEvent): push each
type id, <mod id>:<path>. Asked once at start on the client, before resources load. An
item definition’s node whose type is a registered id draws, per stack, the named models
item_model_update answers. An id in vanilla’s namespace, not of that form, or registered
already is logged and left out.
Side: client.
Every mod gets event.models in order and may add, change or remove models.
fn register_item_tint_sources(
&self,
context: &RegistrationContext,
event: &mut RegisterItemTintSourcesEvent<'_>,
)
fn register_item_tint_sources( &self, context: &RegistrationContext, event: &mut RegisterItemTintSourcesEvent<'_>, )
The item tint sources a mod adds (NeoForge’s RegisterColorHandlersEvent.ItemTintSources):
push each id, <mod id>:<path>. Asked once at start on the client, before resources load.
An entry in a minecraft:model’s tints whose type is a registered id colours its
tintindex with what item_tint_source answers per stack, also after a resource reload. An id
in vanilla’s namespace, not of that form, or registered already is logged and left out; a
tint source nobody registers draws white.
Side: client.
Every mod gets event.sources in order and may add, change or remove sources.
fn register_layer_definitions(
&self,
context: &RegistrationContext,
event: &mut RegisterLayerDefinitionsEvent<'_>,
)
fn register_layer_definitions( &self, context: &RegistrationContext, event: &mut RegisterLayerDefinitionsEvent<'_>, )
Entity model layers built in code (NeoForge’s
EntityRenderersEvent.RegisterLayerDefinitions): push each one’s id,
<mod id>:<model>#<layer> as a ModelLayerLocation names it
(mymod:golem#main), and its LayerDefinition, as the mod’s
createBodyLayer() builds it. native_bake_layer bakes one into the
ModelPart tree native_draw_model_part draws. Asked once at start,
on the client. An id in vanilla’s namespace, not of that form, or
registered already is logged and left out. API @API:model_layers@.
Side: client.
Every mod gets event.layers in order and may add, change or remove layers.
fn register_model_loaders(
&self,
context: &RegistrationContext,
event: &mut RegisterModelLoadersEvent<'_>,
)
fn register_model_loaders( &self, context: &RegistrationContext, event: &mut RegisterModelLoadersEvent<'_>, )
The model loaders a mod adds (NeoForge’s ModelEvent.RegisterLoaders): push each loader
id, <mod id>:<path>. Asked once at start on the client, before resources load. A model
whose loader is a registered id gets the quads bake_model_loader answers, baked with
its elements, on every load and reload. An id in vanilla’s namespace, not of that form, or
registered already is logged and left out.
Side: client.
Every mod gets event.loaders in order and may add, change or remove loaders.
fn register_particle_groups(
&self,
context: &RegistrationContext,
event: &mut RegisterParticleGroupsEvent<'_>,
)
fn register_particle_groups( &self, context: &RegistrationContext, event: &mut RegisterParticleGroupsEvent<'_>, )
The render groups a mod’s particles draw in (NeoForge’s RegisterParticleGroupsEvent): push a
ParticleGroup per group, its id <mod id>:<path>, how it blends and the particle types in
it. Asked once at start, on the client, before resources load; the game resolves each
type’s group when the particle sprite sets load, on every resource load as well. An id in
vanilla’s namespace, not of that form, or registered already is logged and left out.
Side: client.
Every mod gets event.groups in order and may add, change or remove groups.
fn register_particle_providers(
&self,
context: &RegistrationContext,
event: &mut RegisterParticleProvidersEvent<'_>,
)
fn register_particle_providers( &self, context: &RegistrationContext, event: &mut RegisterParticleProvidersEvent<'_>, )
The code-defined particle providers of a mod’s own particle types (NeoForge’s
RegisterParticleProvidersEvent): register(name, provider), and every particle of the
type name (ParticleOptions::named("mymod:spark")) is moved each tick by
ParticleProvider::tick. The sprite set and the declarative spawn values stay in
assets/<namespace>/particles/<path>.json. A later registration for a name replaces the
earlier one; a name no sprite set matches is logged and draws nothing. Asked once at start
on the client, before resources load; the game resolves each type’s provider when the
sprite sets load, on every resource load as well.
Side: client.
fn register_preset_editors(
&self,
context: &RegistrationContext,
event: &mut RegisterPresetEditorsEvent<'_>,
)
fn register_preset_editors( &self, context: &RegistrationContext, event: &mut RegisterPresetEditorsEvent<'_>, )
Register client screens for world-preset keys once at startup. The first registration for a key wins. Invalid ids are refused. Unregistered presets retain their built-in editor, or their disabled Customize button. Side: client.
Every mod gets event.editors in order and may add, change or remove editors.
fn register_range_select_item_model_property(
&self,
context: &RegistrationContext,
event: &mut RegisterRangeSelectItemModelPropertyEvent<'_>,
)
fn register_range_select_item_model_property( &self, context: &RegistrationContext, event: &mut RegisterRangeSelectItemModelPropertyEvent<'_>, )
The numeric item model properties a mod adds (NeoForge’s
RegisterRangeSelectItemModelPropertyEvent): push each id, <mod id>:<path>. Asked once at
start on the client, before resources load. A minecraft:range_dispatch naming a registered
property thresholds on the number item_model_range_property answers per stack, also after a
resource reload. An id in vanilla’s namespace, not of that form, or registered already is
logged and left out; a property nobody registers reads 0.
Side: client.
Every mod gets event.properties in order and may add, change or remove properties.
fn register_render_pipelines(
&self,
context: &RegistrationContext,
event: &mut RegisterRenderPipelinesEvent<'_>,
)
fn register_render_pipelines( &self, context: &RegistrationContext, event: &mut RegisterRenderPipelinesEvent<'_>, )
Register the mod’s own render pipelines, once at client startup (NeoForge’s
RegisterRenderPipelinesEvent; 1.21.1 mods used RegisterShadersEvent): push a
RenderPipeline for each into event.pipelines. The game builds them with its own at
startup and again on every resource reload. An id outside the mod’s namespaces, one an
earlier registration took are logged with the mod and
dropped. A pipeline whose shader is missing or doesn’t compile is logged and resolves to
RenderPipelineError::Invalid; the game starts either way.
Side: client.
Every mod gets event.pipelines in order and may add, change or remove pipelines.
fn register_runtime_sprites(
&self,
context: &RegistrationContext,
event: &mut RegisterRuntimeSpritesEvent<'_>,
)
fn register_runtime_sprites( &self, context: &RegistrationContext, event: &mut RegisterRuntimeSpritesEvent<'_>, )
Collect static, mod-generated PNGs for the block and GUI atlases. Called at first client load and every resource reload, before textures are stitched. Side: client.
Every mod gets event.sprites in order and may add, change or remove sprites.
fn register_select_item_model_property(
&self,
context: &RegistrationContext,
event: &mut RegisterSelectItemModelPropertyEvent<'_>,
)
fn register_select_item_model_property( &self, context: &RegistrationContext, event: &mut RegisterSelectItemModelPropertyEvent<'_>, )
The categorical item model properties a mod adds (NeoForge’s
RegisterSelectItemModelPropertyEvent): push each id, <mod id>:<path>. Asked once at start
on the client, before resources load. A minecraft:select naming a registered property picks
the case whose when string equals what item_model_select_property answers per stack, also
after a resource reload. An id in vanilla’s namespace, not of that form, or registered already
is logged and left out; a select on a property nobody registers draws its fallback.
Side: client.
Every mod gets event.properties in order and may add, change or remove properties.
fn register_sprite_sources(
&self,
context: &RegistrationContext,
event: &mut RegisterSpriteSourcesEvent<'_>,
)
fn register_sprite_sources( &self, context: &RegistrationContext, event: &mut RegisterSpriteSourcesEvent<'_>, )
The atlas sprite source types a mod adds (NeoForge’s RegisterSpriteSourcesEvent): push
each type id, <mod id>:<path>. Asked once at start on the client, before resources load.
An entry of an atlas definition’s sources whose type is a registered id is answered by
sprite_source at its place in the list, on every load and reload. An id in vanilla’s
namespace, not of that form, or registered already is logged and left out.
Side: client.
Every mod gets event.sources in order and may add, change or remove sources.
fn register_texture_atlases(
&self,
context: &RegistrationContext,
event: &mut RegisterTextureAtlasesEvent<'_>,
)
fn register_texture_atlases( &self, context: &RegistrationContext, event: &mut RegisterTextureAtlasesEvent<'_>, )
Declare atlases beside the game’s (RegisterTextureAtlasesEvent), each with the atlas
definition that lists its sprites. Called at first client load and every resource reload,
before textures are stitched.
Side: client.
Every mod gets event.atlases in order and may add, change or remove atlases.
fn register_villager_professions(
&self,
context: &RegistrationContext,
event: &mut RegisterVillagerProfessionsEvent<'_>,
)
fn register_villager_professions( &self, context: &RegistrationContext, event: &mut RegisterVillagerProfessionsEvent<'_>, )
Declare villager professions once per mod load, before world admission. The engine resolves every reference atomically with the owning resource tables. Vanilla replacement and overlapping custom acquisition POIs are refused. The public NeoForge 26.3 Javadoc was unreachable; no event parity is claimed. Side: server.
Every mod gets event.professions in order and may add, change or remove professions.
fn render_arm(
&self,
host: &dyn ClientHost,
event: &mut RenderArmEvent<'_>,
) -> Flow
fn render_arm( &self, host: &dyn ClientHost, event: &mut RenderArmEvent<'_>, ) -> Flow
Before this window’s player’s first-person left or right arm is
drawn (RenderArmEvent, in renderPlayerArm and renderMapHand):
the empty main hand’s arm, and the arms under a held map, never while
the player is invisible. player and player_entity_id are the
local player’s UUID and entity id. draw’s pose stack starts at the
arm model’s origin, in blocks, posed as vanilla’s arm is (with any
native_render_hand), lit with the light at the eyes; add
geometry with native_draw_cube, native_draw_quad, native_draw_block
and native_draw_item. Set canceled to leave out vanilla’s arm;
what the mods drew stays. Client-side.
Side: client.
Return Flow::Cancel to take it: this sets canceled, and later mods are skipped unless they
listen with #[listener(receive_cancelled)]; those see event.cancelled and may set it back to
false.
fn render_frame_post(
&self,
host: &mut dyn ClientHost,
event: &mut RenderFramePostEvent,
)
fn render_frame_post( &self, host: &mut dyn ClientHost, event: &mut RenderFramePostEvent, )
Once a frame, in a world or not, right after the frame was rendered
(NeoForge’s RenderFrameEvent.Post). elapsed is the frame’s time. It
fires for a frame that was skipped too; flip_frame is the moment a
frame was presented. Client-side.
Side: client.
fn render_frame_pre(
&self,
host: &mut dyn ClientHost,
event: &mut RenderFramePreEvent,
)
fn render_frame_pre( &self, host: &mut dyn ClientHost, event: &mut RenderFramePreEvent, )
Once a frame, in a world or not, after Horizon’s extras and just before
the frame is rendered (NeoForge’s RenderFrameEvent.Pre). elapsed is
the frame’s time. Client-side.
Side: client.
fn render_gui_post(
&self,
host: &dyn ClientHost,
event: &mut RenderGuiPostEvent<'_>,
)
fn render_gui_post( &self, host: &dyn ClientHost, event: &mut RenderGuiPostEvent<'_>, )
The HUD (not drawn under F1), after the minimap (NeoForge’s
RenderGuiEvent.Post): place a box with corners.place (boxes stack
away from their edge) and draw it with native_fill and native_text.
Skip a corner native_corner_shown says is taken. Not heard when a mod
canceled render_gui_pre. Client-side.
Side: client.
fn render_gui_pre(
&self,
host: &dyn ClientHost,
event: &mut RenderGuiPreEvent,
) -> Flow
fn render_gui_pre( &self, host: &dyn ClientHost, event: &mut RenderGuiPreEvent, ) -> Flow
Before the in-world HUD is drawn (NeoForge’s RenderGuiEvent.Pre):
return Flow::Cancel and none of it is, as under F1: no vanilla layer (and so
no gui_layer_pre or gui_layer_post), no render_gui_post, and no
chat or toasts. Fires once a frame in a world, not under F1 and not
while a server dialog or the connection screen covers the window.
Client-side.
Side: client.
Return Flow::Cancel to take it: this sets canceled, and later mods are skipped unless they
listen with #[listener(receive_cancelled)]; those see event.cancelled and may set it back to
false.
fn render_item_in_frame(
&self,
host: &dyn ClientHost,
event: &mut RenderItemInFrameEvent<'_>,
) -> Flow
fn render_item_in_frame( &self, host: &dyn ClientHost, event: &mut RenderItemInFrameEvent<'_>, ) -> Flow
Before a visible item frame’s item or map is drawn. Cancel hides the item, not the frame. Side: client.
Return Flow::Cancel to take it: this sets canceled, and later mods are skipped unless they
listen with #[listener(receive_cancelled)]; those see event.cancelled and may set it back to
false.
fn render_level_stage(
&self,
host: &dyn ClientHost,
event: &mut RenderLevelStageEvent<'_>,
)
fn render_level_stage( &self, host: &dyn ClientHost, event: &mut RenderLevelStageEvent<'_>, )
Draw world geometry at one stage of a world view (NeoForge 26.3’s
RenderLevelStageEvent), asked for each RenderLevelStage in frame order. draw is
the view’s WorldDrawContext and shares its limits with submit_custom_geometry; its
lines and quads draw at stage. Client-only, noncancellable.
Side: client.
fn render_name_tag(
&self,
host: &dyn ClientHost,
event: &mut RenderNameTagEvent<'_>,
)
fn render_name_tag( &self, host: &dyn ClientHost, event: &mut RenderNameTagEvent<'_>, )
Name tag visibility and optional replacement text. Side: client.
fn render_tooltip_gather_components(
&self,
host: &dyn ClientHost,
event: &mut RenderTooltipGatherComponentsEvent<'_>,
) -> Flow
fn render_tooltip_gather_components( &self, host: &dyn ClientHost, event: &mut RenderTooltipGatherComponentsEvent<'_>, ) -> Flow
RenderTooltipEvent.GatherComponents: the elements of stack’s
tooltip (ItemStack.getTooltipLines as text lines, then the image
component its item’s tooltip_component part answered), once
item_tooltip has run and before any wrapping or measuring. Add,
change, reorder or remove elements; the lines draw in order, then the
images in order, under any bundle’s contents. max_width starts at -1,
no limit, which leaves the lines as they are; a mod that sets it
wraps every line wider than that, in GUI pixels. Set cancel and
nothing is drawn, and no render_tooltip_texture is asked. Asked each frame
the tooltip shows, never for one the stack hides. Client-side.
Side: client.
Return Flow::Cancel to take it: this sets cancel, and later mods are skipped unless they
listen with #[listener(receive_cancelled)]; those see event.cancelled and may set it back to
false.
fn render_tooltip_pre(
&self,
host: &dyn ClientHost,
event: &mut RenderTooltipPreEvent<'_>,
) -> Flow
fn render_tooltip_pre( &self, host: &dyn ClientHost, event: &mut RenderTooltipPreEvent<'_>, ) -> Flow
RenderTooltipEvent.Pre: a tooltip, laid out and about to be placed and drawn. place
holds the point it hangs from in GUI pixels (the cursor, or the point the screen gives
it), before the tooltip positioner adds its offset and keeps the box on screen; set x
and y to move it. screen_width and screen_height are the screen’s size. elements are its text lines, then its images, as render_tooltip_gather_components
left them (a tooltip with no item has only lines), and are read-only here. stack is the
item the tooltip describes, None for a text tooltip. Set cancel and nothing is drawn,
and no render_tooltip_texture is asked. Asked each frame a tooltip shows, only while a mod listens.
draw is the tooltip’s GUI drawing context. Custom drawing stays visible even when
the tooltip is cancelled; draw.gui_draw_item_with draws a stack with optional count text.
Client-side.
Side: client.
Return Flow::Cancel to take it: this sets cancel, and later mods are skipped unless they
listen with #[listener(receive_cancelled)]; those see event.cancelled and may set it back to
false.
fn render_tooltip_texture(
&self,
host: &dyn ClientHost,
event: &mut RenderTooltipTextureEvent<'_>,
)
fn render_tooltip_texture( &self, host: &dyn ClientHost, event: &mut RenderTooltipTextureEvent<'_>, )
RenderTooltipEvent.Texture: the look of a tooltip box about to be drawn. Set texture
to a tooltip style (<namespace>:<name>) and the box draws as vanilla draws a
tooltip_style: the GUI sprites <namespace>:tooltip/<name>_background and
<namespace>:tooltip/<name>_frame from the resource packs, each nine-sliced as its
gui.scaling says or stretched without one. A style whose background or frame no pack
has keeps the fills, where vanilla draws the missing texture. Left None, the box is
Horizon’s solid fills, in background and the border_top to border_bottom gradient,
as ARGB. stack is the item the tooltip describes, None for a text tooltip. Asked each
frame a tooltip shows, only while a mod listens. Client-side.
Side: client.
fn right_click_empty(
&self,
host: &mut dyn ClientHost,
event: &mut RightClickEmptyEvent,
)
fn right_click_empty( &self, host: &mut dyn ClientHost, event: &mut RightClickEmptyEvent, )
The local player right-clicks empty space with an empty hand.
Client-side only; the server does not receive this event.
Side: client.
fn right_click_item(
&self,
host: HostSide<'_>,
event: &mut RightClickItemEvent<'_>,
) -> Flow
fn right_click_item( &self, host: HostSide<'_>, event: &mut RightClickItemEvent<'_>, ) -> Flow
PlayerInteractEvent.RightClickItem, immediately before Item.use.
Cancel skips its Part and vanilla behaviour; its result defaults to
Pass. On the client only Success ends the hand loop.
Side: both.
Return Flow::Cancel to take it: this sets canceled, and later mods are skipped unless they
listen with #[listener(receive_cancelled)]; those see event.cancelled and may set it back to
false.
fn scheduled_task(
&self,
host: &mut dyn ServerHost,
event: &mut ScheduledTaskEvent<'_>,
)
fn scheduled_task( &self, host: &mut dyn ServerHost, event: &mut ScheduledTaskEvent<'_>, )
A task a mod scheduled with schedule_task is due, at the start of the server tick it
was due on, after server_tick’s start phase, in the order the tasks were scheduled.
id is the id schedule_task returned, owner the [mod] id of the mod that scheduled
it and token the value it passed. Every mod is asked about every task, so a mod ignores
tasks it does not own. Server-side.
Side: server.
fn screen_closing(
&self,
host: &dyn ClientHost,
event: &mut ScreenClosingEvent<'_>,
)
fn screen_closing( &self, host: &dyn ClientHost, event: &mut ScreenClosingEvent<'_>, )
The screen that was open is being replaced (ScreenEvent.Closing), after native_screen_opening let it.
Side: client.
fn screen_exclusion_areas(
&self,
host: &dyn ClientHost,
event: &mut ScreenExclusionAreasEvent<'_>,
)
fn screen_exclusion_areas( &self, host: &dyn ClientHost, event: &mut ScreenExclusionAreasEvent<'_>, )
The hook native_screen_exclusion asks: a mod adds the rectangles it
draws over screen (a side panel, a button column) to areas, in GUI
pixels, [x, y, width, height]. NeoForge has no counterpart in the
game; recipe viewers ask for it through their own API
(EmiExclusionArea, JEI’s IGuiContainerHandler.getGuiExtraAreas).
Client-side.
Side: client.
Every mod gets event.areas in order and may add, change or remove areas.
fn screen_init_post(
&self,
host: &dyn ClientHost,
event: &mut ScreenInitPostEvent<'_>,
)
fn screen_init_post( &self, host: &dyn ClientHost, event: &mut ScreenInitPostEvent<'_>, )
A screen was observed opening or changing rectangle, at most once per frame
(ScreenEvent.Init.Post).
Side: client.
A mouse button went down over the open screen and the screen has handled it (ScreenEvent.MouseButtonPressed.Post, vanilla’s Screen.mouseClicked returning): screen, button and modifiers as in native_screen_mouse_button_pressed_pre. Not cancellable. NeoForge’s event also carries wasClickHandled / wasReleaseHandled; this one has no such field, because Horizon’s screens take their input in their own arms and report nothing back. There is no double-click flag: Horizon does not track double clicks. Fires on the window only, while a screen of the game’s or the title’s is open (the screens the _pre input hooks cover), for real mouse or keyboard input and not a pad’s or the keyboard focus’s, and only when the matching Pre did not cancel it. It fires on the screen open after the screen’s arms ran, so a press that closed the screen fires nothing.
Side: client.
A mouse button went up over the open screen and the screen has handled it (ScreenEvent.MouseButtonReleased.Post, vanilla’s Screen.mouseReleased returning), with the fields of native_screen_mouse_button_released_pre. Not cancellable. NeoForge’s event also carries wasClickHandled / wasReleaseHandled; this one has no such field, because Horizon’s screens take their input in their own arms and report nothing back. Fires on the window only, while a screen of the game’s or the title’s is open (the screens the _pre input hooks cover), for real mouse or keyboard input and not a pad’s or the keyboard focus’s, and only when the matching Pre did not cancel it. It fires on the screen open after the screen’s arms ran, so a release that closed the screen fires nothing.
Side: client.
fn screen_mouse_dragged_post(
&self,
host: &dyn ClientHost,
event: &mut ScreenMouseDraggedPostEvent<'_>,
)
fn screen_mouse_dragged_post( &self, host: &dyn ClientHost, event: &mut ScreenMouseDraggedPostEvent<'_>, )
A held-button pointer movement has gone through the open screen’s drag handlers (ScreenEvent.MouseDragged.Post, vanilla’s Screen.mouseDragged): button, delta (GUI pixels, screen.mouse the new position) and modifiers as in native_screen_mouse_dragged_pre. Not cancellable. Horizon’s drag handlers report nothing back, so it fires whether or not one of them used the drag. Fires on the window only, while a screen of the game’s or the title’s is open (the screens the _pre input hooks cover), for real mouse or keyboard input and not a pad’s or the keyboard focus’s, and only when the matching Pre did not cancel it. It fires on the screen open after the game handled the input, so an input that closed the screen fires nothing.
Side: client.
fn screen_mouse_scrolled_post(
&self,
host: &dyn ClientHost,
event: &mut ScreenMouseScrolledPostEvent<'_>,
)
fn screen_mouse_scrolled_post( &self, host: &dyn ClientHost, event: &mut ScreenMouseScrolledPostEvent<'_>, )
The wheel turned over the open screen and the screen’s scroll handlers have run (ScreenEvent.MouseScrolled.Post, vanilla’s Screen.mouseScrolled): scroll and modifiers as in native_screen_mouse_scrolled_pre. Not cancellable. Horizon’s scroll handlers report nothing back, so it fires whether or not one of them scrolled. Fires on the window only, while a screen of the game’s or the title’s is open (the screens the _pre input hooks cover), for real mouse or keyboard input and not a pad’s or the keyboard focus’s, and only when the matching Pre did not cancel it. It fires on the screen open after the game handled the input, so an input that closed the screen fires nothing.
Side: client.
fn screen_key_pressed_post(
&self,
host: &dyn ClientHost,
event: &mut ScreenKeyPressedPostEvent<'_>,
) -> Flow
fn screen_key_pressed_post( &self, host: &dyn ClientHost, event: &mut ScreenKeyPressedPostEvent<'_>, ) -> Flow
A key press that no screen took (ScreenEvent.KeyPressed.Post, vanilla’s Screen.keyPressed returning false): key, repeat and modifiers as in native_screen_key_pressed_pre. Set canceled and the press counts as handled: the game’s own key handling (its key bindings, hotbar and toggles) never sees it. It does not fire for a key a screen took (a text box, the focus keys, Escape-close, an inventory key, a merchant or recipe-book key). A key that has no vanilla name fires nothing. The control socket’s key fires it too, for a press (never a release). Fires on the window only, while a screen of the game’s or the title’s is open (the screens the _pre input hooks cover), for real mouse or keyboard input and not a pad’s or the keyboard focus’s, and only when the matching Pre did not cancel it. It fires on the screen open after the game handled the input, so an input that closed the screen fires nothing.
Side: client.
Return Flow::Cancel to take it: this sets canceled, and later mods are skipped unless they
listen with #[listener(receive_cancelled)]; those see event.cancelled and may set it back to
false.
fn screen_key_released_post(
&self,
host: &dyn ClientHost,
event: &mut ScreenKeyReleasedPostEvent<'_>,
) -> Flow
fn screen_key_released_post( &self, host: &dyn ClientHost, event: &mut ScreenKeyReleasedPostEvent<'_>, ) -> Flow
A key release that no screen took (ScreenEvent.KeyReleased.Post, vanilla’s Screen.keyReleased returning false): key and modifiers as in native_screen_key_released_pre. Set canceled and the release counts as handled: the game’s own key handling never sees it, so a held mapping stays down; cancel a release only when you cancelled the press it ends. Fires on the window only, while a screen of the game’s or the title’s is open (the screens the _pre input hooks cover), for real mouse or keyboard input and not a pad’s or the keyboard focus’s, and only when the matching Pre did not cancel it. It fires on the screen open after the game handled the input, so an input that closed the screen fires nothing.
Side: client.
Return Flow::Cancel to take it: this sets canceled, and later mods are skipped unless they
listen with #[listener(receive_cancelled)]; those see event.cancelled and may set it back to
false.
fn screen_char_typed_post(
&self,
host: &dyn ClientHost,
event: &mut ScreenCharTypedPostEvent<'_>,
) -> Flow
fn screen_char_typed_post( &self, host: &dyn ClientHost, event: &mut ScreenCharTypedPostEvent<'_>, ) -> Flow
A typed character that no text box took (ScreenEvent.CharacterTyped.Post, vanilla’s Screen.charTyped returning false), once per printable character that native_screen_char_typed_pre let through: c and modifiers as there. Set canceled and it counts as handled (nothing further reads it, so it changes nothing today). It does not fire for text a box took, nor on Options and the title’s own screens, where the key’s text is routed in place between their boxes. A held edit modifier makes the key a shortcut, so its character is not taken and fires it. Same screens as the key press. Fires on the window only, while a screen of the game’s or the title’s is open (the screens the _pre input hooks cover), for real mouse or keyboard input and not a pad’s or the keyboard focus’s, and only when the matching Pre did not cancel it. It fires on the screen open after the key acted, as for the Pre.
Side: client.
Return Flow::Cancel to take it: this sets canceled, and later mods are skipped unless they
listen with #[listener(receive_cancelled)]; those see event.cancelled and may set it back to
false.
fn screen_opening(
&self,
host: &dyn ClientHost,
event: &mut ScreenOpeningEvent<'_>,
) -> Option<ScreenOpening>
fn screen_opening( &self, host: &dyn ClientHost, event: &mut ScreenOpeningEvent<'_>, ) -> Option<ScreenOpening>
Gui.setScreen is about to replace the current screen with new
(ScreenEvent.Opening; the screen playing is none: vanilla’s null).
Answer ScreenOpening::Cancel to keep the current one, or
ScreenOpening::ModScreen to open a mod’s own screen instead.
Side: client.
Return Some to set outcome; the first mod returning Some wins.
fn screen_preedit_pre(
&self,
host: &dyn ClientHost,
event: &mut ScreenPreeditPreEvent<'_>,
) -> Flow
fn screen_preedit_pre( &self, host: &dyn ClientHost, event: &mut ScreenPreeditPreEvent<'_>, ) -> Flow
Before a screen’s preedit handler (ScreenEvent.Preedit.Pre, vanilla’s
GuiEventListener.preeditUpdated): the input method is composing
full_text (empty when the composition ended), with the caret at
byte caret_position, split into blocks of which focused_block is
the one being converted. Set canceled and no text field sees it, and
native_screen_preedit_post does not fire. Fires on the window while a
screen is open, even when no text field is focused.
Side: client.
Return Flow::Cancel to take it: this sets canceled, and later mods are skipped unless they
listen with #[listener(receive_cancelled)]; those see event.cancelled and may set it back to
false.
fn screen_preedit_post(
&self,
host: &dyn ClientHost,
event: &mut ScreenPreeditPostEvent<'_>,
)
fn screen_preedit_post( &self, host: &dyn ClientHost, event: &mut ScreenPreeditPostEvent<'_>, )
After a screen’s preedit handler (ScreenEvent.Preedit.Post) and only
when no text field took the composition (the handler returned false:
vanilla’s focused field takes it, so this is a preedit no field
wanted) and native_screen_preedit_pre did not cancel. Same arguments.
Side: client.
fn screen_render_inventory_mob_effects(
&self,
host: &dyn ClientHost,
event: &mut ScreenRenderInventoryMobEffectsEvent<'_>,
) -> Flow
fn screen_render_inventory_mob_effects( &self, host: &dyn ClientHost, event: &mut ScreenRenderInventoryMobEffectsEvent<'_>, ) -> Flow
Ahead of the effect panels beside the survival and creative
inventories (ScreenEvent.RenderInventoryMobEffects, vanilla’s
EffectsInInventory.extractRenderState): available_space is the
width in GUI pixels right of the container, at least 32 (with no effect
to show, or less room, vanilla draws nothing and this does not fire).
compact picks icons over full panels (vanilla’s choice is compact
under 120) and horizontal_offset shifts the stack right (negative
left). Set canceled and the panels are not drawn: draw your own with
native_screen_render_post. Once a frame while the screen draws them,
on the window only; if the effects space changes within a frame (the
recipe book opening between two layout builds), it is asked again for
the new space. The exclusion areas follow this choice in the same frame.
Side: client.
Return Flow::Cancel to take it: this sets canceled, and later mods are skipped unless they
listen with #[listener(receive_cancelled)]; those see event.cancelled and may set it back to
false.
fn screen_render_pre(
&self,
host: &dyn ClientHost,
event: &mut ScreenRenderPreEvent<'_>,
) -> Flow
fn screen_render_pre( &self, host: &dyn ClientHost, event: &mut ScreenRenderPreEvent<'_>, ) -> Flow
Before the open screen draws itself (ScreenEvent.Render.Pre, vanilla’s Screen.renderWithTooltips): draw to put something under it, or set canceled and the screen is not drawn, and neither is its native_screen_render_background or native_screen_render_foreground. The world, the HUD layers and the toasts still draw, and native_screen_render_post still fires. Fires once a frame on the window, for the screens native_screen_render_post covers: a screen of the game’s, the title’s own screens, Win and Options. Not while playing with no screen, nor for a server dialog, the server pack, link and code-of-conduct prompts, a book or a sign editor drawn over gameplay. Draw with native_fill, native_sprite and native_text; screen.rect is the screen’s container panel (or the whole window).
Side: client.
Return Flow::Cancel to take it: this sets canceled, and later mods are skipped unless they
listen with #[listener(receive_cancelled)]; those see event.cancelled and may set it back to
false.
fn screen_render_background(
&self,
host: &dyn ClientHost,
event: &mut ScreenRenderBackgroundEvent<'_>,
)
fn screen_render_background( &self, host: &dyn ClientHost, event: &mut ScreenRenderBackgroundEvent<'_>, )
The open screen is about to draw its contents (ScreenEvent.Render.Background, after vanilla’s renderBackground and before render): draw here for what must sit under the screen’s widgets, items and tooltips. Not cancellable. Horizon’s screens draw their own background panel inside their drawing, so this fires before all of it; the panel is over what a mod draws here. It does not fire when native_screen_render_pre cancelled. Fires once a frame on the window, for the screens native_screen_render_post covers: a screen of the game’s, the title’s own screens, Win and Options. Not while playing with no screen, nor for a server dialog, the server pack, link and code-of-conduct prompts, a book or a sign editor drawn over gameplay. Draw with native_fill, native_sprite and native_text; screen.rect is the screen’s container panel (or the whole window).
Side: client.
fn screen_render_foreground(
&self,
host: &dyn ClientHost,
event: &mut ScreenRenderForegroundEvent<'_>,
)
fn screen_render_foreground( &self, host: &dyn ClientHost, event: &mut ScreenRenderForegroundEvent<'_>, )
The open screen has drawn its contents (ScreenEvent.Render.Foreground, vanilla’s point before the deferred tooltips and the preedit overlay). Not cancellable. Horizon’s screens draw their tooltips and the dragged stack inside their drawing and expose no boundary before them, so unlike vanilla this fires after them, immediately before native_screen_render_post; use native_screen_render_post or this hook for what goes over the screen. It does not fire when native_screen_render_pre cancelled. Fires once a frame on the window, for the screens native_screen_render_post covers: a screen of the game’s, the title’s own screens, Win and Options. Not while playing with no screen, nor for a server dialog, the server pack, link and code-of-conduct prompts, a book or a sign editor drawn over gameplay. Draw with native_fill, native_sprite and native_text; screen.rect is the screen’s container panel (or the whole window).
Side: client.
fn screen_transparent_background(
&self,
host: &dyn ClientHost,
event: &mut ScreenTransparentBackgroundEvent<'_>,
) -> Flow
fn screen_transparent_background( &self, host: &dyn ClientHost, event: &mut ScreenTransparentBackgroundEvent<'_>, ) -> Flow
Screen.renderTransparentBackground: draws the translucent dark background
behind an in-game screen (inventory, container, creative, book, sign, editor).
Set canceled (or return Flow::Cancel) to suppress the vanilla dark gradient,
allowing a mod to draw its own background or apply menu background blur
via Host::apply_screen_blur. API @API:screen_transparent_background@.
Side: client.
Return Flow::Cancel to take it: this sets canceled, and later mods are skipped unless they
listen with #[listener(receive_cancelled)]; those see event.cancelled and may set it back to
false.
fn screenshot(
&self,
host: &mut dyn ClientHost,
event: &mut ScreenshotEvent<'_>,
) -> Flow
fn screenshot( &self, host: &mut dyn ClientHost, event: &mut ScreenshotEvent<'_>, ) -> Flow
An F2 screenshot has been read back, before either PNG is written
(ScreenshotEvent). Runs on the client thread with a ClientHost.
image is the in-memory frame (getImage): RGBA8, top to bottom,
width * height * 4 bytes. Change it and the normal PNG is that image.
A length other than width * height * 4 writes nothing and reports
screenshot failure. The HDR copy is not this image. Change file_name,
a relative path inside the player’s screenshots folder, or set message
to replace the success chat line. None uses the normal translated,
clickable line for the final file name. Return Flow::Cancel to write
no files and post message, or the translated cancellation line when
message is None. Invalid paths (including symlinks) report screenshot
failure; parent folders are created. HDR copies follow the final name
with -hdr.png. Agent captures and world icons do not fire this hook.
Side: client.
Return Flow::Cancel to take it: this sets cancel, and later mods are skipped unless they
listen with #[listener(receive_cancelled)]; those see event.cancelled and may set it back to
false.
fn server_chat(
&self,
host: &mut dyn ServerHost,
event: &mut ServerChatEvent<'_>,
) -> Flow
fn server_chat( &self, host: &mut dyn ServerHost, event: &mut ServerChatEvent<'_>, ) -> Flow
NeoForge’s ServerChatEvent: a player’s chat message, through their
chain and the chat filter, is about to be broadcast.
player_id is the server’s entity id for the player, player their
UUID, username their name and raw_text what they typed. message
starts as that text; replace it and players see the new message
(withUnsignedContent: a signed message keeps its signature), and
the log shows it. Set cancel and nobody sees it, and it doesn’t
count toward the chat spam limit. Commands (/say, /msg…) are
not chat here. Server-side, with no player’s state swapped in.
A component deeper than 512 nodes refuses capture or the whole writeback;
no event field is applied if any Text field fails conversion.
Side: server.
Return Flow::Cancel to take it: this sets cancel, and later mods are skipped unless they
listen with #[listener(receive_cancelled)]; those see event.cancelled and may set it back to
false.
fn server_tick_rate_changed(
&self,
host: &mut dyn ServerHost,
event: &mut ServerTickRateChangedEvent,
)
fn server_tick_rate_changed( &self, host: &mut dyn ServerHost, event: &mut ServerTickRateChangedEvent, )
/tick rate set the server’s rate, or a /tick sprint ended
(MinecraftServer.onTickRateChanged, before its autosave wait is adjusted). Vanilla calls
this for every /tick rate, the rate it already had included, and at each end of a sprint:
on its own, by /tick sprint stop or by /tick freeze, the rate then being what it was.
host.tick_stats() reads the rate. A client told the server’s rate is not a server:
nothing fires there. Server-side. Beyond NeoForge: there is no counterpart.
Side: server.
fn play_sound(&self, context: &dyn LoopContext, event: &mut PlaySoundEvent<'_>)
fn play_sound(&self, context: &dyn LoopContext, event: &mut PlaySoundEvent<'_>)
starting is true for starts and loop replays, false for a live channel refresh.
A live refresh applies only volume and pitch transiently; None stops the channel.
Invalid edited numeric values refuse that refresh.
A sound is about to play (PlaySoundEvent, vanilla’s SoundEngine.play): original is the sound as asked for, sound starts as a copy of it. Edit sound (its volume, pitch, source, position, identifier, looping, delay, attenuation or relativeness) to change what plays, or set it to None to play nothing. It is asked before the engine’s own checks (output open, sound resolved, volume, channel pool), for every sound the client plays, so answer fast; later mods see earlier mods’ edits in sound and the sound as asked for in original. A new identifier is resolved again, with its own weighted pick. context is the client’s LoopContext: no game is at hand inside the sound engine. Client-side only; a server has no sound.
instance is an engine-local sound instance id, unchanged across its live updates.
Side: client.
fn play_sound_source(
&self,
context: &dyn LoopContext,
event: &mut PlaySoundSourceEvent<'_>,
)
fn play_sound_source( &self, context: &dyn LoopContext, event: &mut PlaySoundSourceEvent<'_>, )
A sound that is not streamed has started on channel (PlaySoundSourceEvent), after the engine set its pitch, volume, attenuation, looping and position: sound is what is playing, after play_sound’s edits. A notice: the channel is an id only and gives no control. Streamed sounds (music, records) fire play_streaming_source instead. Client-side only.
Side: client.
fn play_streaming_source(
&self,
context: &dyn LoopContext,
event: &mut PlayStreamingSourceEvent<'_>,
)
fn play_streaming_source( &self, context: &dyn LoopContext, event: &mut PlayStreamingSourceEvent<'_>, )
A streamed sound (music, a record) has started on channel (PlayStreamingSourceEvent): sound is what is playing, after play_sound’s edits. A notice: the channel is an id only and gives no control. Other sounds fire play_sound_source instead. Client-side only.
Side: client.
fn sound_engine_load(
&self,
context: &dyn LoopContext,
event: &mut SoundEngineLoadEvent,
)
fn sound_engine_load( &self, context: &dyn LoopContext, event: &mut SoundEngineLoadEvent, )
The sound engine opened its output (SoundEngineLoadEvent): once at window start, after each resource reload (with the context of the new resource generation) and when the output device changes. Nothing fires with no sound output (no device, or audio turned off). Client-side only.
Side: client.
fn spread_players_teleport(
&self,
host: &mut dyn ServerHost,
event: &mut SpreadPlayersTeleportEvent<'_>,
) -> Flow
fn spread_players_teleport( &self, host: &mut dyn ServerHost, event: &mut SpreadPlayersTeleportEvent<'_>, ) -> Flow
A server entity is about to be placed by /spreadplayers (NeoForge’s
EntityTeleportEvent.SpreadPlayersCommand, vanilla’s
SpreadPlayersCommand.setPlayerPositions): once per entity, after the
spread worked out its spot. entity is its network id, player its UUID (None for a
non-player), from where
it stands and target the spot. A mod may move target (a value that
is not a number is ignored). Canceling leaves the entity where it is;
the spread’s other entities, its random draws and its feedback are
unchanged.
Side: server.
Return Flow::Cancel to take it: this sets cancel, and later mods are skipped unless they
listen with #[listener(receive_cancelled)]; those see event.cancelled and may set it back to
false.
fn sprite_source(
&self,
context: &RegistrationContext,
event: &mut SpriteSourceEvent<'_>,
)
fn sprite_source( &self, context: &RegistrationContext, event: &mut SpriteSourceEvent<'_>, )
An entry of an atlas definition whose type a mod registered (register_sprite_sources,
vanilla’s SpriteSource.run), asked at the entry’s place in the definition’s sources,
each time the atlas is loaded or reloaded, on the resource loader. config is the entry’s
JSON object converted to a Tag, atlas the atlas being listed and listed the sprites
the entries before it listed. Push SpriteSourceOutputs to output only for a source your
mod owns; they apply in order once every mod has answered.
Side: client.
Every mod gets event.output in order and may add, change or remove output.
fn submit_custom_geometry(
&self,
host: &dyn ClientHost,
event: &mut SubmitCustomGeometryEvent<'_>,
)
fn submit_custom_geometry( &self, host: &dyn ClientHost, event: &mut SubmitCustomGeometryEvent<'_>, )
Submit unlit geometry after particle submission, before opaque rendering
(NeoForge 26.3 SubmitCustomGeometryEvent, vanilla LevelRenderer.submitFeatures).
Client-only, noncancellable. view holds only camera, partial tick and game time,
not full extracted level state or visible sections. Submit from extracted state.
Side: client.
fn sweep_attack(
&self,
host: HostSide<'_>,
event: &mut SweepAttackEvent<'_>,
) -> Flow
fn sweep_attack( &self, host: HostSide<'_>, event: &mut SweepAttackEvent<'_>, ) -> Flow
NeoForge’s SweepAttackEvent: a player’s damaging melee hit on a
target (minecraft:zombie, minecraft:oak_boat) is about to sweep or
not, after native_critical_hit. vanilla_sweep is Player.isSweepAttack
(a charged, grounded, not critical sword hit below the speed limit);
sweeping starts as it and may force or stop the sweep; canceled skips
the later mods and keeps sweeping as it is (a mod doing its own sweep
cancels with sweeping false). A critical hit that sweeps has both
sounds. Fires on the Game that runs the attack, and on the attacking
client, which only asks.
Side: both.
Return Flow::Cancel to take it: this sets canceled, and later mods are skipped unless they
listen with #[listener(receive_cancelled)]; those see event.cancelled and may set it back to
false.
Tags changed, and what depends on them should be rebuilt (NeoForge’s
TagsUpdatedEvent); cause says how. The place to drop caches
derived from the data and to rebind what depends on it.
ServerDataLoad: the server’s data tables are built. The recipes,
tags, loot and advancements of the world’s data packs, and the files
mods added through native_data_pack_files, are what the helpers read
from now on. reload is false on a world’s first open, before its
chunks and players are loaded, and true after /reload rebuilt them,
once the players were sent the new data. Fires on the server, the
single player’s integrated server included.
ClientPacketReceived: a client applied the block, item and fluid
tags its server sent, and block_in_tag, fluid_in_tag and the
tags() service read them from now on. Fires once at login, for
configuration’s tags, and once for each update in play, on the game
thread. integrated_server is true in single player, where both
causes fire: cause.should_update_static_data() is then false here,
so that data the two threads share is updated once, on the server.
Runs in Reloading: published asset/data queries can rebind caches, including on first open; world handles and transactions remain unavailable. Side: both.
fn teleport_command(
&self,
host: &mut dyn ServerHost,
event: &mut TeleportCommandEvent<'_>,
) -> Flow
fn teleport_command( &self, host: &mut dyn ServerHost, event: &mut TeleportCommandEvent<'_>, ) -> Flow
A server entity is about to be teleported by /tp or /teleport (NeoForge’s
EntityTeleportEvent.TeleportCommand, in TeleportCommand.performTeleport, once per
teleported entity): dimension is the level it arrives in, entity its network id,
from its feet now and to where the command sends it. A mod may move to (a value
that is not a number is ignored). Canceling leaves the entity where it is; the command
still reports success. entity_teleport and player_teleported hear it after.
Server-side. Diverges from upstream: new hook.
Side: server.
Return Flow::Cancel to take it: this sets cancel, and later mods are skipped unless they
listen with #[listener(receive_cancelled)]; those see event.cancelled and may set it back to
false.
fn texture_atlas_stitched(
&self,
host: &mut dyn ClientHost,
event: &mut TextureAtlasStitchedEvent,
)
fn texture_atlas_stitched( &self, host: &mut dyn ClientHost, event: &mut TextureAtlasStitchedEvent, )
An atlas was stitched and published (TextureAtlasStitchedEvent): atlas names it. Fires
once per atlas, the blocks’ first and then the GUI’s, on the first load before
client_setup and after every successful resource reload (F3+T, a pack turned on or off, a
server’s pack) before client_resources_reloaded; a reload that fails fires nothing. Look
the sprites a mod draws up here, once, and keep what it finds until the next stitch of that
atlas: texture_sprites for TextureAtlas::Blocks, gui_sprite for
TextureAtlas::Gui. Never look them up by name every frame. Client-side.
Side: client.
fn tick_target_millis(
&self,
host: &dyn ClientHost,
event: &mut TickTargetMillisEvent,
)
fn tick_target_millis( &self, host: &dyn ClientHost, event: &mut TickTargetMillisEvent, )
How many milliseconds a client tick lasts (Minecraft.getTickTargetMillis, the target the
window’s DeltaTracker.Timer divides the frame’s time by): millis comes in as vanilla’s
(50 at 20 ticks a second, longer when the server’s /tick rate is slower); set it to speed
up or slow down the client’s fixed-step clock, a “timer”. Asked once a frame, in menus too,
before the frame’s client ticks run (at most ten a frame). An answer that is not a finite
number above zero keeps vanilla’s. Only the window’s clock changes: a server still ticks
at its own rate. Client-side. Beyond NeoForge: there is no counterpart. Diverges from
upstream: new hook.
Side: client.
fn toast_add(
&self,
host: &dyn ClientHost,
event: &mut ToastAddEvent<'_>,
) -> Flow
fn toast_add( &self, host: &dyn ClientHost, event: &mut ToastAddEvent<'_>, ) -> Flow
A client toast is about to enter its queue (ToastAddEvent). Return
Flow::Cancel to discard only this candidate, before slot allocation,
animation or sound. kind identifies its family; music is Other.
Replace title and description to change the displayed components.
For advancements the title is the frame label and the description is
the advancement name. Existing recipe/system toasts updated in place
do not fire another add event. Client-lib and title producers prepare
candidates for the game to admit with a ClientHost before applying.
Side: client.
Return Flow::Cancel to take it: this sets cancel, and later mods are skipped unless they
listen with #[listener(receive_cancelled)]; those see event.cancelled and may set it back to
false.
fn use_item_on_block(
&self,
host: HostSide<'_>,
event: &mut UseItemOnBlockEvent<'_>,
) -> Flow
fn use_item_on_block( &self, host: HostSide<'_>, event: &mut UseItemOnBlockEvent<'_>, ) -> Flow
UseItemOnBlockEvent: after a phase was chosen, before its Part or
vanilla behaviour. Cancel skips that behaviour and returns
cancellation_result (initially TryWithEmptyHand).
Side: both.
Return Flow::Cancel to take it: this sets canceled, and later mods are skipped unless they
listen with #[listener(receive_cancelled)]; those see event.cancelled and may set it back to
false.
fn validate_tickets(
&self,
host: &mut dyn ServerHost,
event: &mut ValidateTicketsEvent<'_>,
)
fn validate_tickets( &self, host: &mut dyn ServerHost, event: &mut ValidateTicketsEvent<'_>, )
dimension’s level has loaded the saved chunk tickets of controller
(NeoForge’s LoadingValidationCallback.validateTickets), before its
first tick and after native_level_load, once for each open and each
controller registered with a validator that has tickets in the level.
validation holds that controller’s tickets, block owners and entity
owners apart; the mod that owns the controller removes the ones that no
longer hold (a machine that is gone), and they stop forcing their
chunks. Server-side.
Side: server.
fn vanilla_game_event(
&self,
host: &mut dyn ServerHost,
event_: &mut VanillaGameEventEvent<'_>,
) -> Flow
fn vanilla_game_event( &self, host: &mut dyn ServerHost, event_: &mut VanillaGameEventEvent<'_>, ) -> Flow
A vanilla game event is about to reach its listeners (NeoForge’s
VanillaGameEvent, vanilla’s Level.gameEvent): every event, in
dimension. event is its id (minecraft:step), pos where it
happened and cause the network id of the entity that caused it
(None for none). affected_state is the block state the event touched
(GameEvent.Context.affectedState, with cause its sourceEntity): the
block a player broke or placed, the block a mob stepped on; None where
vanilla passes none (Context.of(entity)).
Canceling keeps the sculk sensors, wardens and allays from hearing it.
Server-side.
Side: server.
Return Flow::Cancel to take it: this sets cancel, and later mods are skipped unless they
listen with #[listener(receive_cancelled)]; those see event_.cancelled and may set it back to
false.
fn wind_burst(&self, host: &mut dyn ServerHost, event: &mut WindBurstEvent<'_>)
fn wind_burst(&self, host: &mut dyn ServerHost, event: &mut WindBurstEvent<'_>)
Before a wind burst interacts with blocks, native_wind_burst(dimension, center, blocks) receives the shuffled candidate positions. Remove positions to spare those blocks; entity knockback and the shuffle’s random draws are unchanged. Not called when mob_griefing prevents a breeze from interacting with blocks. Bundles need “hooks”: @API:wind_burst@.
Side: server.
Every mod gets event.blocks in order and may add, change or remove blocks.
fn window_resize(
&self,
host: &mut dyn ClientHost,
event: &mut WindowResizeEvent,
)
fn window_resize( &self, host: &mut dyn ClientHost, event: &mut WindowResizeEvent, )
After a window resize or applying a changed GUI scale, fullscreen, or Unicode font setting.
width and height are physical pixels; gui_width and gui_height are scaled GUI pixels.
Fires only when physical or scaled dimensions change.
Side: client.
fn xp_orb_targeting(
&self,
host: &mut dyn ServerHost,
event: &mut XpOrbTargetingEvent<'_>,
)
fn xp_orb_targeting( &self, host: &mut dyn ServerHost, event: &mut XpOrbTargetingEvent<'_>, )
An experience orb looks for a player to follow (NeoForge’s
XpOrbTargetingEvent, ExperienceOrb.followNearbyPlayer), on a
server. following starts as the default: the nearest living player
within scan_distance (8) blocks who isn’t a spectator, or None.
Set another player, or None to follow no one. The orb only goes
for a living player who isn’t a spectator, in its level, and only
moves once they are within 8 blocks. Horizon looks again on every
orb tick (vanilla keeps the player it follows while they stay
within 8 blocks), so this is asked every tick for each orb: answer
fast.
Side: server.
Trait Implementations§
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".