Mod API reference
This page is a generated index of the catalog-backed trait hooks (crates/sunrise-mod-vocab/src/hooks/) and area-declared host methods (crates/sunrise-mod-vocab/src/host/). For complete trait definitions (including non-catalog methods), handles, and cross-linked rustdoc, build the crate docs locally with cargo doc -p sunrise-mod-api --no-deps --open.
From Sunrise's modding book716c272
Hooks (Hooks trait)
add_attribute_ tooltips - Side
- client
- Contract
- listen
- Host / context
&dyn ClientHost- NeoForge
AddAttributeTooltipsEvent- Summary
AddAttributeTooltipsEvent: the lines that follow a stack's attribute lines (ItemStack.addAttributeTooltips), after the modifiers the stack shows andgather_left in. Push lines toskipped_ attribute_ tooltips lines, each with a colour asrgbapacks it (u32::keeps the text's own); they land beside the attribute lines without finding where those end.MAX shownis whether the stack'sminecraft:tooltip_shows the attribute modifiers (display shouldShow); the hook is asked either way.playerandplayer_are the local player's,entity_ id Nonefor 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) andcreative(a creative tab's own slot) are the tooltip'sTooltipFlag. Asked when lines are built for display, recipe book search orItemResource::. Display and resource-query builds skip it when the stack hides its entire tooltip. Reentrant line queries do not dispatch it. Client-side, only while a mod listens. A component deeper than 512 nodes refuses capture or the whole writeback; no event field is applied if any Text field fails conversion.tooltip
add_client_ reload_ listeners - Side
- client
- Contract
- listen
- Host / context
&dyn ClientReloadListenerContext- NeoForge
AddClientReloadListenersEvent- Summary
- Register client asset reload listeners before a reload stages its assets (NeoForge's
AddClientReloadListenersEvent, the client's counterpart ofadd_): 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'sserver_ reload_ listeners preparethen reads the merged asset view with resource-pack overrides resolved, and its returned apply publishes the parsed state, all applies after all prepares, beforeclient_. Dependencies on the model manager order both its real model build and its publication. Atlas upload precedes the model manager. A listener prepare or engine preflight that refuses the candidate aborts the load before any listener applies. Client-side, taking aresources_ reloaded ClientReloadListenerContext. Later registration is on the render thread, prepare on the loader, and apply on the owning game thread. On initial startup before any resources are published,context.published()isNone; on later reloads it returnsSome(&dyn ClientReloadHost). Registration errors are returned and logged at the call, without stopping the reload. A panicking registration callback contributes no listeners or dependencies; unrelated callbacks still run.
add_pack_ finders - Side
- both
- Contract
- listen
- Host / context
&mut dyn PackDiscoveryContext- NeoForge
AddPackFindersEvent- Summary
- 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. Disabled native mods' listeners are skipped from the first startup discovery onwards. A callback that panics contributes no packs; later callbacks still run.
add_section_ geometry - Side
- client
- Contract
- listen
- Host / context
&RegistrationContext- NeoForge
AddSectionGeometryEvent- Summary
- Extra geometry in chunk section meshes (NeoForge's
AddSectionGeometryEvent):register(renderer)adds the mod's ownSectionGeometry, 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. A registration callback that panics or incurs a phase refusal contributes no renderers.
add_server_ reload_ listeners - Side
- server
- Contract
- listen
- Host / context
&dyn ReloadContext- NeoForge
AddServerReloadListenersEvent- Summary
- Register server data reload listeners after packs are selected. The
ReloadContextgives registry access at registration, asAddServerReloadListenersEvent.getRegistryAccessdoes. Runs every data load on the owning server thread; world handles, services and transactions are not present on this context. Existing data-load callbacks retain theirDataLoadContext. Each listener'spreparereturns an owned action, consumed once on the server thread after all prepares succeed. Registration errors are returned and logged at the call, without stopping the reload. A panicking registration callback contributes no ordered or retained listeners or dependencies; unrelated callbacks still run.
alter_ground - Side
- server
- Contract
- collect
- Host / context
&dyn WorldgenHost- NeoForge
AlterGroundEvent- Summary
- A tree's
alter_decorator (ground AlterGroundDecorator.place, the podzol under a big spruce) is about to turn the ground aroundpositions: the lowest of its trunk or roots (logsif it has no roots,logsandrootswhen they start level, elseroots); only those at the first one's Y are placed around.logs,leavesandrootsare the decorator context's lists, each sorted by Y. Setproviderto your ownGroundProvider::to choose a canonicalMod BlockStatefor 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 worldgencontext: noHost, no writes.
animal_tame - Side
- server
- Contract
- cancel
- Host / context
&mut dyn ServerHost- NeoForge
AnimalTameEvent- Summary
- The player
tamer(UUID) andtamer_is about to tame the mobentity_ id entityofkind(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). Setcancelfor the attempt to fail instead, as a failed roll does: smoke for a pet, and a horse bucks its rider off. Beforeentity_. Server-side.tame
anvil_craft_ post - Side
- server
- Contract
- listen
- Host / context
&mut dyn ServerHost- NeoForge
AnvilCraftEvent.Post- Summary
- A player took an anvil's result at
posand the levels, inputs and anvil wear are done (AnvilCraftEvent.Post); a broken anvil is already air.inputsborrows the same pre-take input stacks and result asanvil_. Not called whencraft_ pre anvil_cancelled.craft_ pre
anvil_craft_ pre - Side
- server
- Contract
- cancel
- Host / context
&mut dyn ServerHost- NeoForge
AnvilCraftEvent.Pre- Summary
- A player took an anvil's result at
pos(AnvilCraftEvent.Pre, matching NeoForgeAnvilMenu.onTake), before the levels are charged, the inputs used up and the anvil worn.inputsborrows the input stacks and result from before the take. Setcancelto return early before charging levels, consuming inputs, damaging the anvil or firinganvil_, without undoing the click's item move (the listener handles any post-processing itself).craft_ post
anvil_damaged - Side
- server
- Contract
- listen
- Host / context
&mut dyn ServerHost- NeoForge
- —
- Summary
- An anvil at
postook damage, changing its block fromfromtoto.tois air when the anvil broke. Server-side.
anvil_update - Side
- both
- Contract
- cancel
- Host / context
HostSide- NeoForge
AnvilUpdateEvent- Summary
- An anvil at
posmade vanilla's result with a left input, forplayer(UUID) andplayer_(entity_ id AnvilUpdateEvent, matching NeoForgeAnvilMenu.createResult/CommonHooks.onAnvilUpdate), live on everycreateResultwith no answer cache:inputslends the stacks, rename text and vanilla result;editsstarts withKeepand vanilla's costs. Set an output or edit the costs without changing the inputs. Cancellation clears the result and both costs. An invalid replacement output is logged and ignored (keeping vanilla's output while still applying the cost edits).edits.xp_stays signed during listener dispatch and clamps tocost 0when applied (AnvilMenu.setCost). Both sides, including the update after material consumption with the left slot still present. On the server that update observes the player afterAnvilMenu.onTakehas charged the levels.
arm_pose_ transform - Side
- client
- Contract
- listen
- Host / context
&dyn ClientHost- NeoForge
HumanoidModel.ArmPose- Summary
- 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.humanoidcontains the selected poses afterget_answers.arm_ pose right_identifies the physical arm, not the hand. Write absolute pitch, yaw and roll in radians intoarm 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.
armor_hurt - Side
- server
- Contract
- cancel
- Host / context
&mut dyn ServerHost- NeoForge
ArmorHurtEvent- Summary
- Armor is about to take durability damage from a hit (NeoForge's
ArmorHurtEvent, vanilla'sLivingEntity.doHurtEquipment): once per hit, for the pieces that would wear, and first for the helmet alone when a falling block hits a player (hurtHelmet).entityis the wearer's entity id,playerits UUID (None for a mob),kindits type andsourcethe hit's damage type (causinganddirectare 0: the hit does not carry them here). Each entry has itsslot, thestack, thedamagevanilla worked out and anew_a mod may change (0 for none; Unbreaking is applied after). Canceling means no armor damage. A server player'sdamage feet,legs,chestandhead; a mob'sbody(a horse's armor). Server-side.
armor_stand_ manipulate - Side
- server
- Contract
- cancel
- Host / context
&mut dyn ServerHost- NeoForge
- —
- Summary
- A player takes an item from an armor stand or puts one on it (
ArmorStand.interactAt, after the stand's disabled-slot checks andswapItem's take/put locks, before anything moves):stand_is the stand'sid Entity.getIdandslotthe one the click reached (mainhand,offhand,feet,legs,chestorhead). Setcanceland 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;playeris the UUID the helpers take. Not told of a click that changes nothing (an empty hand on an empty slot). The listener may change the world: straight after it returns without cancelling, the game finds the stand again bystand_and checks that it still exists, that the slot's stack and the held stack keep their item and count, and that the slot is not now locked; if not, the click is spent and nothing moves. 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.id
arrow_loose - Side
- server
- Contract
- cancel
- Host / context
&mut dyn ServerHost- NeoForge
ArrowLooseEvent- Summary
- NeoForge's
ArrowLooseEvent: the player releases a bowstackwithhas_andammo chargeticks held. Changechargeor setcanceledto prevent the shot; negative charge also prevents it. Unlikeliving_, this does not skip the whole item release;entity_ use_ item_ stop entity_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;shoot_ bow arrow_is the bow's start.nock
arrow_nock - Side
- server
- Contract
- cancel
- Host / context
&mut dyn ServerHost- NeoForge
ArrowNockEvent- Summary
- A player is about to nock
bowwithhand(BowItem.use, NeoForge'sArrowNockEvent):has_is whetherammo getProjectilefound ammunition or the player is in creative. Setcancelto fail the use.
attack_entity - Side
- server
- Contract
- cancel
- Host / context
&mut dyn ServerHost- NeoForge
AttackEntityEvent- Summary
- A player attacks the entity
entity(Entity.getId) of typekind(minecraft:item_,frame minecraft:cow,minecraft:player) standing atpos:ServerGamePacketListenerImpl.handleInteract's attack, once in reach, wherePlayer.attackstarts. 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 ofPlayer.attack; the swing resets it afterwards). Setcanceledand the blow does nothing (no damage, no knockback, the frame keeps its item). Server-side, for every player of the world (host.players().acting_says who).player()
baby_entity_ spawn - Side
- server
- Contract
- cancel
- Host / context
&mut dyn ServerHost- NeoForge
BabyEntitySpawnEvent- Summary
- Two animals bred and the baby they made is about to join the world (NeoForge's
BabyEntitySpawnEvent, vanilla'sAnimal.spawnChildFromBreeding):dimensionis the level they are in (a replacement baby'sPendingMobSpecnames it),parentandpartnerare entity ids,playerandplayer_the UUID and entity id of the player who fed them into love (entity_ id getCausedByPlayer, None when none). The baby (a mule for a horse and a donkey) is already constructed, with its inheritance drawn, but not finalized or in any level: it is the single entry of the engine-owned listedits.children()names, whicheditschanges. Edit the baby in place (edits.set_,position edits.set_), replace it with another baby (yaw edits.constructa babyPendingMobSpec, thenedits.replace), or remove it (edits.remove) for none. A second baby is refused withCapacity, and a replacement must be a baby. Setcancelfor no baby either: the parents still rest and lose their love (their ages were already set to 6000), but there is no baby, no experience, noanimals_statistic, no advancement and no heart particles. The construction draws stay spent. A panicking callback is reported and disabled for the session, and this breeding is cancelled. A refusal (including an explicit veto or a stale parent) rolls back journaled listener writes in the breeding level. An accepted baby is applied before deferred join callbacks run. Every handle is borrowed for one listener only. Not fired for turtles, frogs and sniffers (an egg, no baby), or their hatching; armadillos take the ordinary animal path and are included. Villagers do not post this animal-only event, matching NeoForge's documentedbred Animal.spawnChildFromBreedingposting site; a rejected villager join instead leaves the child's bed free. On the server.
beacon_state_ change - Side
- server
- Contract
- listen
- Host / context
&mut dyn ServerHost- NeoForge
- —
- Summary
- A beacon at
posactivated or deactivated after its beam was checked.activesays whether it now has a complete pyramid. Server-side.
bell_ring - Side
- server
- Contract
- cancel
- Host / context
&dyn LevelHost- NeoForge
- —
- Summary
- On an authoritative server, a bell at
posis about to ring. Setcancelto stop the ring and its raider reveal.
biome_colors - Side
- client
- Contract
- listen
- Host / context
&dyn ClientHost- NeoForge
- —
- Summary
- 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 callsnative_, 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.refresh_ biome_ colors
block_break_ progress_ update - Side
- server
- Contract
- listen
- Host / context
&mut dyn ServerHost- NeoForge
- —
- Summary
- A server guest's block-breaking animation changed to
progressatpos(0 through 9).
block_burn - Side
- server
- Contract
- cancel
- Host / context
&dyn LevelHost- NeoForge
- —
- Summary
- On an authoritative server, fire is about to burn the block at
posaway. Setcancelto keep that block.
block_changed - Side
- server
- Contract
- listen
- Host / context
&dyn LevelHost- NeoForge
- —
- Summary
- An authoritative server committed a changed state through
Level.setBlock. The world containsnew; block side effects and neighbour updates follow.flagsare theBlockUpdateFlagsapplied to the write that reached the level, not to any intermediate changes staged in a transaction.KNOWN_skips the neighbour shape passes, not this notice. Each listener gets its own event.SHAPE
block_cook - Side
- server
- Contract
- listen
- Host / context
&mut dyn ServerHost- NeoForge
- —
- Summary
- A block finished cooking
itemintoresultatpos.
block_damage_ abort - Side
- server
- Contract
- listen
- Host / context
&mut dyn ServerHost- NeoForge
- —
- Summary
- A server player stopped digging
posbefore 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.
block_dispense_ armor - Side
- server
- Contract
- listen
- Host / context
&mut dyn ServerHost- NeoForge
- —
- Summary
- A dispenser equipped
itemon the first eligibletargetin front of its block atpos.targetisplayer,moborarmor_. The equip, item consumption, sound and game event have completed. Server-side.stand
block_drops - Side
- server
- Contract
- cancel
- Host / context
&dyn LevelHost- NeoForge
BlockDropsEvent- Summary
- NeoForge's
BlockDropsEvent:Block.dropResourceshas prepared the item entities but has not joined them to the level. Fires for player and mob block breaks using this path, and level-side breaks (pistons, water, neighbour updates,/). Not fired for explosions, dispensers or other loot-table drops. Usesetblock destroy can_to decide whether a blasted block drops, anddrop_ from_ explosion loot_to edit its stacks before the blast merges them. Player and mob loot also runsdrops loot_first; other level-side breaks do not.drops
block_entity_ type_ add_ blocks - Side
- both
- Contract
- collect
- Host / context
&RegistrationContext- NeoForge
BlockEntityTypeAddBlocksEvent- Summary
- Extend existing types' valid blocks (NeoForge
BlockEntityTypeAddBlocksEvent). Fired after content declarations, before worlds load.event.typesis the list of registered types. Useevent.modify(kind, blocks)for a direct addition, orevent.modify_for all matching registered keys. Neither changes the block's factory or ticker. 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.matching(predicate, blocks)
block_fade - Side
- server
- Contract
- cancel
- Host / context
&dyn LevelHost- NeoForge
- —
- Summary
- A block at
posis about to fade fromfromtotobecause of melting or coral death. Setcancelto keep it. Server-side.
block_failed_ dispense - Side
- server
- Contract
- listen
- Host / context
&mut dyn ServerHost- NeoForge
- —
- Summary
- A dispenser at
posfailed to dispenseitem. Server-side.
block_form - Side
- server
- Contract
- cancel
- Host / context
&dyn LevelHost- NeoForge
- —
- Summary
- Precipitation is about to form ice or place or thicken snow at
pos.fromandtoare block state IDs. Setcancelto keep the old state. Server-side.
block_grow_ feature - Side
- server
- Contract
- cancel
- Host / context
&mut dyn LevelRandomHost- NeoForge
BlockGrowFeatureEvent- Summary
- A sapling, azalea, mushroom or fungus at
posis about to grow into the configuredfeature,Nonewhen vanilla has none to place (a lone dark oak sapling). Setcancel, orfeaturetoNone, to keep the block; setfeatureto another key to grow that one. Server-side. Draw from the level's live stream withhost.with_.random(|rng| rng.next_ int_ bound(bound))
block_highlight - Side
- client
- Contract
- cancel
- Host / context
&dyn ClientHost- NeoForge
ExtractBlockOutlineRenderStateEvent- Summary
- Before an eligible targeted block's selection outline is built. Cancel skips only the default block highlight, after normal HUD and game-mode gates.
block_ignite - Side
- server
- Contract
- cancel
- Host / context
&dyn LevelHost- NeoForge
- —
- Summary
- On an authoritative server, fire is about to be placed at
posby flint and steel, a fire charge, lava, lightning or fire spread. Setplayeris the acting server player when there is one. Setcancelto leave the position unchanged.
block_lock_ check - Side
- server
- Contract
- cancel
- Host / context
&mut dyn ServerHost- NeoForge
- —
- Summary
- A guest's block inventory lock check at
pos.lockedis the vanilla result and may be changed. The guest's state is not swapped in.
block_receive_ game - Side
- server
- Contract
- cancel
- Host / context
&mut dyn ServerHost- NeoForge
- —
- Summary
- A sculk sensor or shrieker received a vibration for
eventatpos. Setcancelto suppress its response. Server-side.
block_shear_ entity - Side
- server
- Contract
- listen
- Host / context
&mut dyn ServerHost- NeoForge
- —
- Summary
- A dispenser sheared
entityof kindkindat the block in front of its own block atpos, after the shearing effects. Server-side.
block_spread - Side
- server
- Contract
- cancel
- Host / context
&dyn LevelHost- NeoForge
- —
- Summary
- On an authoritative server, a fluid flows or fire spreads from
fromintoto(kindisfluidorfire):FlowingFluid.spreadTo, andFireBlock.ticksetting fire totoor burning it (checkBurnOut). Setcanceledto leave the block attoas it is. Fluids ask on every flow: answer fast.
block_tool_ modification - Side
- both
- Contract
- cancel
- Host / context
&dyn Host- NeoForge
BlockEvent.BlockToolModificationEvent- Summary
- A tool is about to transform a block. Cancel or replace the final state;
Nonesuppresses the transformation. The block's owntool_part answers first, and a block whose part cancelled the action never reaches this hook.modified_ state
blocks- Side
- both
- Contract
- collect
- Host / context
&RegistrationContext- NeoForge
RegisterEvent- Summary
- Declare blocks in code once at startup on each side, before resources load. Pass each
mod_toapi:: Block event.register. The declaration belongs to the submitting package — in its own namespaces or in a content package it serves (served_) — and works likeby data/in a content mod, including a block item unless disabled with<id>/ sunrise/ block/ <path>.json Block::. Duplicate IDs across the host and served layers, and declarations into awith_ item(false) side = "server"package's namespace, are refused.registerreturns a typedDeclarationErrorfor invalid IDs or fields. The game records the refusal and stops startup even if a returning listener ignores it. A panic discards this listener's declarations and diagnostics without rejecting startup.
bonemeal- Side
- both
- Contract
- cancel
- Host / context
HostSide- NeoForge
BonemealEvent- Summary
BonemealEvent: bone meal fromstackused on the blockstateatpos(BoneMealItem.growCrop), byplayeror, when it isNone, by a dispenser or a villager.valid_is the block'sbonemeal_ target isValidBonemealTarget. Cancel skips vanilla's growth, the block's own bone meal Parts and the meal's use:growCropthen answerssuccessful(setSuccessful), which isfalseunless a mod sets it. Fired on both sides; changes tostackstay. Set it to None to consume the whole stack; a nonempty result is validated before any write-back.
break_block - Side
- server
- Contract
- cancel
- Host / context
&mut dyn ServerHost- NeoForge
BreakBlockEvent- Summary
- A player breaks the block
stateatpos, once the game allowed it (the held item can break blocks, the debug stick didn't take the click): whereServerPlayerGameMode.destroyBlockstarts. Setcanceledto keep the block: nothing is destroyed or dropped, and a guest sees it back. Setexp_toto_ drop Some(amount)to replace the experience sample later, after item drops are prepared;Nonekeeps sampling. A subscribed block part'sexp_answer is supplied as this event's initial amount.drop block_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 fromdrops destroy_, to NeoForge'sblock BreakBlockEvent.
brewing_complete - Side
- server
- Contract
- listen
- Host / context
&mut dyn ServerHost- NeoForge
- —
- Summary
- A brewing stand finished brewing at
pos, after its bottle contents were changed. Server-side.
brewing_fuel - Side
- server
- Contract
- listen
- Host / context
&mut dyn ServerHost- NeoForge
- —
- Summary
- A brewing stand at
posconsumedfueland gained brewing fuel. Server-side.
brewing_start - Side
- server
- Contract
- listen
- Host / context
&mut dyn ServerHost- NeoForge
- —
- Summary
- A brewing stand at
posbegan brewingingredient, after fuel and the timer were set. Server-side.
broadcast_message - Side
- server
- Contract
- cancel
- Host / context
&dyn Host- NeoForge
- —
- Summary
- A server broadcast line is about to be logged and sent. Change
lineor setcancelto drop it.
bucket_empty - Side
- server
- Contract
- cancel
- Host / context
&mut dyn ServerHost- NeoForge
- —
- Summary
- A server player empties a bucket at
pos(fluid:minecraft:water,minecraft:lava,minecraft:powder_; a fish or axolotl bucket emptiessnow minecraft:water): whereBucketItem.usehas found the block the fluid goes into and the player may build there, right before it is placed. Setcanceland nothing is poured and the bucket stays full. The player's state is swapped in, soPlayerRef::answers them. Only for guests of a server.tell fill_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.bucket
build_creative_ mode_ tab_ contents - Side
- both
- Contract
- listen
- Host / context
HostSide- NeoForge
BuildCreativeModeTabContentsEvent- Summary
- Edit a creative mode tab's ordered parent and search lists after its generator and before feature-flag filtering (NeoForge's
BuildCreativeModeTabContentsEvent). Runs once for every registered tab, including Search, Hotbar and Inventory, on the logical side that requests the build. The event gives the tab id, enabled feature flags, permission profile and a build-scoped edit handle. Edits are visible to later listeners in dispatch order.
calculate_player_ turn - Side
- client
- Contract
- listen
- Host / context
&dyn ClientHost- NeoForge
CalculatePlayerTurnEvent- Summary
- 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. This shapes how far the mouse turns the view;ClientHost::sets the view directly, and the two meet in the same angles the tick's move packet sends.set_ local_ rotation
camera_distance - Side
- client
- Contract
- listen
- Host / context
&dyn ClientHost- NeoForge
CalculateDetachedCameraDistanceEvent- Summary
- Final scaled third-person camera distance, before visual-shape collision clipping.
entityincludes its living scale/distance and optional mount scale/distance. Only finite requests in 0..=1024 blocks replace the vanilla distance.
camera_pose - Side
- client
- Contract
- listen
- Host / context
&dyn ClientHost- NeoForge
ViewportEvent.ComputeCameraAngles- Summary
- The camera this frame is drawn from,
partialticks 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.
camera_shake - Side
- client
- Contract
- listen
- Host / context
&dyn ClientHost- NeoForge
ViewportEvent.ComputeCameraAngles- Summary
- The camera shake native mods ask for in this frame,
partialticks 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, toshake, so several mods' shakes add up. Read while playing only; Sunrise scales the sum by Distortion Effects and bounds it (native_).shake_ matrix
camera_submersion - Side
- client
- Contract
- listen
- Host / context
&dyn ClientHost- NeoForge
- —
- Summary
- Override the client view's submersion. Camera fluid reads (
Camera.getFluidInCamera) start with the game's fog type afterstate_. The first-person water overlay instead asks at the local player's eye withat_ viewpoint Waterif the player's tick sampled water there, orAtmosphericotherwise. The sample comes from death tick 20 once the local player is removed, until respawn. SettingWaterenables the overlay; any other value suppresses it. SetAtmosphericto clear submersion or a fluid to force it. Later listeners see the last successful value. A panic disables only that mod's listener for the session and is reported in the log and the client error toast.
camera_type_ cycle - Side
- client
- Contract
- listen
- Host / context
&mut dyn ClientHost- NeoForge
- —
- Summary
key.togglePerspective(F5) is cycling the window's camera type (Minecraft.handleKeybindscallingOptions.setCameraType(getCameraType().cycle())):previousis the type it leaves, andnextcomes in as vanilla's next one (first person, third person behind, third person in front, then first person again); setnextto 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_andtype set_read and set the type at any other moment. Client-side. Beyond NeoForge: there is no counterpart. Diverges from upstream: new hook.camera_ type
campfire_start - Side
- server
- Contract
- listen
- Host / context
&mut dyn ServerHost- NeoForge
- —
- Summary
- An item was placed on a campfire at
posand began cooking.
can_continue_ sleeping - Side
- server
- Contract
- replace
- Host / context
&mut dyn ServerHost- NeoForge
CanContinueSleepingEvent- Summary
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.entityis its UUID,namea player's name (empty for a mob) andkindits type (minecraft:player).problemis what vanilla found (getProblem):NotPossibleHerewhen the bed atposis gone,NotPossibleNowwhen a player's bed rule no longer lets them sleep (daytime), none when nothing is wrong.may_starts empty, meaningcontinue problem.is_(none() mayContinueSleeping); set itSome(true)to keep them asleep,Some(false)to wake them. The player's state is not swapped in on a guest tick.
can_eat - Side
- both
- Contract
- replace
- Host / context
&dyn Host- NeoForge
- —
- Summary
Player.canEat, fromConsumable.canConsumewhen eating starts and block interaction eligibility for cake and candle cake.playeris the eater: the acting server player (including a LAN guest) or the local player whose use the client predicts. Read their effects throughhost.living(player.entity()). For food items,stackis the food being consumed. For cake and candle cake,stackisNoneregardless of the held item. Vanilla computes eligibility with always-eat false for cake, or the stack's food component for food.vanilla_is that answer (creative, always-eat, or hungry). Answercan_ eat Some(false)to refuse the food,Some(true)to let a full player eat;can_lefteat Nonekeepsvanilla_. Both sides (the client starts eating as the server does), so answer from the stack and the player alone. Not asked without a resident eater or an open lifecycle epoch; vanilla's answer stands during those world/login lifecycle gaps.can_ eat
can_player_ sleep - Side
- server
- Contract
- listen
- Host / context
&mut dyn ServerHost- NeoForge
CanPlayerSleepEvent- Summary
- A server player tries to sleep in the bed whose head is at
pos(NeoForge'sCanPlayerSleepEvent, vanilla'sServerPlayer.startSleepInBed).problemis what vanilla found, first problem only:too_,far_ away obstructed,not_(not night or thunder, the bed rule),possible_ now not_(monsters near), orsafe None. A mod may setNoneto let the player sleep anyway, or one of those names (other_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,problem player_still fires and may cancel. Server-side.bed_ enter
can_start_ swimming - Side
- both
- Contract
- replace
- Host / context
&dyn Host- NeoForge
IEntityExtension.canStartSwimming- Summary
- Replace
IEntityExtension.canStartSwimmingfor the player being simulated.Entryis asked of a sprinting player who isn't already swimming or flying, before excluding passengers.ShallowWateris asked in local sprint eligibility when the vanilla shallow-water clause is false but the body touches a swimmable fluid; afalseanswer then means shallow. The firstSome(true)orSome(false)wins. If no listener answers, Sunrise uses vanilla's saved-eye and feet-cell entry checks, or the ordinary vanilla shallow-water result. This does not change the player's fluid samples, flight or existing swim. Declareside = "both"and install the mod on both sides. Base the answer on facts available to both sides that tick; the server remains authoritative for position.
cauldron_level_ changed - Side
- server
- Contract
- cancel
- Host / context
&dyn LevelHost- NeoForge
- —
- Summary
- On an authoritative server, a cauldron at
posis about to change fill level fromfrom_tolevel to_forlevel reason. Setcancelto leave it unchanged. Forextinguishing(a burning entity in a water or powder snow cauldron), the game checks after the hook returns without cancelling that the block atposstill has the block id and properties it judged; if not, the block is not changed.
chat_recipient - Side
- server
- Contract
- cancel
- Host / context
&mut dyn ServerHost- NeoForge
- —
- Summary
- A public chat line from
sender(sender_) is about to reach the placed playername recipient: a player's chat afterserver_let it through, or achat /orsay /(signed or not). For a non-playerme /source such as the console or a command block,say senderis the nil UUID (0) andsender_is the source's display name.name messageis the text players see: whatserver_left, or the command's text. Setchat hiddenand that one receiver is not sent the line at all, no chat index and no pending acknowledgement. The others still get it, signed as it was sent, so its signature still verifies for them. The hook is asked once for each placed receiver, the sender included, before any of them is sent the line, in the order the hub lists them. Whispers (/) are not public and are not heard here, and neither is the line the server's log keeps: hiding is per receiver. This is not a secondmsg server_: that hook is heard once for a line, only for typed chat, and cancels it for everyone; this one is per receiver, and coverschat /andsay /. With no listener nothing is asked and nothing is allocated. Ame /requested while this hook is running fails rather than reentering the hook or sending an unchecked line. No player's state is swapped in. Server-side.say
chat_suggestion_ applied - Side
- client
- Contract
- listen
- Host / context
&dyn ClientHost- NeoForge
- —
- Summary
chat_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@.suggestion_ applied(original, start, end, suggestion, input)
chunk_data_ load - Side
- server
- Contract
- listen
- Host / context
&dyn ChunkDiskHost- NeoForge
ChunkDataEvent.Load- Summary
- The disk record's attachments have decoded, before the chunk is published. Runs on a chunk worker with a restricted Host. Read and edit
datathrough its typed methods; edits become the loaded store only if the entire job succeeds. Missing records and proto-to-full promotion do not fire this hook. Borrow the captured metadata fromhost.job(). A codec error, panic, or invalid or over-budget disk NBT refuses publication of the whole store. Later listeners still run on the last accepted envelopes. A phase refusal discards only that callback's proposal; only a panic disables a callback for this hook for the session.
chunk_data_ save - Side
- server
- Contract
- listen
- Host / context
&dyn ChunkDiskHost- NeoForge
ChunkDataEvent.Save- Summary
- A committed chunk snapshot is about to encode on the chunk worker.
databelongs only to that snapshot: typed edits change the disk record, never the live chunk. Exactly once per captured record, for full and proto chunks alike. The restricted Host cannot resolve live chunks or mutate the world;host.job()borrows the captured metadata. A failed job, including invalid or over-budget disk NBT, retains its snapshot and the prior disk record. After a callback panics or hits a codec error, later listeners still run on the last accepted envelopes, but the job cannot publish. A phase refusal discards only that callback's proposal; only a panic disables a callback for this hook for the session.
chunk_load - Side
- server
- Contract
- listen
- Host / context
&mut dyn ServerHost- NeoForge
ChunkEvent.Load- Summary
- Chunk
chunk([x, z], in chunks) ofdimensioncame into the world (NeoForge'sChunkEvent.Load):newwhen 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 beforeserver_. 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.started
chunk_sent - Side
- server
- Contract
- listen
- Host / context
&mut dyn ServerHost- NeoForge
ChunkWatchEvent.Sent- Summary
chunk's packet went toplayer(NeoForge'sChunkWatchEvent.Sent, at the end ofPlayerChunkSender.sendChunk), afterchunk_, 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, aswatch chunk_. Server-side.watch
chunk_ticket_ level_ updated - Side
- server
- Contract
- listen
- Host / context
&mut dyn ServerHost- NeoForge
ChunkTicketLevelUpdatedEvent- Summary
chunk's ticket level went fromoldtonew(NeoForge'sChunkTicketLevelUpdatedEvent, fromChunkMap.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 aChunkTicketLevel: the numberChunkLevelgives, 31 and lower entity ticking, 32 block ticking and 33 loaded without ticking, orUnloaded; none is clamped to the ticking range. Never told withold == new.
chunk_unload - Side
- server
- Contract
- listen
- Host / context
&mut dyn ServerHost- NeoForge
ChunkEvent.Unload- Summary
- Chunk
chunkofdimensionleft the world (NeoForge'sChunkEvent.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, whichworld_tells. Server-side.lifecycle
chunk_unwatch - Side
- server
- Contract
- listen
- Host / context
&mut dyn ServerHost- NeoForge
ChunkWatchEvent.UnWatch- Summary
playerstopped watchingchunk(NeoForge'sChunkWatchEvent.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 chunkchunk_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, aswatch chunk_. Not told when the server stops. Server-side.watch
chunk_watch - Side
- server
- Contract
- listen
- Host / context
&mut dyn ServerHost- NeoForge
ChunkWatchEvent.Watch- Summary
playerstarted watchingchunk(NeoForge'sChunkWatchEvent.Watch): the chunk came into their view and goes to their client, once untilchunk_. Vanilla tells it as the chunk is queued (unwatch ChunkMap.markChunkPendingToSend); Sunrise picks a chunk only as it sends it, so this comes just beforechunk_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. Server-side.sent
client_attack_ target - Side
- client
- Contract
- cancel
- Host / context
&mut dyn ClientHost- NeoForge
AttackEntityEvent- Summary
- Before a client's ordinary melee click attacks entities (not a spear jab), after the interaction-key cancellation hook.
targetsstarts 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. The committed crosshair entry keeps its tick-pick point and client occlusion policy; the tick's selection is not re-hit. Additional targets are 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. ReturningFlow::cancels the whole batch. NeoForge'sCancel AttackEntityEventis the corresponding attack notice; this hook is client-side only.
client_block_ changed - Side
- client
- Contract
- listen
- Host / context
&dyn ClientHost- NeoForge
- —
- Summary
- The block at
posindimensionwent fromoldtonewin this client's level (vanilla'sLevel.setBlockon aClientLevel), after the write: the level already readsnew. Told once per block whose state changed, on every route a client writes a block by: the server's block update, each block of its batched section update, the client's own predictions (a break, a placement, a use;predictedis true) and their reconciliation when the server acknowledges them (a refused prediction comes back,predictedfalse). A write that keeps the state is not told, and neither is a server update held under a pending prediction until the acknowledgement applies it. Whole columns arriving and leaving areclient_andchunk_ load client_. Only on a client of a server, a LAN guest included, and without a server-side mod; an integrated world's own blocks are the server'schunk_ unload block_. A level a server opens for viewing (changed sunrise:levels) is not told. Client-side; with no listener a write costs one flag check. Beyond NeoForge: there is no counterpart. Diverges from upstream: new hook.
client_chat - Side
- client
- Contract
- cancel
- Host / context
&mut dyn ClientHost- NeoForge
ClientChatEvent- Summary
- NeoForge's
ClientChatEvent: a client is about to sendmessage.original_is immutable; changemessage messageor setcancelto prevent sending.
client_chat_ received - Side
- client
- Contract
- cancel
- Host / context
&mut dyn ClientHost- NeoForge
ClientChatReceivedEvent, ClientChatReceivedEvent.Player, ClientChatReceivedEvent.System- Summary
- NeoForge's
ClientChatReceivedEvent: a chat line from the server is about to show, once Chat Delay lets it through.systemis a system message (ClientChatReceivedEvent.System), shown in the action bar whenoverlayis set; otherwise a player or disguised message in its chat typechat_(type getBoundChatType, its registry name;Nonefor a system message or an inline chat type).senderis the player's UUID, 0 (Util.NIL_) for system and disguised messages.UUID player_is the message as the player signed it (message ClientChatReceivedEvent.Player.getPlayerChatMessage): its body, whether a signature validated, timestamp, salt, the server's unsigned replacement and the filter mask;Nonefor system and disguised messages.messagestarts as the decorated line; replace it and the chat shows the new one, while the narrator still says the original. Setcanceland 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.
client_chunk_ load - Side
- client
- Contract
- listen
- Host / context
&mut dyn ClientHost- NeoForge
ChunkEvent.Load- Summary
- Chunk
chunk([x, z], in chunks) ofdimensioncame into this client's level from the server (NeoForge'sChunkEvent.Loadon the client, whoseisNewChunkis always false there): once per chunk packet the client adopts, after the column and its block entities are in the level, so a listener reads its blocks throughClientHost. A column the server sends again while it is resident is told again. Only on a client of a server, a LAN guest included; an integrated world's own chunks have the server'schunk_. Client-side.load
client_chunk_ unload - Side
- client
- Contract
- listen
- Host / context
&mut dyn ClientHost- NeoForge
ChunkEvent.Unload- Summary
- Chunk
chunk([x, z], in chunks) ofdimensionis leaving this client's level (NeoForge'sChunkEvent.Unloadon the client): once per column whose data is freed, with its blocks still there, just before they are freed. Told on every route that frees a column: the server's forget packet, a newer column taking the slot of one out of view, the view radius shrinking, and the client level going (a dimension change, a respawn into another level, leaving the server). The view centre moving away tells nothing:ClientChunkCachekeeps those columns in their slots, out of view, and shows one again untold when it is back in view, with noclient_. That is wider than NeoForge, which tells only the forget packet, so a listener never keeps state for a column that is gone. Only on a client of a server, a LAN guest included; an integrated world's own chunks have the server'schunk_ load chunk_. Client-side.unload
client_disconnecting - Side
- client
- Contract
- listen
- Host / context
&dyn ClientHost- NeoForge
ClientPlayerNetworkEvent.LoggingOut- Summary
- Before an actual connection is discarded, not on a dimension change.
client_identity - Side
- client
- Contract
- replace
- Host / context
&dyn ClientIdentityHost- NeoForge
- —
- Summary
- Choose what the client reports to the server at initial configuration (
ClientHandshakePacketListenerImpl.handleLoginFinished,ClientBrandRetriever.getClientModName). Runs on the network thread once per join that reaches configuration. A transfer joins a new destination; play-to-configuration transitions and the integrated server do not fire it.
client_information_ updated - Side
- server
- Contract
- listen
- Host / context
&mut dyn ServerHost- NeoForge
ClientInformationUpdatedEvent- Summary
- 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.oldandneware the values before and after this packet, one call per packet; they can be equal. The join's own information is reported too, once, just beforeplayer_, withlogged_ in oldthe defaults (ClientInformation.createDefault) andnewwhat the client joined with, as NeoForge fires it whenServerPlayerfirst sets it. The player is not swapped in. Server-side.
client_level_ load - Side
- client
- Contract
- listen
- Host / context
&mut dyn ClientHost- NeoForge
LevelEvent.Load- Summary
- The client made a new level for
dimension(NeoForge'sLevelEvent.Loadfrom theClientLevelconstructor): on joining a server, single player's own included, and on changing dimension. Its chunks come after. When the dimension changes, the old level'sclient_follows this, aslevel_ unload Minecraft.setLeveltells it after the new level is made. Client-side, on the window; the server's levels havelevel_.load
client_level_ unload - Side
- client
- Contract
- listen
- Host / context
&mut dyn ClientHost- NeoForge
LevelEvent.Unload- Summary
- The client dropped its level for
dimension(LevelEvent.UnloadfromMinecraft.setLevelanddisconnect): replaced by another dimension's, or on leaving the server. Once for eachclient_. Not told when the game itself quits. Client-side.level_ load
client_mining_ predict - Side
- client
- Contract
- cancel
- Host / context
&dyn ClientHost- NeoForge
- —
- Summary
- 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.
client_packet - Side
- client
- Contract
- listen
- Host / context
&mut dyn ClientHost- NeoForge
- —
- Summary
- A play packet from the server reached the window's game, decoded, just before the game handles it (
Connection.genericsFtwhanding it toClientPacketListener): every packet of the play phase, custom payloads included, in the order the server sent them. Control packets are not heard, whether standalone or bundled: keep-alives, chunk batch starts and finishes, bundle delimiters, resource pack pushes and pops, cookies, server links, transfers, disconnects, the configuration switch,minecraft:brandand 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.
client_packet_ send - Side
- client
- Contract
- cancel
- Host / context
&dyn ClientHost- NeoForge
- —
- Summary
- 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, chunk batch acknowledgements, 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, asclient_does for the packets that arrive. Play-phase pongs pass through this hook; returnpacket Flow::to drop a packet. Beyond NeoForge: there is no counterpart. Diverges from upstream: new hook.Cancel
client_pause_ change_ post - Side
- client
- Contract
- listen
- Host / context
&mut dyn ClientHost- NeoForge
ClientPauseChangeEvent.Post- Summary
- NeoForge's
ClientPauseChangeEvent.Post: the pause state changed.
client_pause_ change_ pre - Side
- client
- Contract
- cancel
- Host / context
&mut dyn ClientHost- NeoForge
ClientPauseChangeEvent.Pre- Summary
- NeoForge's
ClientPauseChangeEvent.Pre: cancel a proposed pause change.
client_pick - Side
- client
- Contract
- collect
- Host / context
&mut dyn ClientHost- NeoForge
- —
- Summary
- Whenever vanilla picks: once per client tick at
partial_, after the game mode tick and before key handling (also while paused), and once per frame at the frame's game-time partial tick before extraction. Both sites overwrite the same stored result.tick = 1.0 originis the world-space XYZ eye position of the camera entity used by this pick: interpolated at the frame's partial tick, current for the tick pick.originalis the vanilla answer; block and entity candidates are supplied independently. Each listener receives the same inputs. Onlyresultis shared between listeners: it starts atoriginaland may be replaced or cleared in dependency order. Tick inputs, including both hands of use, read the tick's result without another pick. The highlight reads the frame's result, which can differ from the tick's. Reentrant crosshair_target reads seeoriginal. A replacement is validated once at writeback; invalid output becomes a miss, never a recomputed pick. Consumption does not recheck block state or entity liveness. Server checks and item-specific rays (including buckets and brushes) are unchanged. No NeoForge 26.3 counterpart.
client_player_ change_ game_ type - Side
- client
- Contract
- listen
- Host / context
&mut dyn ClientHost- NeoForge
ClientPlayerChangeGameTypeEvent- Summary
- NeoForge's
ClientPlayerChangeGameTypeEvent: observe anyPlayerInfogame type change before the new mode is stored and afterLocalPlayer.onGameModeChangedruns.player_isid Somewhen the profile has a player entity in the client level.
client_player_ clone - Side
- client
- Contract
- listen
- Host / context
&mut dyn ClientHost- NeoForge
ClientPlayerNetworkEvent.Clone- Summary
- After the client replaces its player on respawn or dimension change (NeoForge's
ClientPlayerNetworkEvent.Clone). Client-side.
client_player_ logging_ in - Side
- client
- Contract
- listen
- Host / context
&mut dyn ClientHost- NeoForge
ClientPlayerNetworkEvent.LoggingIn- Summary
- The client accepted a play login and initialized its level and player identity (NeoForge's
ClientPlayerNetworkEvent.LoggingIn).player_is the server's entity ID. Client-side, once per connection, including single player.id
client_player_ logging_ out - Side
- client
- Contract
- listen
- Host / context
&mut dyn ClientHost- NeoForge
ClientPlayerNetworkEvent.LoggingOut- Summary
- Before client disconnect teardown (NeoForge's
ClientPlayerNetworkEvent.LoggingOut). The player may be absent. Client-side.
client_resources_ reloaded - Side
- client
- Contract
- listen
- Host / context
&dyn ClientReloadHost- NeoForge
ClientResourceLoadFinishedEvent- Summary
- 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_is the once-only moment after the initial load). Receives asetup ClientReloadHostfor published asset/data queries; world handles and transactions are not present on this context.
client_setup - Side
- client
- Contract
- listen
- Host / context
&mut dyn ClientSetupContext- NeoForge
FMLClientSetupEvent- Summary
- 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 is not a new start, so it never fires again. This is the opposite ofclient_, 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 (seeresources_ reloaded server_for itsabout_ to_ start FMLDedicatedServerSetupEvent). Receives aClientSetupContextfor client setup and published resource queries without world handles or transactions.
client_stopped - Side
- client
- Contract
- listen
- Host / context
&mut dyn ClientHost- NeoForge
ClientStoppedEvent- Summary
- The client has finished shutting down, after
client_. Fires once on the render thread for an orderly client exit, not for a dedicated server. NeoForge'sstopping ClientStoppedEvent.
client_stopping - Side
- client
- Contract
- listen
- Host / context
&mut dyn ClientHost- NeoForge
ClientStoppingEvent- Summary
- 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
ClientHostand save its own client state. It is the closing counterpart ofclient_. 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 (setup server_is its stop). Fabric'sstopping ClientLifecycleEvents.CLIENT_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 itsSTOPPING ClientHostreads and its own state.
client_tick_ post - Side
- client
- Contract
- listen
- Host / context
&mut dyn ClientHost- NeoForge
ClientTickEvent.Post- Summary
- 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'sGameonly, so not on a server's own tick (server_is that moment). Client-side.tick
client_tick_ pre - Side
- client
- Contract
- listen
- Host / context
&mut dyn ClientHost- NeoForge
ClientTickEvent.Pre- Summary
- 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'sGameonly, so not on a server's own tick (server_is that moment). Client-side.tick
command- Side
- client
- Contract
- cancel
- Host / context
&mut dyn ClientHost- NeoForge
- —
- Summary
- A command the local player typed or clicked in chat, without its slash, before the server and Sunrise's commands see it: set
ranwhen the mod ran it. Client-side: a server never asks, not for command blocks, guests or the console.
component_hover - Side
- client
- Contract
- cancel
- Host / context
&dyn ClientHost- NeoForge
- —
- Summary
GuiGraphicsExtractor.componentHoverEffect: the hover of the text component under the cursor, about to be drawn, in the chat, a book or a dialog.hoveris the component's hover action: its text, an item or an entity.xandyare the cursor in GUI pixels. Setcanceland the game draws nothing for it: no text tooltip, no item tooltip and no entity lines. A mod can draw its own withdraw. 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 asksitem_and thetooltip render_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.tooltip_ *
component_types - Side
- both
- Contract
- collect
- Host / context
&RegistrationContext- NeoForge
RegisterEvent- Summary
- Register namespaced NBT component types before content loads. Call
ComponentTypesEvent::with each owned ID, such asregister "mymod:charge".into(). IDs are checked together at startup: invalid IDs, theminecraftnamespace and duplicate IDs are refused before the component registry is frozen.
compost_item - Side
- server
- Contract
- listen
- Host / context
&mut dyn ServerHost- NeoForge
- —
- Summary
- A player added a compostable item to the composter at
pos.
compute_fog_ color - Side
- client
- Contract
- listen
- Host / context
&dyn ClientHost- NeoForge
ViewportEvent.ComputeFogColor- Summary
- 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.
compute_fov - Side
- client
- Contract
- listen
- Host / context
&dyn ClientHost- NeoForge
ViewportEvent.ComputeFov- Summary
- 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.
compute_fov_ modifier - Side
- client
- Contract
- listen
- Host / context
&dyn ClientHost- NeoForge
ComputeFovModifierEvent- Summary
- 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.
config_loading - Side
- both
- Contract
- listen
- Host / context
&dyn ConfigContext- NeoForge
ModConfigEvent.Loading- Summary
- A registered config was read (
ModConfigEvent.Loading):configsays whose, which file and its text, which the mod parses (TOML by convention). Every mod hears every config, so checkmod_. Fired where the config's kind loads (id register_), aconfigs Serverone beforeserver_. Receives aabout_ to_ start ConfigContextwith settings reads and the scopedConfigFilesservice. Client and Common load once on their owning side, Server once per world.
config_reloading - Side
- both
- Contract
- listen
- Host / context
HostSide- NeoForge
ModConfigEvent.Reloading- Summary
- 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. Receives the polling game'sHostSide; world queries returnNoneif no world is open. A panic disables only the offending mod’s reload callback; later listeners still run. Live writes outside a journal stand.
config_unloading - Side
- server
- Contract
- listen
- Host / context
&mut dyn ServerHost- NeoForge
ModConfigEvent.Unloading- Summary
- A
Serverconfig is dropped as its server stops (ModConfigEvent.Unloading), afterserver_; the next world reads it again.stopping ClientandCommonconfigs stay until the game quits. Receives the stopping game'sServerHost, before the final save and teardown. A panic disables only that mod’s unload callback, not other listeners or the rest of teardown. Live writes outside a journal stand.
console_line - Side
- server
- Contract
- listen
- Host / context
&mut dyn ServerHost- NeoForge
- —
- Summary
- Observe an operator-visible log line on a dedicated or integrated server.
levelisINFO,WARNorERROR,threadnames the logging thread, andmessageis the text without its timestamp, thread or level prefix. Lines from every logging thread are delivered in order on the server thread at the start of the next server tick. The tap starts on the first tick with an enabled listener; without one, no log is captured and no queue is allocated or locked in the idle path. A listener's own log calls are not tapped. The queue keeps the oldest 4096 lines and discards later ones until it drains.droppedreports the number discarded on the first line of that batch and is zero on all other lines.messagekeeps its first 8192 bytes andthreadits first 128, at a character boundary. A listener cannot change or suppress the log.
consume_effect - Side
- server
- Contract
- listen
- Host / context
&mut dyn ServerHost- NeoForge
- —
- Summary
- A custom entry of the stack's effective
consumable, in list order, interleaved with built-in effects.stackis the read-only snapshot before consumption shrinks it, including components.useris the player or mob consuming it. An unclaimed kind does nothing. Register a custom kind's save codec and Wire value withRegistrar::before placing it in a stack that will be sent to a client. A registered kind'sregister_ consume_ effect_ type dataholds the canonical fields returned by its save codec, with their exact NBT types.
container_loot_ filled - Side
- server
- Contract
- collect
- Host / context
&dyn LevelHost- NeoForge
- —
- Summary
- Sunrise addition: no NeoForge counterpart. Fired once per container fill, each half of a double chest separately, on the rolled list in roll order before shuffle, splitting and slot placement. Add, replace or remove drops; empty stacks are dropped. Stacks over their item's maximum are trimmed at placement, after the hook; overflow that cannot fit is discarded. The opener is named only when a player's open starts the fill. Other accesses (including an
ItemPlace::read, even during a player action) give None. The origin is the block's centre or the container entity's position. Already filled containers and block or mob drops do not fire this hook. Listeners run in dispatch order, each seeing the previous list, after loot_table_load's changes. The level Host provides reads only; only the drop list is writable. Non-negative damage within the signed integer range is accepted even above an item's maximum. Invalid component writes retain the prior list and warn. Panics follow the runtime listener isolation policy. Listeners use their own randomness. With no listener, the roll and placement random draws remain unchanged.EntitySlot
container_opened - Side
- server
- Contract
- cancel
- Host / context
&mut dyn ServerHost- NeoForge
- —
- Summary
- A player opens one of the game's own menus (
ServerPlayer.openMenu; the job of NeoForge'sPlayerContainerEvent.Open, which comes after the menu is open and cannot stop it):kindis the menu type (minecraft:generic_,9x3 minecraft:furnace,minecraft:crafting,minecraft:merchant,minecraft:anvil,minecraft:lectern...; a horse's inventory isminecraft:horse_) andinventory posthe 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. Setcanceland nothing opens: the open menu stays as it was and the click is spent. The player's state is swapped in for the call, sohost.players().acting_,player() PlayerRef::and the item helpers reach them. Not heard: a menu a mod opens (tell native_), the inventory screen, and the editors (sign, book, command block). Server-side, for every player of the world.open_ menu
crafter_craft - Side
- server
- Contract
- listen
- Host / context
&mut dyn ServerHost- NeoForge
- —
- Summary
- A crafter at
poscompleted reciperecipe.
create_fluid_ source - Side
- server
- Contract
- listen
- Host / context
&dyn LevelHost- NeoForge
CreateFluidSourceEvent- Summary
- A fluid source at
pos(state) is about to count towards turning the flowing fluid beside it into a source (NeoForge'sCreateFluidSourceEvent,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_starts as the fluid's rule (convert water_orsource_ conversion lava_). Server-side.source_ conversion
create_skull_ models - Side
- client
- Contract
- collect
- Host / context
&RegistrationContext- NeoForge
EntityRenderersEvent.CreateSkullModels- Summary
- Skull models for a mod's own skull types (NeoForge's
EntityRenderersEvent.CreateSkullModels): callevent.register(model)with oneSkullModelper type, giving itskind, model layer and default texture. Aminecraft:headitem model may then name the kind, so the head draws in hand, in a GUI and in an item frame. Called once at client startup. Any valid canonical<namespace>:<path>identifier (includingminecraft:for non-vanilla paths) is accepted; invalid identifiers, the seven built-in vanilla skull types (minecraft:skeleton,minecraft:wither_,skeleton minecraft:player,minecraft:zombie,minecraft:creeper,minecraft:piglin,minecraft:dragon), duplicate registrations, entries with a layer neither a mod nor vanilla has, or entries with an empty texture are logged and left out. API @API:create_skull_models@.
create_spawn_ position - Side
- server
- Contract
- cancel
- Host / context
&mut dyn ServerHost- NeoForge
LevelEvent.CreateSpawnPosition- Summary
- Before a new server level selects its initial world spawn (NeoForge's
LevelEvent.CreateSpawnPosition).
creative_slot - Side
- server
- Contract
- cancel
- Host / context
&mut dyn ServerHost- NeoForge
- —
- Summary
- A creative-mode player sets a slot of their inventory from the creative screen (
ServerGamePacketListenerImpl.handleSetCreativeModeSlot):slotis 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) anditem(minecraft:airfor an emptied slot) andcountwhat 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. Setcanceland the packet is ignored. The player's state is swapped in for the call, sohost.players().acting_,player() PlayerRef::and the item helpers reach them. Not heard: stacks a creative player gets other ways (middle-click pick block,tell /). Server-side, for every player of the world.give
creeper_ignite - Side
- server
- Contract
- listen
- Host / context
&mut dyn ServerHost- NeoForge
- —
- Summary
- A player ignited a creeper with an item.
creeper_power - Side
- server
- Contract
- listen
- Host / context
&mut dyn ServerHost- NeoForge
- —
- Summary
- Lightning charged a creeper.
critical_hit - Side
- server
- Contract
- listen
- Host / context
&mut dyn ServerHost- NeoForge
CriticalHitEvent- Summary
- NeoForge's
CriticalHitEvent: a player's melee hit on a livingtarget_(kind minecraft:zombie,minecraft:armor_) that deals damage, wherestand Player.attackdecides whether it is critical.vanilla_is vanilla's answer;critical criticalstarts 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_starts at 1.5 for vanilla's critical and 1.0 otherwise, and scales the damage only whilemultiplier criticalends 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.
crop_grow_ post - Side
- server
- Contract
- listen
- Host / context
&mut dyn LevelRandomHost- NeoForge
CropGrowEvent.Post- Summary
- A crop-like block grew (NeoForge's
CropGrowEvent.Post). Diverges from NeoForge: original_state is always the pre-growth state.stateis what is atposnow. Sugar cane reports the new cane above it, and kelp and vines the new head, whileoriginal_names the growing plant before growth. A full-age stem fires even without fruit; sugar cane fires only when adding a cane, not when only aging. Cactus and chorus report the plant's position. Server-side.state
crop_grow_ pre - Side
- server
- Contract
- listen
- Host / context
&mut dyn LevelRandomHost- NeoForge
CropGrowEvent.Pre- Summary
- A crop-like block at
posis about to grow on a random tick (NeoForge'sCropGrowEvent.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.stateis the growing block. LeaveresultatDefaultfor vanilla's own chance, or setTrueto grow now orFalseto stop it (DO_). Vanilla's random roll is drawn either way, in vanilla's order. Server-side.NOT_ GROW
custom_click_ action - Side
- server
- Contract
- cancel
- Host / context
&mut dyn ServerHost- NeoForge
CustomClickActionEvent- Summary
- NeoForge's
CustomClickActionEvent: a server player's client sent acustomclick action (a dialog button or a text component's click event): its id and optional payload. Vanilla only logs it; setcancelto 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.
custom_spawner_ tick - Side
- server
- Contract
- listen
- Host / context
&mut dyn ServerHost- NeoForge
ModifyCustomSpawnersEvent- Summary
CustomSpawner.tickfor a spawner a mod added withmodify_: the levelcustom_ spawners dimensionticks the spawnerkey, once per tick in the list's order, withspawn_asenemies ServerLevel.isSpawningMonsters(thespawn_rule, and not peaceful). Every mod gets the call, and the mod that ownsmonsters keyspawns throughhost(its spawns go throughfinalize_and the spawn checks like any other); the rest ignore it. It is called only while thespawn spawn_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 themobs CustomSpawnerobject. Server-side.
customize_boss_ event_ progress - Side
- client
- Contract
- cancel
- Host / context
&dyn ClientHost- NeoForge
CustomizeGuiOverlayEvent.BossEventProgress- Summary
- One boss bar is about to be drawn (NeoForge's
CustomizeGuiOverlayEvent.BossEventProgress, inBossHealthOverlay):baris the bar,xandycome in as its top-left corner in GUI pixels (91 left of the screen's centre; 12 for the first bar), andincrementas the spacing to the next bar'sy(19). Movexandyto draw this bar, and its title, there; setincrementto space the next bar, which comes in that far below where this one came in (movingydoes not move the bars after it). Setcanceland 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. A bar the API can't carry (a server's name text the API refuses) isn't heard and is drawn as vanilla draws it.
customize_chat_ overlay - Side
- client
- Contract
- listen
- Host / context
&mut dyn ClientHost- NeoForge
CustomizeGuiOverlayEvent.Chat- Summary
- The in-game chat is about to be drawn (NeoForge's
CustomizeGuiOverlayEvent.Chat, inGui.renderChat):xandycome 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.focusedis whether the chat screen is open, andgui_/width gui_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.height
data_map_ types - Side
- server
- Contract
- collect
- Host / context
&mut dyn ServerHost- NeoForge
RegisterDataMapTypesEvent- Summary
- The server is assembling its data tables, as for
data_(a world's first open and everypack_ files /): push the data map types your mod registers (NeoForge'sreload RegisterDataMapTypesEvent). A type is a namespacedid(namespace:path) for aregistry: any the game names. Its values come from the world's data packs'data/(the registry's path for a<namespace>/ data_ maps/ <registry folder>/ <path>.json minecraftregistry,<namespace>/otherwise), and from files you push through<path> native_under the keydata_ pack_ files data_. Each file has amaps/ <namespace>:<registry folder>/ <path> valuesobject mapping entry IDs and#tagsto JSON, with an optional booleanreplaceand aremovelist. Entry conditions (neoforge:conditions) are evaluated before the value, including on direct objects. A malformed layer is logged and skipped as a whole; otherwise newer values override older ones. Push a typed map'sDataMap::and use the key'sty data(ItemKey::,data EntityTypeKey::...) for an owned decoded value. By name,data data_borrows a raw tag andmap_ value data_borrows the whole slice in entry ID order. Both borrow from the host; copy values only if you need them after the borrow. Server-side, not synced to clients.map_ entries
data_maps_ updated - Side
- both
- Contract
- listen
- Host / context
&dyn ReloadContext- NeoForge
DataMapsUpdatedEvent- Summary
- 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.registryis the registry's id (minecraft:item,minecraft:block) andcausesays how they arrived. A listener cannot cancel or change anything.
data_pack_ files - Side
- server
- Contract
- collect
- Host / context
&mut dyn ServerHost- NeoForge
AddPackFindersEvent- Summary
- The server is assembling its data tables from the world's data packs (
ReloadableServerResources): a world is opening, or/was run, and the recipes, tags, loot and advancements are built after this. Pushreload (path, bytes)pack files and they join this load.pathis the overlay's key,<kind>/without<namespace>:<path> .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.…
datapack_sync - Side
- server
- Contract
- collect
- Host / context
&mut dyn ServerHost- NeoForge
OnDatapackSyncEvent- Summary
- Collect recipe types once the joining player exists, after admission and before that player's recipes are sent. On reload, asked once per online player, at most once per player per reload, before their recipes are re-sent. With nobody online this hook is not asked.
playeralways identifies the recipient. Configuration tags precede admission. Only this player's Sunrise client receives the selected recipes; vanilla clients receive nothing new. Recipes using a vanilla serializer carry the server's resolved item candidates, not the source's ingredient definitions or bound predicates. A mod serializer still writes its own recipe content. An empty answer retains the client's own recipes, or restores them after an earlier nonempty answer.
default_components_ bound - Side
- both
- Contract
- listen
- Host / context
&dyn ReloadContext- NeoForge
DefaultDataComponentsBoundEvent- Summary
- Items' default components are bound and readable (NeoForge's
DefaultDataComponentsBoundEvent);causesays how, astags_'s does. The place to build or rebuild caches derived from item defaults (stack sizes, food, tool rules): from now on the default-component reads return the published defaults,updated modify_' edits included.default_ components
difficulty_changed - Side
- server
- Contract
- listen
- Host / context
&mut dyn ServerHost- NeoForge
DifficultyChangeEvent- Summary
- The server's difficulty changed, from
fromtoto(peaceful,easy,normal,hard; NeoForge'sDifficultyChangeEvent). It is vanilla'sMinecraftServer.setDifficulty, which/, 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.difficulty
dragon_egg_ form - Side
- server
- Contract
- cancel
- Host / context
&dyn LevelHost- NeoForge
- —
- Summary
- The Ender Dragon fight is about to place its first dragon egg at
pos. Setcancelto leave the block unchanged. Server-side.
effect_particle_ modification - Side
- server
- Contract
- listen
- Host / context
&dyn Host- NeoForge
EffectParticleModificationEvent- Summary
- NeoForge's
EffectParticleModificationEvent, vanilla'sLivingEntity.updateSynchronizedMobEffectParticles: asked for each active effecteffectof the living entityentity(aLivingRef, 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_is vanilla's for the effect: anparticle entity_in its colour (alpha 38 of 255 when ambient), the omens' own particles.effect particlestarts as it: replace it, or set it toNoneto go back to the original.visiblestarts 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::with its registeredsimple ParticleKey) goes only to Sunrise clients: the others get the list without it. Whether the swirls are ambient (drawn fainter and rarer) follows from the answers as vanilla'sareAllEffectsAmbientdoes: 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.
emissive- Side
- client
- Contract
- collect
- Host / context
&dyn ClientHost- NeoForge
- —
- Summary
- 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.
enchant_effect - Side
- server
- Contract
- listen
- Host / context
&mut dyn ServerHost- NeoForge
RegisterEvent- Summary
- A
minecraft:post_effect of a mod's own kind, on a mob a player's weapon hit: the entry saysattack enchantedattacker andaffectedvictim, itsrequirementspassed, and itseffectnames atypein a namespace outsideminecraft:. Told the enchantment id, the kind, theeffectpayload as a borrowedTag, 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 insideminecraft:all_, aren't told yet. An unclaimed kind does nothing.of
enchant_item - Side
- server
- Contract
- listen
- Host / context
&mut dyn ServerHost- NeoForge
- —
- Summary
- A server player applied an enchantment at
pos;itemis the finished item andlevelsthe levels charged. The player's state is not swapped in.
enchanted_block_ loot - Side
- server
- Contract
- listen
- Host / context
&dyn LevelHost- NeoForge
EnchantedBlockLootEvent- Summary
- NeoForge's
EnchantedBlockLootEvent: a block's loot table is reading the level ofenchantmentontoolto decide whatstateatposdrops, inApplyBonusCount.runorBonusLevelTableCondition.test.levelstarts as the tool's level, afterget_; what is left in it is what that one count or condition uses, and the tool keeps its own. Aenchantment_ level u32can't be negative, the casesetEnchantmentLevelrefuses; one above 1024 counts as 1024, as vanilla's levels stop at 255 and a level sizes a formula's loop.toolis none for an empty hand or a break with no tool, and the read is still asked, at level 0.entityisLootContextParams.THIS_: 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 ofENTITY /, 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, andloot ... mine entityis a handle a listener can keep and compare but not read until it has aHost. Authoritative servers only. Useget_when the block doesn't matter. Tick-time effect: oneenchantment_ level listenedtest per roll when no mod listens.
enchanted_entity_ loot - Side
- server
- Contract
- listen
- Host / context
&mut dyn ServerHost- NeoForge
EnchantedEntityLootEvent- Summary
- An entity's loot table reads an enchantment's level (NeoForge's
EnchantedEntityLootEvent): asked in the middle of the roll, each time anenchanted_function or acount_ increase random_condition is evaluated, for a death and forchance_ with_ enchanted_ bonus /.loot ... kill entityis the living entity dropping the loot,sourcethe killing blow (minecraft:magicfor the command) andattackerthe attacking entity (getAttacker): the one that caused the blow, or the command's source, even whensourcenames nobody. It is None without one, and it need not be living: such a read is asked too, from a level of 0.levelcomes in as the living attacker's level ofenchantment; 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 preferget_; a mob's equipment drop chance isn't this hook's (enchantment_ level get_). Not asked for aequipment_ drop_ chance /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.loot ... kill
enchantment_level_ set - Side
- server
- Contract
- listen
- Host / context
&mut dyn ServerHost- NeoForge
EnchantmentLevelSetEvent- Summary
- An enchanting table at
posdrew the level of one offer (EnchantmentMenu.slotsChanged, aftergetEnchantmentCost):offerholds the server player whose table it is, the row (0 to 2), the power (bookshelves counted), the item and the level drawn. Changelevelto change the offer; a level belowrow + 1offers nothing, as vanilla's. Asked for each row in order, beforeprepare_. Server-side.item_ enchant
ender_entity_ teleport - Side
- server
- Contract
- cancel
- Host / context
&dyn LoopContext- NeoForge
EntityTeleportEvent.EnderEntity- Summary
- An enderman or a shulker is about to teleport on its own (
EntityTeleportEvent.EnderEntity). A mod may movetargetor cancel. It is given the loopcontextof 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 noHost.
ender_pearl_ teleport - Side
- server
- Contract
- cancel
- Host / context
&mut dyn ServerHost- NeoForge
EntityTeleportEvent.EnderPearl- Summary
- A server player's or mob's ender pearl is about to teleport its
owner(EntityTeleportEvent.EnderPearl,ThrownEnderpearl.onHit).owneris the live entity handle,pearlits projectile id,fromthe owner's feet andtargetthe 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 falldamage(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; theirdamagestarts 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. What the pearl hit (getHitResult), inprojectile_'s shape: the entityimpact hit_(a dragon part is the dragon), or, with it None, the blockentity hit_on itsblock hit_(the face's normal);face hit_is the hit point. For an entity,at hit_is the cell ofblock hit_andat hit_isface [0, 0, 0].
enderman_anger - Side
- server
- Contract
- cancel
- Host / context
&dyn Host- NeoForge
EndermanAngerEvent- Summary
playerstares atenderman(NeoForge'sEndermanAngerEvent, at the end ofEnderman.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. Setcanceland that stare doesn't count. Server-side.
entities_load - Side
- server
- Contract
- listen
- Host / context
&mut dyn ServerHost- NeoForge
- —
- Summary
- Entities from
chunkfinished loading into the server world.countis the number of saved entity records read.
entities_unload - Side
- server
- Contract
- listen
- Host / context
&mut dyn ServerHost- NeoForge
- —
- Summary
- Entities in
chunkleft the active server world and were queued for saving.countis the number of entity records.
entity_break_ door - Side
- server
- Contract
- listen
- Host / context
&mut dyn ServerHost- NeoForge
- —
- Summary
- A mob broke the door at
pos.
entity_breed - Side
- server
- Contract
- listen
- Host / context
&mut dyn ServerHost- NeoForge
- —
- Summary
- Two mobs completed a breeding action.
childis absent when vanilla lays an egg instead of creating a baby.
entity_change_ block - Side
- server
- Contract
- listen
- Host / context
&mut dyn ServerHost- NeoForge
- —
- Summary
- A mob changed a block at
pos, after the new state was applied.
entity_change_ block_ pre - Side
- server
- Contract
- cancel
- Host / context
&mut dyn ServerHost- NeoForge
- —
- Summary
- 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.playeris the player whose landing it was,entityandkindthe mob for a mob's landing (Noneand the player's type here).fromandtoare resolved block states. Setcanceland the block stays as it was and nothing the change would have caused happens, as Bukkit'sEntityChangeBlockEvent(@API:entity_change_block_v2@). The fork names this pre-change vetoentity_;change_ block_ pre entity_is the separate post-change notice.change_ block
entity_constructing - Side
- both
- Contract
- listen
- Host / context
HostSide- NeoForge
EntityEvent.EntityConstructing- Summary
- A new entity is being made (NeoForge's
EntityEvent.EntityConstructing, vanilla'sEntity.<init>):kindis its type (minecraft:zombie,minecraft:playerfor a player) andholderholds 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.
entity_drop_ item - Side
- server
- Contract
- listen
- Host / context
&mut dyn ServerHost- NeoForge
- —
- Summary
- A mob is about to drop
countofitematpos(Bukkit'sEntityDropItemEvent).
entity_enter_ block - Side
- server
- Contract
- listen
- Host / context
&mut dyn ServerHost- NeoForge
- —
- Summary
- A bee entered the hive at
posand was stored there.
entity_enter_ love_ mode - Side
- server
- Contract
- listen
- Host / context
&mut dyn ServerHost- NeoForge
- —
- Summary
- A mob entered love mode after player interaction.
playeris the feeder when known.
entity_entering_ section - Side
- both
- Contract
- listen
- Host / context
HostSide- NeoForge
EntityEvent.EnteringSection- Summary
entitymoved from the 16x16x16 sectionold_intosection new_(NeoForge'ssection EntityEvent.EnteringSection, vanilla'sEntitySectionStoragecallbacks onEntity.setPosRaw). Both are section coordinates (SectionPos: each block coordinate shifted right by 4), andchunk_is NeoForge'schanged didChunkChange: the x or z section differs, so the entity is in another chunk column.hostis the side that saw the move. Nothing can be cancelled: the entity is already in its new section.
entity_interact - Side
- both
- Contract
- replace
- Host / context
HostSide- NeoForge
PlayerInteractEvent.EntityInteract- Summary
- A player right-clicks the entity
entity(Entity.getId) of typekind(minecraft:cow) withhand(Hand::orMain Hand::), holdingOff stack(none in an empty hand): wherePlayer.interactOnstarts, before the entity's owninteractand the item'sinteractLivingEntity. Both logical sides answer independently, once per hand, main hand before off hand. A consuming client result ends the loop; only Success swings there. SuccessServer and Consume consume without a client swing. Fail, Pass and TryWithEmptyHand fall through on this entity path. A server-only answer leaves the client's off-hand prediction unchanged. ClientHost permits reads and local effects, not authoritative writes. A client without this mod predicts vanilla here; the server corrects it.
entity_interact_ specific - Side
- server
- Contract
- cancel
- Host / context
&mut dyn ServerHost- NeoForge
PlayerInteractEvent.EntityInteractSpecific- Summary
- a right-click on an entity with the point clicked:
entity_hears the entity, its type, the held stack and the point clicked, measured from the entity's position, beforeinteract_ specific native_(NeoForge'sinteract_ entity PlayerInteractEvent.EntityInteractSpecificcounterpart); a claim swings the hand and ends the click. Server-side. Bundles need "hooks": @API:entity_interact_specific@.
entity_invulnerability_ check - Side
- both
- Contract
- listen
- Host / context
LevelSide- NeoForge
EntityInvulnerabilityCheckEvent- Summary
- Decide whether an entity is invulnerable to this specific damage source (
Entity.isInvulnerableTo).original_is the vanilla answer andinvulnerability invulnerablestarts with that value. Listeners may change it before the hit is applied. This fires once per 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 onliving_, 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.incoming_ damage
entity_join_ level - Side
- server
- Contract
- cancel
- Host / context
&mut dyn ServerHost- NeoForge
EntityJoinLevelEvent- Summary
- An entity joins the server level
dimension(NeoForge'sEntityJoinLevelEvent): vanilla'sPersistentEntitySectionManager.addEntity.loaded_is true for an entity coming back with its chunk, false for one added fresh (from_ disk addFreshEntity: a drop, an orb,/, an arrival through a portal).summon entityis its ID andkindits type (minecraft:item). It is already in the level's lists, so helpers that take an entity ID find it. Setcanceledto keep it out: it is taken back out as if never added, and a/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, block/item/text displays, markers and interactions), once each, in the order they were created; checksummon kind. A drop, an orb, a mob, a/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. Inside a transaction (summon Host::) opened in the entity's own level the join is told at that transaction's root commit, not at the spawn call (an entity spawned in another level, as by a command runtransaction init, is told at once): before the commit the entity exists andentity_has run, but no one is told it joined, and a listener reads the entity when the commit runs. An aborted transaction tells nothing, and the entity it spawned is gone. A join cancelled at the commit leaves the spawn's handle stale. Joins at one commit come in the order the entities were added, before the removals the transaction asked for take effect. Join notifications in the same level requested while a commit is announcing its joins (from a direct spawn or a committed transaction in that level) are delivered after that announcing batch, in request order. Live fallback-store entities also notify: displays, markers, interactions, and summoned or chunk-restored eyes of ender and explicit leash knots. Gameplay-thrown eyes and naturally tied leash knots live in separate lists and do not notify yet.constructing loaded_is set when a chunk restores an entity. Saved data kept for a missing mod is not an entity in the level and does not notify. Server-side.from_ disk
entity_leave_ level - Side
- server
- Contract
- listen
- Host / context
&mut dyn ServerHost- NeoForge
EntityLeaveLevelEvent- Summary
- An entity leaves the server level
dimension(NeoForge'sEntityLeaveLevelEvent): vanilla'sonTrackingEnd, 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.entityis its ID andkindits type (minecraft:item); it is no longer in the level's lists. It only hears. It tells every kindentity_does (join_ level kindis the type), each once, when the game next notices it gone (the tick or action that removed it). Inside a transaction (Host::) opened in the entity's own level an entity's removal takes effect, and this hook fires, at that transaction's root commit, not at the removal call (an entity in another level, as by a command runtransaction init, leaves at once): from the call on its handle and selectors no longer find it. An aborted transaction removes nothing and tells nothing. An entity the transaction spawned and removed is never told to join, so it never leaves. Checkkind. Server-side.
entity_mob_ griefing - Side
- server
- Contract
- listen
- Host / context
&dyn Host- NeoForge
EntityMobGriefingEvent- Summary
- May
entitychange the world? (NeoForge'sEntityMobGriefingEvent,EventHooks.canEntityGrief.)can_starts as thegrief mob_game rule; set it either way. Asked for a mob explosion (griefing 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), a zombie breaking a door, the dragon breaking blocks, a ravager breaking pitcher crops, a burning mob melting powder snow, a weaving mob's cobwebs, and decorations and items in explosions (asked for the exploding entity, and for the mob that causes the blast). Asked often: answer fast. Server-side.
entity_mount - Side
- server
- Contract
- cancel
- Host / context
&mut dyn ServerHost- NeoForge
EntityMountEvent- Summary
- An entity mounts or dismounts a vehicle (NeoForge's
EntityMountEvent, posted fromEntity.startRidingandremoveVehicle):entityof typekind(minecraft:player,minecraft:zombie) in the server leveldimension, getting on (mounting) or off thevehicleof typevehicle_(kind minecraft:oak_,boat minecraft:minecart,minecraft:horse,minecraft:cushion). Setcanceledand it does not: a player stays where they were, a mob does not board, a/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. The departing rider's own dismount is asked first, then its direct passengers in passenger-list order. The removed vehicle is no longer a valid handle or query result during these callbacks. A Mob's canceled dismount keeps the relationship with a removed boat, cart or mob; 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. A mob riding a player is compulsorily ejected on save, logout, death or dimension change: the dismount notifies this hook, but cancellation cannot keep the mob aboard. Loading a save does not notify. A mob that boards a boat by touching it is checked again after the hook returns without canceling: the boat is found again by id (gone: the contact pass for that boat ends), its passengers are counted again, and the mob must still exist, not be removed and not already ride; a full boat or an unfit mob skips that mob. A player who sits on a cushion has the cushion found again by id after the board and dismount checks: gone, the click is spent and the player is not seated. Server-side.ride
entity_move - Side
- server
- Contract
- cancel
- Host / context
&dyn LoopContext- NeoForge
- —
- Summary
- One physical
Entity.moveinvocation (#2414, design #2308, the maintainer ruling of the same issue): the entityentityofkind(minecraft:zombie) is about to move bydelta(blocks this tick) forcause's sake - itself, the player behind a position packet, a piston, a shulker box lid, a shulker mob's opening lid, a moving collider carrying or shoving the body. It fires before the move's own handling, no-physics and the stuck multiplier included, in the one gate every kind's physics resolves through, so a forgotten family cannot move around it. Changedeltato replace the movement (still through every ordinary restriction) or setevent.cancelledor returnFlow::to skip it: no position, velocity, collision-flag or fall change, and no displacement notice. Replacement components must be finite; there is no additional per-axis limit. A non-finite replacement rejects that listener's delta and veto together and logs the mod and field. An unchanged game delta is not revalidated. An earlier accepted veto cannot be cleared. If a listener panics or incurs a phase refusal, its edits and cancel flag are discarded; earlier results stand and later eligible listeners still run. Only a panic disables this mod's callback for the session. It takes no Host - the maintainer ruling, like the enderman's teleport: the listener only decides the delta, and itsCancel contextis the loopcontextof the side that ticks the body. The hook fires only on the server. The client predicts ordinary collider displacement for its own player, not a listener's replacement. The server remains authoritative. Beyond NeoForge: there is no counterpart.
entity_outline - Side
- client
- Contract
- listen
- Host / context
&dyn ClientHost- NeoForge
- —
- Summary
- Whether an entity the client draws has the glowing outline, and in which colour (
Entity.isCurrentlyGlowingandgetTeamColor, what Fabric's and NeoForge's glowing and team colour overrides change).outlinecomes in as vanilla's answer:Some(0xRRGGBB), the team's colour or white, when the entity glows, None when it doesn't. SetSometo make any entity glow in that colour, None to take its outline away. It changes only what this client draws: the entity'sGlowingflag, what the server and other players see, stays. Asked each frame for every mob, player (yourself in third person when you hold the camera), dropped item and projectile drawn. In the ordered body pass, these queries for mobs, players and dropped items follow level join order, interleaved with general entity renderer submissions. Projectile queries run in a later pass. General entities, the dragon and end crystals add no outline queries. API @API:entity_outline@.
entity_place - Side
- server
- Contract
- cancel
- Host / context
&mut dyn ServerHost- NeoForge
BlockEvent.EntityPlaceEvent, BlockEvent.EntityMultiPlaceEvent- Summary
BlockEvent.EntityPlaceEvent(andEntityMultiPlaceEvent, which extends it):placerset the blockstateatposagainstplaced_, before it is written.against placeris the player forBlockItem.place(before the stack shrinks), or the mob for an enderman putting its carried block down and a snow golem's trail;Noneis reserved for a placement with no entity.placementisSingle, orMultiwith every block the placement writes (a bed's foot and head, a door's halves, a tall plant), wherestateandposstay the primary block (the foot, the lower half). For players,placed_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-onlyagainst place_; a mod that stopped placements by claimingblock native_cancels here.use_ on
entity_portal - Side
- server
- Contract
- listen
- Host / context
&mut dyn ServerHost- NeoForge
- —
- Summary
- A server entity finished its portal wait and is beginning to leave
dimensionthroughpos. The destination follows the portal rules.
entity_pose_ change - Side
- server
- Contract
- listen
- Host / context
&mut dyn ServerHost- NeoForge
- —
- Summary
- A guest player's synchronized pose changed from
fromtoto.
entity_shoot_ bow - Side
- server
- Contract
- listen
- Host / context
&mut dyn ServerHost- NeoForge
- —
- Summary
- A player bow or crossbow launched an arrow with
force, after the projectile entered the level.
entity_size - Side
- both
- Contract
- collect
- Host / context
&dyn Host- NeoForge
EntityEvent.Size- Summary
- An entity's dimensions are being resolved for
pose(NeoForge'sEntityEvent.Size, fired from vanilla'sEntity.refreshDimensionsand from the entity's constructor): it is new, its pose changed topose, it grew up, itsminecraft:scalechanged, or another value its vanilla size follows changed; or as a player's pre-motion candidate (version 2, below).size(width, height and eye height, in blocks) starts as vanilla's new size andold_is the size it had. Changesize sizeand 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.hostreads the side that asks; the entity may be new, so read only what you need of it.
entity_struck_ by_ lightning - Side
- server
- Contract
- cancel
- Host / context
&mut dyn ServerHost- NeoForge
EntityStruckByLightningEvent- Summary
- A lightning bolt is about to hit
entity(NeoForge'sEntityStruckByLightningEvent, beforeEntity.thunderHit): once per bolt strike for each entity whose box meets the strike box (3 blocks around, 9 up), players included.boltis the lightning bolt. Setcancelto 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.
entity_tame - Side
- server
- Contract
- listen
- Host / context
&mut dyn ServerHost- NeoForge
- —
- Summary
- A mob became tamed after its owner and persistent state were set.
entity_teleport - Side
- server
- Contract
- listen
- Host / context
&mut dyn ServerHost- NeoForge
- —
- Summary
- A server entity was moved by a same-level teleport command, after its position changed.
entityis its network id;fromandtoare coordinates indimension. This hook reports command teleports that use Sunrise's same-level target path; it does not change vanilla's movement.
entity_tick_ listened - Side
- both
- Contract
- collect
- Host / context
HostSide- NeoForge
- —
- Summary
- Whether a mod listens to
entity_andtick_ pre entity_: a mod that hooks them hooks this one too and setstick_ post listened(HEAD,*listened = true). Without it the game tells no entity's tick, and keeps no list of them. Asked once for each family each tick, on the server and on a client (hostsays which side). Contract version 2: version 1 was asked on the server only.
entity_tick_ post - Side
- both
- Contract
- listen
- Host / context
HostSide- NeoForge
EntityTickEvent.Post- Summary
- The entities
entitiesticked in the leveldimension, andkindsholds the type of each, in the same order (NeoForge'sEntityTickEvent.Post): thoseentity_was told and did not cancel, also one that died or was removed in its tick. An entitytick_ pre entity_was told alone is told alone here too, right after its own tick; a family is told once, after its last tick. Told wheretick_ pre entity_is, on the server and on a client (tick_ pre hostsays which side). Version 3 observes additional families without changing the event signature.
entity_tick_ pre - Side
- both
- Contract
- collect
- Host / context
HostSide- NeoForge
EntityTickEvent.Pre- Summary
- The entities
entitiesare about to tick in the leveldimension, andkindsholds the type of each (minecraft:zombie,minecraft:item), in the same order (NeoForge'sEntityTickEvent.Pre, posted right before each entity's tick intickNonPassenger). Told on the server for the mobs, players, item entities, minecarts, boats, general entity rows and projectiles that tick in an entity-ticking chunk, and the entities the server keeps without simulating them (displays, markers, interactions), whose tick is only told (not a player's own boat or cart, which ticks with the player); and on a client for the mobs, other players, projectiles, tridents and displays it ticks;hostsays which side. Minecarts, boats and general rows are each told alone. Eligible types named at registration withentity_(or requested throughtick_ each entity_) are also told alone. Other observed entities are told once per family. On the server, player Pre runs before the observed parts oftick_ each_ entity ServerPlayer.tick, not the connection body'splayer_. The local client player is not yet observed here. Push an ID fromtick_ pre entitiesontocanceledto skip that entity's observed tick work and suppress its Post. IDs outside this call are ignored; repeated IDs count once. A mod using these hooks also opts in throughentity_. Removing a general entity during its own Pre skips its tick and Post and dismounts its passengers unless dismount is vetoed. An eligible former passenger can still tick as a root in this pass if it has not ticked and its join-order slot is still ahead. An already-passed slot is not revisited. Version 3 expands the version 2 coverage without changing the event signature.tick_ listened
entity_toggle_ glide - Side
- server
- Contract
- listen
- Host / context
&mut dyn ServerHost- NeoForge
- —
- Summary
- A guest's fall flying state changed on the server. The change has already been applied.
entity_travel_ to_ dimension - Side
- server
- Contract
- cancel
- Host / context
&mut dyn ServerHost- NeoForge
EntityTravelToDimensionEvent- Summary
entityis about to travel to the leveldimension(NeoForge'sEntityTravelToDimensionEvent), before anything of it moves: the entity is still where it is, in its own level.causeis why:nether_,portal end_orportal end_for a portal, orgateway teleportfor a teleport that changes level (/andtp /, a spectator's teleport to a player in another level). Setteleport cancelto keep it where it is: a portal's wait is forgotten, a teleport is dropped and/still reports success. An End gateway leads to the level the entity is already in, so itstp dimensionis the entity's own.
entity_unleash - Side
- server
- Contract
- listen
- Host / context
&mut dyn ServerHost- NeoForge
- —
- Summary
- A leashed mob's leash was removed, before any lead drop is handled (Bukkit's
EntityUnleashEvent).
exp_bottle - Side
- server
- Contract
- listen
- Host / context
&mut dyn ServerHost- NeoForge
- —
- Summary
- An experience bottle broke and its experience was awarded.
experience_orb_ can_ merge - Side
- server
- Contract
- listen
- Host / context
&mut dyn ServerHost- NeoForge
- —
- Summary
- Whether the experience orb
intotakes the orbfromin (vanilla'sExperienceOrb.canMerge): the same value, and ids a multiple of 40 apart. Asked for each pair whose boxes meet, when an orb spawns (tryMergeToExisting:fromis 0, the new orb isn't an entity yet, and onlyfrom_is known) and every 20 ticks as an orb scans for neighbours (value scanForMerges).can_holds vanilla's answer; change it either way. A merged orb counts asmerge countorbs ofinto's value, so forcing orbs of different values together drops points unless the mod raisesinto's value withnative_inset_ experience_ orb experience_. Server-side.orb_ merge
experience_orb_ merge - Side
- server
- Contract
- cancel
- Host / context
&mut dyn ServerHost- NeoForge
- —
- Summary
- The experience orb
into(into_points,value into_orbs) is about to takecount from(from_points,value from_orbs) in, aftercount experience_said yes (orb_ can_ merge fromis 0 andfrom_1 for a new orb that is spawning). Setcount canceledto stop it: both orbs stay, and a spawning orb tries the next orb in reach, then spawns on its own. Left alone,intoaddsfrom's count, as vanilla does. A mod that writesinto's value or count withset_here makes that write the merged orb:experience_ orb fromis taken in without adding its count, sointo_pays 11 once. The merge is refused, andvalue = 11, into_ count = 1 intoput back as it was (value, count and age), whenfromhas changed or left reach by the time the merge applies. A merge whose count would passi32::(what a save holds) is refused the same way. A write the listener made toMAX fromitself is not undone. Server-side.
explosion_detonate - Side
- server
- Contract
- collect
- Host / context
&mut dyn ServerHost- NeoForge
ExplosionEvent.Detonate- Summary
- An explosion at
centerindimension(minecraft:overworld) is about to breakblocksand reachentities:ServerExplosion.explodewith itstoBlow, before any block or entity is hit. Take out the positions to spare; they keep their block and get no fire.entitiesisgetEntities(source, box): every entity in the box the centre ± (2 × radius + 1), in walk order, without the exploding source, those that will ignore the blast included — the entity-list walk, then the item frames, paintings, cushions and end crystals it misses. Take one out and it is neither hurt nor pushed, andexplosion_is not asked for it; one a mod adds is walked as any other, and the list the listeners leave controls membership, subject to the usual distance, exposure and per-kind immunity checks. Order controls the ordinary-storage walk only, not global effect order: crystals/dragon and players run in separate earlier passes, and decorations run last in storage order. Block positions are shuffled before destruction, so their list order is not destruction order either. Server-side.knockback
explosion_knockback - Side
- server
- Contract
- collect
- Host / context
&mut dyn ServerHost- NeoForge
ExplosionKnockbackEvent- Summary
- An explosion at
centerindimension, about to breakblocks, pushesentity(None for a player, whomhost.players().acting_names):player() ServerExplosion.hurtEntities, after the knockback is calculated. Changeknockback_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: Sunrise removes them without a velocity to change. Server-side.velocity
explosion_prime - Side
- server
- Contract
- listen
- Host / context
&mut dyn ServerHost- NeoForge
- —
- Summary
- A server explosion is about to begin at
center, withradius(Bukkit'sExplosionPrimeEvent). This is listen-only: the explosion proceeds as usual. Server-side, including the single-player server.
explosion_start - Side
- server
- Contract
- cancel
- Host / context
&mut dyn ServerHost- NeoForge
ExplosionEvent.Start- Summary
- A server explosion is about to happen (
ExplosionEvent.Start, inServerLevel.explodebeforeServerExplosion.explode): every one, TNT, creepers, beds and anchors, fireballs, withers, end crystals and wind bursts. Setcanceland nothing of it happens: no blocks, no damage or knockback, no sound, particles or game event. Beforeexplosion_, which a cancel skips. Server-side.prime
extend_poi_ types - Side
- server
- Contract
- listen
- Host / context
&RegistrationContext- NeoForge
ExtendPoiTypesEvent- Summary
- Add block states to an existing POI type (NeoForge
ExtendPoiTypesEvent): a mod's bed tominecraft:home, its workstation tominecraft: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 onevent.extensions.metadata()and hand it toevent.extensions.extend(poi_; 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. A callback that panics or incurs a phase refusal contributes no predicates.type, states)
extract_block_ screen_ effect - Side
- client
- Contract
- cancel
- Host / context
&dyn ClientHost- NeoForge
ExtractBlockScreenEffectEvent- Summary
- Before an overlay from
ScreenEffectRendereris drawn, once a frame per eligible overlay:Blockwith the view-blockingstateatposthe camera is inside,Waterwith water's defaultstateat the eye's blockpos, andFirewith fire's defaultstateat the player's blockpos. Never for a spectator;WaterandFireonly in first person. Water eligibility comes from the player's eye fluid, sampled through death tick 20. While the death screen stays open after removal, extraction keeps that last sample.camera_can still override it at the eye. Cancel to leave the vanilla overlay out, except that a selected fire renderer still decides whether its vanilla quads follow it. Usesubmersion ExtractBlockScreenEffectEvent::to prepend or replace the quads. A failed listener leaves the previous choice and cancellation intact so later eligible listeners still run. A panic disables that mod's listener for the session and is reported in the log and the client error toast.set_ custom_ renderer partial_is world interpolation;tick player_is local-player interpolation, which continues when the level is frozen. Client-side.partial_ tick
farmland_trample - Side
- server
- Contract
- cancel
- Host / context
&mut dyn ServerHost- NeoForge
BlockEvent.FarmlandTrampleEvent- Summary
- A player or mob that fell onto farmland is about to turn it to its base block (
BlockEvent.FarmlandTrampleEvent, fromFarmlandBlock.fallOn).entityis the landing living entity: read its pose, sneak state and type through the handle. It fires after vanilla's own chance and checks (the draw, the mob-griefing rule or spawn protection, and the size test), so a listener only ever sees a trample that was going to happen. Cancel and the farmland and its crop stay as they are; the entity takes its fall damage either way.
fill_bucket - Side
- server
- Contract
- cancel
- Host / context
&mut dyn ServerHost- NeoForge
- —
- Summary
- A player fills (
stackan empty bucket) or empties a bucket atpos:BucketItem.use, where it asksLevel.mayInteract. Setcanceledand the bucket does nothing. Server-side, for every player of the world (host.players().acting_says who).player()
finalize_spawn - Side
- server
- Contract
- cancel
- Host / context
&dyn Host- NeoForge
FinalizeSpawnEvent- Summary
- NeoForge's
FinalizeSpawnEvent: the new mob of typekindis atposandMob.finalizeSpawn(equipment, attributes, variants, the class's own setup) is about to run forreason.spawneris the spawner block for a spawner or trial spawner spawn, none otherwise (a minecart spawner too).difficultyis the local difficulty finalization reads: change it to change what the mob gets. There are two cancels. ReturnFlow::to skip finalization: no finalizeSpawn runs, and the mob still spawns uninitialised (no equipment, attributes or class setup). SetCancel spawn_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 callscancelled finalizeSpawnon a mob the game makes, with vanilla'sreasonat that call: natural spawning, chunk generation's animals, spawners, trial spawners, patrols, raids and sieges, zombie reinforcements, a cat spawner's cat, phantoms, jockeys,/andsummon /, spawn eggs and dispensers, the nether portal's piglin (raid Structure), a skeleton trap's horse and riders, an evoker's vexes and wandering traders. A conversion fires withConversion, and a cancel there leaves the converted mob as it is. Not fired where vanilla creates the mob withoutfinalizeSpawn: 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.mobis the mob itself, not yet in a level: read it through the host (mob.kind(host),mob.equipment(host, slot),mob.attribute_) and change it throughbase(host, id) edits(edits.set_,equipment(mob, slot, item) edits.set_, tags and the custom name); the handle and the editor reach only this mob, and after the hook returns the handle answersattribute_ base(mob, id, base) 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::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.Cancel groupis the pack's spawn group data (SpawnGroupData,SpawnGroup): what the listener leaves there is what finalization reads for this mob. Every site this hook fires at hands itNone: the game threads no group data through a live pack; chunk generation's animals share it only inside the generator, out of the hook's reach. The host is the read-only one, andeditschanges nothing but this mob: listeners run on replayed ticks, so they must be pure functions of their inputs and edit onlymobandgroup. Server-side.
firework_explode - Side
- server
- Contract
- listen
- Host / context
&mut dyn ServerHost- NeoForge
- —
- Summary
- A firework rocket completed its explosion effects.
fishing_medium - Side
- both
- Contract
- replace
- Host / context
HostSide- NeoForge
- —
- Summary
- A fishing bobber
bobberatpositioninlevelis flying or floating outside water (FishingHook.tick's fluid test found none), and a mod may say it floats and fishes in a medium there: lava, the void under an island, a cloud.owneris the player who cast it andowner_where they stand (their feet); a client may know neither for another player's bobber. Answer aposition FishingMediumto make the spot a medium, or None to leave vanilla's (the bobber falls). The first mod to answer, in dependency order, wins.
flip_frame - Side
- client
- Contract
- listen
- Host / context
&mut dyn ClientHost- NeoForge
FlipFrameEvent- Summary
- Once for each frame presented, in a world or not, after that frame's
render_(NeoForge'sframe_ post FlipFrameEvent): the place to rotate per-frame GPU data. Not cancellable. A frame that was not presented does not fire it. Client-side.
fluid_flow - Side
- both
- Contract
- listen
- Host / context
&dyn LoopContext- NeoForge
- —
- Summary
- 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.fluidis the fluid's id (minecraft:water,minecraft:flowing_...); a mod may changelava 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 loopcontextof 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.
fluid_level_ change - Side
- server
- Contract
- cancel
- Host / context
&dyn LevelHost- NeoForge
- —
- Summary
- A flowing fluid at
posis about to change level.fluidiswaterorlava; the levels are 0 through 8. Setcancelto keep the old level. Server-side.
fluid_place_ block - Side
- server
- Contract
- cancel
- Host / context
&dyn LevelHost- NeoForge
BlockEvent.FluidPlaceBlockEvent- Summary
- Liquid at
liquid_is about to placepos stateatpos. Setcancelto prevent placement or changenew_to replace it. Server-side.state
fluid_tick - Side
- server
- Contract
- cancel
- Host / context
&dyn LevelHost- NeoForge
- —
- Summary
- The fluid at
posis about to run its scheduled tick (FlowingFluid.tick).fluidiswater,lavaor a mod fluid's id. Setcanceland the tick does nothing at all: no level change, no spreading and no new tick. For a mod that simulates a fluid itself;fluid_andlevel_ change block_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.spread
fluid_tooltip - Side
- client
- Contract
- listen
- Host / context
&dyn ClientHost- NeoForge
FluidTooltipEvent- Summary
FluidTooltipEvent: the tooltip ofstack, 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 inlines, each with a colour asrgbapacks it (u32::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 noMAX item_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.tooltip
food_level_ changed - Side
- server
- Contract
- cancel
- Host / context
&mut dyn ServerHost- NeoForge
- —
- Summary
- The food level of the server player
player(name) is about to change fromfromtoto(Bukkit'sFoodLevelChangeEvent): eating, hunger and saturation effects, the exhaustion that costs a point, starving. Changeto(kept between 0 and 20; saturation never exceeds it) or setcancelto leave the level atfrom, 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, sohost.players().acting_,player() PlayerRef::and the item helpers reach them. On a server.tell
framerate_limit - Side
- client
- Contract
- listen
- Host / context
&dyn ClientHost- NeoForge
- —
- Summary
- The frame rate this window is about to be held to: Max Framerate after the inactivity throttle and Battery Mode (260 is unlimited).
focusedis whether the window has focus,minimizedwhether it is minimised andin_whether a world is open. A mod may lowerworld limit, as Dynamic FPS does for a window in the background: Sunrise keeps the lower of its own limit and the mod's, and ignores values below 1.
furnace_burn - Side
- server
- Contract
- listen
- Host / context
&mut dyn ServerHost- NeoForge
- —
- Summary
- A furnace at
posconsumed fuel and began or resumed burning it.fuelis the item consumed from its fuel slot. Server-side.
furnace_extract - Side
- server
- Contract
- listen
- Host / context
&mut dyn ServerHost- NeoForge
- —
- Summary
- A server player took an output from a furnace at
pos;itemis the output item id andcountis how many were taken. The player's state is not swapped in.
furnace_smelt - Side
- server
- Contract
- listen
- Host / context
&mut dyn ServerHost- NeoForge
- —
- Summary
- A furnace finished smelting
itemintoresultatpos. Server-side.
furnace_start_ smelt - Side
- server
- Contract
- listen
- Host / context
&mut dyn ServerHost- NeoForge
- —
- Summary
- A furnace at
posbegan cookingitem(its cooking timer advanced from zero). Server-side.
game_rule_ changed - Side
- server
- Contract
- listen
- Host / context
&mut dyn ServerHost- NeoForge
GameRuleChangedEvent- Summary
- A server game rule
rule(minecraft:keep_) was set toinventory value(GameRuleChangedEvent, fromGameRules.setwith a server:/, the game rules screen, the management protocol, a test environment,gamerule server.properties).actoris present when a player caused the change.level.game_of any of the server's levels reads every rule, the new value included. Server-side.rules(host)
game_shutting_ down - Side
- both
- Contract
- listen
- Host / context
HostSide- NeoForge
GameShuttingDownEvent- Summary
- 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.
gather_effect_ screen_ tooltips - Side
- client
- Contract
- listen
- Host / context
&dyn ClientHost- NeoForge
GatherEffectScreenTooltipsEvent- Summary
GatherEffectScreenTooltipsEvent: the tooltip of the effect panel the cursor is over beside the survival or creative inventory.tooltipstarts 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 asrgbapacks it (u32::keeps the text's own); add, change, reorder or remove lines, and an empty list draws nothing.MAX effectis the effect the panel shows,screenthe inventory. Asked each frame a rendered panel is hovered, only while a mod listens. Client-side.
gather_skipped_ attribute_ tooltips - Side
- client
- Contract
- listen
- Host / context
&dyn ClientHost- NeoForge
GatherSkippedAttributeTooltipsEvent- Summary
GatherSkippedAttributeTooltipsEvent: the attribute modifiers a stack's tooltip leaves out (ItemStack.addAttributeTooltips), asked once before its attribute lines are built. Setskip_to hide every one, push modifier ids (all minecraft:base_, a bare name isattack_ damage minecraft:'s) toskipped_, orids EquipmentSlotGroupnames (mainhand,armor,any) toskipped_; a slot group with nothing left shows no heading. Display and resource-query builds skip it whengroups minecraft:tooltip_hides the attribute modifiers or the entire tooltip.display playerandplayer_are the local player's, orentity_ id Nonefor recipe book search and a stack nested in another's tooltip (a crossbow's loaded projectile).advanced(F3+H) andcreativeare the tooltip'sTooltipFlag. Asked when lines are built for display, recipe book search orItemResource::, except during reentrant line queries. Client-side, only while a mod listens.tooltip
get_arm_ pose - Side
- client
- Contract
- replace
- Host / context
&dyn ClientHost- NeoForge
IClientItemExtensions.getArmPose- Summary
- NeoForge's
IClientItemExtensions.getArmPose: the pose of the arm that holdsstackinhand, as a humanoid model draws it (local and remote players and humanoid mobs).humanoidborrows both held stacks, the main arm, use state and selected poses before listeners answer; item declarations are included in those poses. Setposeto 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 ownarm_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 (pose bow_,and_ arrow crossbow_,hold crossbow_) still poses the other hand as vanilla's does. Vanilla'scharge spearpose poses an arm only for an item with a kinetic weapon. Register a custom pose withArmPosesRegistrar, returnArmPose::here, and write its angles inCustom arm_. Unknown registration slots are ignored. Mob-specific animations still run after the humanoid base pose, as in vanilla. Client-side, with apose_ transform ClientHost.
get_enchantment_ level - Side
- both
- Contract
- listen
- Host / context
- —
- NeoForge
GetEnchantmentLevelEvent- Summary
GetEnchantmentLevelEvent: the enchantments gameplay sees onstack, starting from its ownminecraft:enchantments.targetis the one enchantment a read asks for (ItemStack.getEnchantmentLevel), and then only its level counts;Nonewhen every one is read (ItemStack.getAllEnchantments). Set, upgrade or remove levels inenchantments: 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). A client without this mod keeps its vanilla tooltip; server gameplay uses the modded levels.
get_equipment_ drop_ chance - Side
- server
- Contract
- listen
- Host / context
&mut dyn ServerHost- NeoForge
GetEquipmentDropChanceEvent- Summary
- A dying mob
entityofkindis about to roll its drop chance for the itemstackinslot(Mob.dropCustomDeathLoot, NeoForge'sGetEquipmentDropChanceEvent).original_ischance DropChances.byEquipment;chancestarts as the chance after the enchantments of the attacker and the victim (getOriginalChanceandgetDropChance); changechance(1.0 or more always drops, 0 or less never does).preservedisDropChances.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, inEquipmentSlotorder. The roll is drawn whatever the chance is, so the mob's random follows vanilla's order.sourceandrecently_are as inhit native_. Server-side.living_ drops
grindstone_place - Side
- server
- Contract
- cancel
- Host / context
&mut dyn ServerHost- NeoForge
GrindstoneEvent.OnPlaceItem- Summary
- A grindstone at
posmade its result after its inputs changed, for the server playerplayer(UUID) andplayer_(entity_ id GrindstoneEvent.OnPlaceItem, matching NeoForgeCommonHooks.onGrindstoneChangeinGrindstoneMenu.createResult), including the three input notifications of an accepted take:inputslends the input stacks and vanilla result. Runs inline without a decided-action transaction or rollback on cancel. Cancellation is checked before convertingedits.outputand clears slot 2 without rolling back listener writes. Otherwise leaveedits.outputatNoneto keep vanilla's result and experience, or set a replacement stack and itsedits.xp(any negative value falls through to vanilla's experience roll; nonnegative values set the award). An invalid replacement stack is logged and ignored, keeping vanilla's result. A panicking listener is caught and leaves vanilla's result. Server-side.
grindstone_take - Side
- server
- Contract
- cancel
- Host / context
&mut dyn ServerHost- NeoForge
GrindstoneEvent.OnTakeItem- Summary
- The server player
player(UUID) andplayer_took a grindstone's result atentity_ id pos(GrindstoneEvent.OnTakeItem, matching NeoForgeCommonHooks.onGrindstoneTakeinGrindstoneMenu.java.patch):inputslends the pre-take stacks. Runs inline after the click has taken the result, without a decided-action transaction or click rollback.edits.xpstarts at the resolved experience (>= 0, fromgrindstone_or vanilla's pre-rolled award); non-positive values (place <= 0) spawn 0 orbs while still firing level event 1042 and replacing the inputs. Replacing each slot and finally notifying the input container each rungrindstone_. This completes before the click drops its taken stack or checks for another result. Useplace edits.new_andtop edits.new_to leave items in the input slots (invalid stacks are logged and ignored as empty slots). Setbottom cancelledto skip experience, level event 1042 and input replacement; cancel is checked before converting remainders and does not undo the click or listener writes. A panicking listener is caught and completes the take with the initial experience and cleared inputs. Server-side.
gui_layer_ post - Side
- client
- Contract
- listen
- Host / context
&dyn ClientHost- NeoForge
RenderGuiLayerEvent.Post- Summary
- After the complete body of a vanilla or mod HUD layer (
RenderGuiLayerEvent.Post). Fires once with the ID fromgui_, even if F1 or another condition hid the vanilla drawing, or if a wrapper omitted its previous body. Does not fire whenlayer_ pre gui_cancels the layer. If the body schedules deferred subtitle paint, Post still fires in the HUD walk, not when that paint runs. Uselayer_ pre event.drawto paint after the body, orgui_for a foreground pass independent of any layer.render_ post
gui_layer_ pre - Side
- client
- Contract
- cancel
- Host / context
&dyn ClientHost- NeoForge
RenderGuiLayerEvent.Pre- Summary
- Before a vanilla or mod HUD layer (
RenderGuiLayerEvent.Pre). Draw below the layer throughevent.draw, or returnFlow::to skip its entire body, including side effects like the air-bubble sound, andCancel gui_. Fires even when the layer's vanilla drawing is hidden. A wrapped or replaced layer fires this once, with the slot's original ID. To change a layer's body rather than veto the whole slot, wrap or replace it at startup inlayer_ post register_.gui_ layers
gui_render_ post - Side
- client
- Contract
- listen
- Host / context
&dyn ClientHost- NeoForge
RenderGuiEvent.Post- Summary
- 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_is this frame's world camera (None on the panorama).camera gui_is the F1 setting;hidden focusedis window focus. A mod decides whether its foreground indicator respects those flags. Client only; the host is read-only. A panicking listener's drawing is discarded. API @API:gui_render_post@.
hanging_break - Side
- server
- Contract
- cancel
- Host / context
&mut dyn ServerHost- NeoForge
- —
- Summary
- An item frame (
minecraft:item_,frame minecraft:glow_) or a painting (item_ frame minecraft:painting),kindits entity type andposthe block it hangs in, is about to break: a server player's hit (player, their state swapped in, soPlayerRef::answers them), a blast, or the wall it hangs on gone (tell playerNone for both). WhereBlockAttachedEntity.hurtServerand its survival check would kill it, before anything drops or sounds. Setcanceland 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/. The listener may change the world: straight after it returns without cancelling, the game finds the frame or painting again by its entity id; if it is gone, or an empty frame being broken now holds an item, nothing breaks and nothing is removed.kill
hanging_place - Side
- server
- Contract
- cancel
- Host / context
&mut dyn ServerHost- NeoForge
- —
- Summary
- A server player places a hanging entity: an item frame (
minecraft:item_,frame minecraft:glow_), a painting (item_ frame minecraft:painting) or a leash knot (minecraft:leash_, when a lead is tied to a fence that has none yet),knot kindits entity type andposthe block it takes (the fence's for a knot). WhereHangingEntityItem.useOnandLeadItem.useOncreate it, once it is known to fit and before anything is placed or used up. Setcanceland nothing is placed: the item stays in the player's hand. The player's state is swapped in, soPlayerRef::answers them. Only for guests of a server;tell /, a dispenser and the game's own player are not heard, nor is a lead tied to a mob or a boat.summon
hears_projectile_ impacts - Side
- server
- Contract
- collect
- Host / context
&dyn Host- NeoForge
- —
- Summary
- Whether a mod hears projectiles' impacts (
native_): setprojectile_ impact 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.
hopper_inventory_ search - Side
- server
- Contract
- listen
- Host / context
&mut dyn ServerHost- NeoForge
- —
- Summary
- A hopper selected a container while searching for items to push or pull. Exactly one of
containerandentityidentifies the target.
hopper_pickup_ item - Side
- server
- Contract
- cancel
- Host / context
&dyn LevelHost- NeoForge
- —
- Summary
- A hopper at
posis about to pick upcountofitem. Setcancelto leave the dropped stack in the world. Server-side.
hotbar_attack_ indicator_ progress - Side
- client
- Contract
- listen
- Host / context
&dyn ClientHost- NeoForge
- —
- Summary
- Edit the stock hotbar's attack indicator for this draw only (
Hud.extractItemHotbar). After item extraction,event.progressstarts at the local player's attack strength at partial tick zero, even if the camera follows another player. This runs at full charge too:1.0hides the indicator, while a lower value makes it visible.
humanoid_setup_ anim - Side
- client
- Contract
- listen
- Host / context
&dyn ClientHost- NeoForge
- —
- Summary
- Once per actual
HumanoidModel.setupAniminvocation, after head/walk/riding setup and before arm priority/posing.event.partslends the livecrate::for this callback, not a snapshot to replace or keep.HumanoidPose getreads a present base part's local position and rotation;set_andposition set_write all three components immediately on any present base part, matchingrotation HumanoidModel.setupAnimwith no finiteness gate. Later listeners see edits from earlier ones. Later vanilla ITEM, attack, crouch, bob and swim animation still apply. Armor stands then replace rotations with their saved pose, preserving position edits.humanoidcontains this invocation's held stacks and use state. Time is captured for its view;game_is absent outside a level, never wall time. The Host is read-only. No frame deduplication: layers that actually animate again get another invocation; copying parent poses does not dispatch.time
ingredient- Side
- both
- Contract
- replace
- Host / context
&dyn DataLoadContext- NeoForge
ICustomIngredient- Summary
- Define one occurrence of a custom ingredient named by a non-
minecraft:recipe entry. ReturnNonefor a kind you do not handle, or anIngredientDefinitionwith the ordered candidate IDs and a predicate that can capture the parsed metadata. The first enabled mod to answer, in dispatch order, owns the predicate. ReturningNonelets the next listener answer. If nobody answers, the recipe is refused with its file and kind.
input_key - Side
- client
- Contract
- listen
- Host / context
&mut dyn ClientHost- NeoForge
InputEvent.Key- Summary
- A key event after handling, the window's or the control socket's
key(one press, then one release for a tap), including repeats and consumed shortcuts (InputEvent.Key).keyis vanilla's name for the physical key (key.keyboard.a,key.keyboard.unknownfor one it doesn't name;getKey),layout_its name for the key the keyboard layout produced (key getKeycode: AZERTY's key at QWERTY's W giveskey.keyboard.z; a named key such as Enter keeps the physical name;Nonefor a character other than one ASCII letter or digit, a dead key's accent included since it arrives as its character, and for a key vanilla doesn't name) andraw_a code telling physical keys apart, named or not (code getScanCode: the platform scan code, stable within a platform only).actionis what it did, and the modifier bits the screen hooks' GLFW encoding. Not cancellable.
interaction_key_ mapping_ triggered - Side
- client
- Contract
- cancel
- Host / context
&mut dyn ClientHost- NeoForge
InputEvent.InteractionKeyMappingTriggered- Summary
- An interaction mapping is about to act on the tick's crosshair target.
attemptdistinguishes a queued press from held use or mining. Use asks for each hand tried, main first. Cancelling the main hand ends the click. Attack and use honourswing_independently: it governs only the acting player's own screen. False suppresses natural local swings; true preserves natural no-swing outcomes. A cancelled use with true requests a local swing only: neither a use packet nor a swing packet is sent, so observers see no swing. An uncancelled use sends no extra client swing packet: observers see the server's success swing, regardless of this flag. Attack and mining swing packets also honour the item swing veto. Pick only vetoes its packet and never swings. Fires on the window client.hand
inventory_block_ start - Side
- server
- Contract
- cancel
- Host / context
&mut dyn ServerHost- NeoForge
- —
- Summary
- A server player is about to open an inventory supplied by a block at
pos. Setcancelto leave the inventory closed. The player's state is not swapped in.
inventory_move_ item - Side
- server
- Contract
- cancel
- Host / context
&dyn Host- NeoForge
- —
- Summary
- A hopper is about to move one item between containers, a composter's bone meal included. Set
cancelto leave it in its source slot. A chest boat or minecart is reported at the block it is in.
item_attribute_ modifier - Side
- both
- Contract
- listen
- Host / context
- —
- NeoForge
ItemAttributeModifierEvent- Summary
ItemAttributeModifierEvent: the attribute modifiersstackgrants (ItemStack.getAttributeModifiers), starting from its ownminecraft:attribute_or its item's. Add, replace or remove entries inmodifiers 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). A client without this mod keeps vanilla modifiers in its tooltips; the server applies the mod's answer to attribute sync.
item_consumption_ teleport - Side
- server
- Contract
- cancel
- Host / context
&mut dyn ServerHost- NeoForge
EntityTeleportEvent.ItemConsumption- Summary
- A server player or fox that ate chorus fruit (or another item with the
teleport_consume effect) is about to try a random spot (NeoForge'srandomly EntityTeleportEvent.ItemConsumption, vanilla'sTeleportRandomlyConsumeEffect.apply): once per attempt (up to 16), after they stopped riding.fromis their feet,targetthe 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.consumernames the living actor through its handle.consumedis 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_). 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. A consumed stack the API can't carry (a saved item whose id isn't registered) isn't heard: the listeners aren't called for that consumption and the teleport goes on as vanilla's.player()
item_crafted - Side
- server
- Contract
- listen
- Host / context
&mut dyn ServerHost- NeoForge
PlayerEvent.ItemCraftedEvent- Summary
- A player took a crafting grid's result (
ResultSlot.onTake, NeoForge'sPlayerEvent.ItemCraftedEvent):playeris the player's uuid,recipethe recipe the grid matched (minecraft:oak_) andplanks stackthe result it took, with its components.inputsis the grid row by row as it was before this take used it (4 cells for an inventory's grid, 9 for a crafting table's;Nonefor an empty cell): a shift-click that crafts several times is heard once per craft, each with the grid before that craft. 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.
item_despawn - Side
- server
- Contract
- listen
- Host / context
&mut dyn ServerHost- NeoForge
- —
- Summary
- A dropped item entity reached its 6000-tick lifetime and is about to be removed (Bukkit's
ItemDespawnEvent).
item_expire - Side
- server
- Contract
- listen
- Host / context
&mut dyn ServerHost- NeoForge
ItemExpireEvent- Summary
- A dropped item reaches its lifetime on the server (
ItemEntity.tick, NeoForge'sItemExpireEvent). Every mod may set or add toextra_, 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.life
item_fished - Side
- server
- Contract
- collect
- Host / context
&mut dyn ServerHost- NeoForge
ItemFishedEvent- Summary
- A server player
player(UUID) andplayer_reels in a catch:entity_ id ItemFishedEventinFishingHook.retrieve, after fishing loot and its modifiers roll.fishedholds the bobber's id and position; listeners may changedropsand set absolute non-negativerod_(damage damageRodBy): vanilla uses 1, or 2 with the bobber on the ground. Afterplayer_'s reel-in, before rewards. Server-side. The final list reachesfish fishing_, then each stack spawns its item, one experience orb, and its fish statistic if it belongs torod_ hooked #minecraft:fishes. Empty stacks are removed. A cancel removes the bobber and skips the trigger, items, experience and statistic; the rod still takesrod_last. An emptied list without cancel gives no items, experience or statistic; the trigger still fires with an empty list and the rod is still damaged. An invaliddamage dropswrite (a stack the game refuses, such as a count over the item's maximum) discards the whole event's write-back, every listener'scancelandrod_included, and logs a warning naming the hook and the conversion error. Diverges: Sunrise lets a listener change the drop list itself; the reference lets a listener change the stacks but not the list.damage
item_model_ property - Side
- client
- Contract
- listen
- Host / context
&dyn ClientHost- NeoForge
RegisterConditionalItemModelPropertyEvent- Summary
- 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_is the runtime bundle selection index; -1 means none.selected
item_picked_ up - Side
- server
- Contract
- listen
- Host / context
&mut dyn ServerHost- NeoForge
ItemEntityPickupEvent.Pre- Summary
playertouches the ground item entityitem(ItemEntity.playerTouch), before its pickup delay and target are checked: it is asked on every tick the two touch, even while the item can't be taken. Leavecan_atpickup Defaultfor vanilla's rule, setTrueto take it despite its delay or another player's target (a full inventory still leaves it), orFalseto leave it there: the fork sets a vanilla eligibility delay of at least 10 ticks. The hook still runs on each touch, and a laterTrueoverrides that delay. The last mod to set it decides. The handle reads the whole stack on the ground; for the window's own player of a world it ticks itself, whose pickup pass lifts the items out of the level, it reads as unavailable. Server-side.
item_picked_ up_ post - Side
- server
- Contract
- listen
- Host / context
&mut dyn ServerHost- NeoForge
ItemEntityPickupEvent.Post- Summary
playerpicked up all or part of the stack of the ground item entityitem(ItemEntity.playerTouch, right afterInventory.addtook some of it), the entityitem_named.picked_ up originalis a copy of the stack as it lay before the pickup: changing it does nothing.remainingis what the item entity still holds:None(empty) after a whole pickup, the part that did not fit after a partial one. Set a stack there to leave the entity holding it, orNoneto empty it: the pickup then countsoriginal's count less what is left. The amount taken isoriginal's count lessremaining's. A mod that removes the item entity meanwhile keeps it removed: no take animation, the stat and criteria still run. Not called whenitem_refused the pickup or the inventory took nothing; a forcedpicked_ up Truefromitem_changes none of this. A creative player always takes the whole stack. Server-side.picked_ up
item_smelted - Side
- server
- Contract
- listen
- Host / context
&mut dyn ServerHost- NeoForge
PlayerEvent.ItemSmeltedEvent- Summary
FurnaceResultSlot.checkTakeAchievementsran for a server player at a furnace, blast furnace or smoker's result slot:playeris their UUID andplayer_their network id;entity_ id stackandamount_are what vanilla passes there (removed 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 (Noneonce it is empty) with 0; a hotbar swap passes the taken stack with 0. Fires beforefurnace_. Server-side.extract
item_spawn - Side
- server
- Contract
- listen
- Host / context
&mut dyn ServerHost- NeoForge
- —
- Summary
- A dropped item entity was successfully added to the server level.
item_stacked_ on_ other - Side
- both
- Contract
- cancel
- Host / context
HostSide- NeoForge
ItemStackedOnOtherEvent- Summary
- NeoForge's
ItemStackedOnOtherEventand vanilla'sItem.overrideStackedOnOther/Item.overrideOtherStackedOnMe, fired inside a resolved pickup click (a direct left/rightPickupwhen no drag is active, or a one-slot left/rightQuickCraftdrag release; never on multi-slot or middle-button drags, active-drag resets, or creative catalogue slots), with the cursor and both stacks frozen inevent.
item_tooltip - Side
- client
- Contract
- listen
- Host / context
&dyn ClientHost- NeoForge
ItemTooltipEvent- Summary
ItemTooltipEvent: the whole tooltip ofstack(ItemStack.getTooltipLines), once its name, the item's own lines, the components' lines, the advanced lines and the operator warning are inlines, each with a colour asrgbapacks it (u32::keeps the text's own). Add, change, reorder or remove lines.MAX playerandplayer_are the local player's,entity_ id stackborrows the stack lazily (ItemStackView::copies components on demand),project displayborrows the stack'sminecraft:tooltip_,display advanced(F3+H) andcreative(a creative tab's own slot) are itsTooltipFlag, andlinesmutates the live tooltip directly with per-editTextFormErrorvalidation so one invalid edit leaves all other lines intact. Asked when item tooltip lines are built, for the game's display orItemResource::. Never asked for a hidden tooltip, a crossbow's loaded projectile or a query made during item tooltip line construction. Queries outside line construction can dispatch this event, but never gather images or draw. Client-side. This global event is distinct fromtooltip ItemPart::, which runs at the earliertooltip Item.appendHoverTextposition, 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. Replacements are used in memory; they are not subject to serialized component limits.
item_toss - Side
- server
- Contract
- cancel
- Host / context
&mut dyn ServerHost- NeoForge
ItemTossEvent- Summary
ItemTossEvent:playertosses the item entityitem(Player.drop: the drop key, a menu's throw, what no longer fits in the inventory), not what scatters when they die. The entity is made, with its thrower, but has not joined the level yet: its handle reads and changes the whole stack, the pickup delay and the target, and those changes stay. Setcanceledand it never joins the level; 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-onlyitem_, which fired for the drop key and menu throws only.dropped
items- Side
- both
- Contract
- collect
- Host / context
&RegistrationContext- NeoForge
RegisterEvent- Summary
- Declare items in code once at startup on each side, before resources load. Pass each
mod_toapi:: Item event.register. The declaration belongs to the submitting package — in its own namespaces or in a content package it serves (served_) — and works likeby data/in a content mod. A block's item is declared with its block, not here.<id>/ sunrise/ item/ <path>.json crafting_may reference items across the host and its served packages; duplicates across layers and declarations into aremainder side = "server"package's namespace are refused.registerreturns a typedDeclarationErrorfor invalid IDs or fields. The game records the refusal and stops startup even if a returning listener ignores it. A panic discards this listener's declarations and diagnostics without rejecting startup.
key_mapping_ pre - Side
- client
- Contract
- cancel
- Host / context
&mut dyn ClientHost- NeoForge
InputEvent.InteractionKeyMappingTriggered, InputEvent.Key- Summary
- 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.pressedis 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, nor for a mod'scrate::orVanillaKeyMappingRef:: set_ down crate::, which do not change physical input. No NeoForge counterpart. Client-side.VanillaKeyMappingRef:: click
leaves_decay - Side
- server
- Contract
- cancel
- Host / context
&dyn LevelHost- NeoForge
- —
- Summary
- A non-persistent leaf block at distance 7 is about to decay at
pos. Setcancelto keep it. Server-side.
left_click_ block - Side
- server
- Contract
- cancel
- Host / context
&mut dyn ServerHost- NeoForge
PlayerInteractEvent.LeftClickBlock- Summary
- A player left-clicks the block
stateatpos,facethe face hit ([0, 1, 0]is the top): whereServerPlayerGameMode.handleBlockBreakActiontakes a dig's start, after its reach, spawn protection and world border checks, beforeBlock.attack(a note block plays) or a creative break. Setcanceledto 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).
left_click_ empty - Side
- client
- Contract
- listen
- Host / context
&mut dyn ClientHost- NeoForge
PlayerInteractEvent.LeftClickEmpty- Summary
- The local player left-clicks empty space, with any main-hand stack. Client-side only; the server does not receive this event.
level_load - Side
- server
- Contract
- listen
- Host / context
&mut dyn ServerHost- NeoForge
LevelEvent.Load- Summary
dimension's level opened on the server (NeoForge'sLevelEvent.Load, posted inMinecraftServer.createLevels): before any of its chunks (chunk_), so a mod sets up what it keeps for the level here. Beforeload server_, this fires in Overworld, Nether, End order, with the level in place, regardless of the saved player's dimension. The next built-in is not available until after the current notification. Built-in levels stay open until server shutdown; custom levels that close while idle fire this again when they reopen. Explicitly opened runtime levels can fire this while parked:started event.dimensionnames the opened level, not the Host's current level. Server-side.
level_save - Side
- server
- Contract
- listen
- Host / context
&mut dyn ServerHost- NeoForge
LevelEvent.Save- Summary
- The end of
dimension's level save pass (NeoForge'sLevelEvent.SaveinServerLevel.save), for autosave,/, pause and shutdown. Individual record failures are reported and do not suppress this hook; a failed awaited storage flush does. Server-side.save-all
level_tick_ post - Side
- both
- Contract
- listen
- Host / context
HostSide- NeoForge
LevelTickEvent.Post- Summary
- After a successful level tick pass on either logical side; never after a failed tick.
host.server_says whether optional work still fits in the tick (has_ time() LevelTickEvent.hasTime); always true on a client.
level_tick_ pre - Side
- both
- Contract
- listen
- Host / context
HostSide- NeoForge
LevelTickEvent.Pre- Summary
- Before a level's tick pass on either logical side.
levelidentifies the level.host.server_says whether optional work still fits in the tick (has_ time() LevelTickEvent.hasTime); always true on a client.
level_unload - Side
- server
- Contract
- listen
- Host / context
&mut dyn ServerHost- NeoForge
LevelEvent.Unload- Summary
dimension's level closed (NeoForge'sLevelEvent.Unload, posted afterlevel.close()inMinecraftServer.stopServer), after its last save: drop what the mod kept for it. A custom level closes once nobody has been in it for 300 ticks, after its chunks' unloads; built-in levels (Overworld, Nether, End) stay open until server shutdown, unloading only their unticketed chunks while idle. Every level still open closes when the server stops, beforeWorldCloseFinal, and when its open or its loop fails, beforeWorldOpenFailedorWorldCloseFailed. Once for eachlevel_. Don't read its blocks. Server-side.load
lightning_strike - Side
- server
- Contract
- cancel
- Host / context
&mut dyn ServerHost- NeoForge
- —
- Summary
- A server lightning bolt is about to be created.
causeisweather,trident,commandormod(a native mod'sstrike_);lightning playeris the responsible player when known. Setcancelto prevent the bolt and its effects.
living_breathe - Side
- server
- Contract
- listen
- Host / context
&mut dyn ServerHost- NeoForge
LivingBreatheEvent- Summary
- An entity's breathing this tick (
LivingBreatheEvent, posted fromLivingEntity.baseTickevery tick for a living entity with the generic air logic):entityis the player or mob.can_,breathe consumeandrefillcome in as Sunrise does it (a mod-free game changes nothing); set them to change this tick. Withcan_the air rises bybreathe refill, up to its maximum (entity_: 300 for every entity except dolphins, which have 4800); a dolphin's vanillamax_ air_ supply refillis its maximum minus its current air. Without breath, air falls byconsume, 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 mobs. A water animal, axolotl or nautilus comes in with its own air logic's answer: where it breathes (water, or rain for an axolotl)can_and abreathe refillto its full air; elsewhere no breath andconsume1. Running out deals its own damage (drowning, or drying out).
living_change_ target - Side
- server
- Contract
- cancel
- Host / context
&dyn Host- NeoForge
LivingChangeTargetEvent- Summary
- A mob is about to change its target.
original_is the target requested by the game, or none when it is clearing the target.target new_starts as that value; a listener can redirect or clear it. Settarget cancelto retain the mob's existing target.is_identifies a brain-driven target change; false identifies a goal or other mob target setter. Handles may be read through the host. During the lifted mob tick pass, the scoped view reads the ticking mob directly and peers from the tick snapshot: an already-ticked peer exposes post-turn state, and a not-yet-ticked peer pre-turn state. A mob spawned during that pass does not resolve in the scoped view until the next pass. Removed mobs do not resolve; dead-but-present mobs are distinct from removed mobs. Outside this scoped tick path, dispatch reads the entities available in the game host rather than this snapshot. A stale or invalid replacement, including a fake player, is refused. Authoritative server only. When piglins turn on a player who took guarded gold, the game reads the end of its mob list again at each step and finds each piglin again by its entity id after the hook; a piglin that is removed is skipped.brain
living_conversion_ post - Side
- server
- Contract
- listen
- Host / context
&mut dyn ServerHost- NeoForge
LivingConversionEvent.Post- Summary
- A mob converted into another type (NeoForge's
LivingConversionEvent.Post):convertedreplacesentity. Fires after the finalized new mob joined the level and before the old mob is removed, for the conversionsliving_tells.conversion_ pre
living_conversion_ pre - Side
- server
- Contract
- cancel
- Host / context
&mut dyn ServerHost- NeoForge
LivingConversionEvent.Pre- Summary
- A mob is about to convert into another type (NeoForge's
LivingConversionEvent.Pre, vanilla'sMob.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.outcomeis the new type. Setcancelto 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.
living_damage_ post - Side
- server
- Contract
- listen
- Host / context
&mut dyn HitHost- NeoForge
LivingDamageEvent.Post- Summary
- NeoForge's
LivingDamageEvent.Post: entityentityof typekindhas been hurt by the hitcontainer(a read-only liveDamageContainerView) describes, with its final values (health damage, the reductions, the post-attack invulnerability ticks). It fires once for every hit that passedliving_and the invulnerability cooldown, at the end ofincoming_ damage hurtServer: after the hurt sounds and after that hit's death processing (even if vetoed) or totem protection, before the hurt caller resumes. The next hazard, poison application or rider's hit sees the preceding hit already completed. It is not delayed to the next tick or the end of a player's turn. A queued mob effect's hurt finishes before the next action; a dolphin's dry-out hurt finishes before the land hop. A bee's drowning hurt finishes before it checks stinger expiry; an expiry hurt finishes before nectar and anger bookkeeping and movement controls. A server player's landing hurt finishes before the landing'sHIT_and fall reset, and before the next accepted move. A mob landing in its own tick finishes its hurt before the fall reset, movement restitution, travel's collision hurt or a later goal. This includes aGROUND BreathAirmove from either selector and a dolphin following a rider. A pufferfish sting on a mob finishes the hit before applying poison or starting the next sting, and before the fish's ownentity_. A projectile hit finishes before its enchantment effects, levitation or a follow-up explosion. Each mount or passenger's hurt finishes before the fall routine continues to the next hit: a horse is hurt before its riders.tick_ post container.inflicted()is the amount before absorption;container.health_is the amount applied to health. A hit that took no health (a shield, absorption, armor or adamage() living_listener took it all) fires it too, withdamage_ pre container.health_0.damage() container.should_carriescause_ side_ effects() 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. It can't write the entity or the world's blocks: the host (HitHost) gives the hit's random and level attachments, level sounds, and the own random of the entities the hit lends.
living_damage_ pre - Side
- server
- Contract
- listen
- Host / context
&mut dyn HitHost- NeoForge
LivingDamageEvent.Pre- Summary
- NeoForge's
LivingDamageEvent.Pre:LivingEntity.actuallyHurtof entityentityof typekind(minecraft:player,minecraft:zombie) bysource(named asnative_names it) has taken armor and magic, and the absorption hearts are next:living_ incoming_ damage containeris a live mutable borrow of the hit's damage container; it holds the damage it started with, what it is now (new_, which may be 0) and each reduction so far (armor, enchantments, mob effects). Change itsdamage new_to change what is inflicted before absorption, not whatdamage lastHurtremembers for the cooldown. Set its post-attack invulnerability ticks to change the cooldown itself, or useadd_for subsequent stages (such asreduction_ modifier Reduction::). The setters refuse negative damage, NaN damage and negative ticks without changing the hit. Pre fires for players, mobs and the ender dragon; a wolf whose armor takes the hit and armor stands do not fire it. The host is the hit's (Absorption HitHost): its blocks, random and own attachments, level sounds, and the own random of the entities the hit lends; the hurt entity is in the middle of its hit.
living_death - Side
- server
- Contract
- cancel
- Host / context
&mut dyn ServerHost- NeoForge
LivingDeathEvent- Summary
- A mob or server player is about to die (NeoForge's
LivingDeathEvent, vanilla'sLivingEntity.die): its health has run out, and the loot, experience and death message have not run.entityis its id andkindits type (minecraft:zombie,minecraft:player).sourceandweaponare the complete killing blow, asliving_saw it, including the causing player, direct projectile and weapon components. A server player's lethal fall is heard on the landing body before its fall distance is reset. A lethal pufferfish sting is heard before the fish applies that sting's poison or stings the next mob. A projectile's killing blow is heard before on-hit follow-ups; a mount or passenger's killing blow is heard before falling on to the next rider. Cancellation skips death and loot without changing the listener's health: heal it to keep it alive; at health <= 0 its body is removed after 20 ticks. Armor stands, boats and other non-mob entities are not told.incoming_ damage
living_death_ message - Side
- server
- Contract
- collect
- Host / context
&mut dyn ServerHost- NeoForge
- —
- Summary
living_is asked for the death message a tamed mob sends its owner (death_ message TamableAnimal.die), once the message is built and only when it would be sent (owner online,show_on).death_ messages messageholds the text: replace it, or set it toNoneto tell the owner nothing. Every mod is asked in order. Server and host.
living_death_ post - Side
- server
- Contract
- listen
- Host / context
&mut dyn ServerHost- NeoForge
- —
- Summary
- A mob or server player's death has finished (Fabric's
ServerLivingEntityEvents.AFTER_, vanilla'sDEATH LivingEntity.dieat itsbroadcastEntityEvent): the loot, equipment and experience dropped and the death message went out.entityis its id;damage_names the killing blow (type minecraft:player_) andattack attackeris the mob that dealt it, 0 for none or a player. It only hears. The tail ofliving_, a separate moment, and not fired when that hook cancelled the death. On a server player's lethal landing this is still inside the hurt, beforedeath HIT_and the fall reset. On a pufferfish sting it is before that sting's poison and the next sting. Projectile and mounted-fall deaths likewise finish before their on-hit or next-rider follow-ups. 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.GROUND
living_destroy_ block - Side
- server
- Contract
- cancel
- Host / context
&mut dyn ServerHost- NeoForge
LivingDestroyBlockEvent- Summary
- 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.entityis its entity id,kindits type (minecraft:wither),posthe block andstateits state. Canceling keeps the block (an enderman then holds nothing). Asked once per block, only while a mod is loaded. Server-side.
living_drops - Side
- server
- Contract
- cancel
- Host / context
&mut dyn ServerHost- NeoForge
LivingDropsEvent- Summary
- Not
loot_: 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 standdrops entityofkind(playeris a player's UUID) is about to dropdrops, the itemsLivingEntity.dropAllDeathLootcollected (NeoForge'sLivingDropsEvent): the loot tables' stacks (afterloot_), 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 setdrops cancelfor no drops at all; empty stacks don't drop.sourceis the killing blow (causinganddirectentity ids, 0 when none or not known); a player who dies with no recorded blow gets the sourceliving_heard (death generic_forkill /).kill recently_is whether a player hurt it within 100 ticks, which is what lets a mob drop its equipment. An armor stand fires it fromhit brokenByAnythingwith an empty list (its stand item and its equipment pop outside the list, as in vanilla). Experience orbs are not in the list (living_, heard just before this hook, as in NeoForge; the orbs join the level after the items); a spectator, who drops nothing, doesn't call this. Eachexperience_ drop ItemDropalso sets the item entity'sthrower,target(the only player who may pick it up),no_and startinggravity age(ItemDrop::never despawns); a drop left as it was spawns as before. Server-side.UNLIMITED_ LIFETIME
living_drown - Side
- server
- Contract
- cancel
- Host / context
&dyn LoopContext- NeoForge
LivingDrownEvent- Summary
- An entity that can't breathe and has no air (
LivingDrownEvent, posted fromLivingEntity.baseTick), with vanilla's answers as the defaults: it drowns at -20 air, for 2 damage and 8 bubbles. Changeis_,drowning damage_oramount bubble_, or cancel to skip drowning this tick. Eight bubbles are the vanilla entity event; another positive count is sent as that many bubble particles, and none sends nothing. Asked on servers, for the entitiescount living_is; a water animal, axolotl or nautilus shows no bubbles, as in vanilla. It is given the loopbreathe contextof the server that ticks the entity (its registries, settings and mod list), because it fires inside the tick's own air and damage update.
living_entity_ use_ item_ finish - Side
- both
- Contract
- listen
- Host / context
HostSide- NeoForge
LivingEntityUseItemEvent.Finish- Summary
- NeoForge's
LivingEntityUseItemEvent.Finish:entity's use ofstackinhandran its time (LivingEntity.completeUsingItem),durationthe ticks left, always 0.entityis as inliving_.entity_ use_ item_ start resultarrives with whatfinishUsingItemleft 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. Both sides, as vanilla'scompleteUsingItem: answer the same on both, and change the world only on the server (native_is false there), not on a server's client. On the server it fires for every player of the world (the helpers read the acting one). On a server's client the result arrives as vanilla's clientwindow finishUsingItemleaves it: an item that is not a consumable unchanged (a spyglass), a consumable less one, and its use remainder (the bowl of the last stew) once that empties the hand; nothing is used up in creative mode. The hand holds the result, a mod's replacement included, until the server's inventory update.
living_entity_ use_ item_ start - Side
- both
- Contract
- cancel
- Host / context
HostSide- NeoForge
LivingEntityUseItemEvent.Start- Summary
- NeoForge's
LivingEntityUseItemEvent.Start:entitystarts usingstackinhand(LivingEntity.startUsingItem), fordurationticks (use_'s answer).duration entityis a mob'sEntity.getId, None for a player (host.players().acting_says who); a mob fires it only forplayer() LivingRef::. Changestart_ using_ item duration(consumables, potions, spyglasses and mods' items count to it; below 0 refuses the use, and 0 runs it out on its first tick, asliving_running it out, unless the item's own is 0 already), or setentity_ use_ item_ tick canceledand 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_is false there), not on a server's client.window
living_entity_ use_ item_ stop - Side
- both
- Contract
- cancel
- Host / context
HostSide- NeoForge
LivingEntityUseItemEvent.Stop- Summary
- NeoForge's
LivingEntityUseItemEvent.Stop:entitylets go ofstackinhandbefore its use ran its time (LivingEntity.releaseUsingItem: the use button let go, a screen opened),durationthe ticks left. Setcanceledto skip the item's release (a bow doesn't shoot, a spyglass makes no sound,release_isn't called); the use stops anyway. Not when the hand changed item, which stops the use without a release. Both sides, asusing living_.entity_ use_ item_ tick
living_entity_ use_ item_ tick - Side
- both
- Contract
- cancel
- Host / context
HostSide- NeoForge
LivingEntityUseItemEvent.Tick- Summary
- Each living tick that
entitymay still usestackinhand.entityis as inliving_;entity_ use_ item_ start durationreplaces the remaining-ticks counter, not the original use duration. The order is the may-still-use check, this event, the per-tick effects only while the counter is above 0, then the decrement and server finish.
living_equipment_ change - Side
- server
- Contract
- listen
- Host / context
&mut dyn ServerHost- NeoForge
LivingEquipmentChangeEvent- Summary
- A mob's, an armor stand's or a player's equipment slot took a different stack (NeoForge's
LivingEquipmentChangeEvent, posted inLivingEntity.collectEquipmentChanges):entityis its ID andkindits type (minecraft:zombie,minecraft:player),slottheEquipmentSlot(mainhand,offhand,feet,legs,chest,head,body,saddle),fromwhat the slot held when this was last heard (none for empty) andtowhat 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 entity with its own helpers.
living_equipment_ listened - Side
- server
- Contract
- collect
- Host / context
&mut dyn ServerHost- NeoForge
- —
- Summary
- Whether a mod listens to the mobs' and players'
living_: a mod that hooks it hooks this one too and setsequipment_ change listened(HEAD,*listened = true). Without it the game does not read every mob's and connected player's equipment each tick, and neither is told (armor stands still are). A mob that ticks, or a player who is in the level, once it is set counts from empty. Asked once a tick for the mobs, after their tick, and once for the players. Server-side.
living_experience_ drop - Side
- server
- Contract
- cancel
- Host / context
&mut dyn ServerHost- NeoForge
LivingExperienceDropEvent- Summary
- A dying mob or player
entityofkindis about to droporiginalpoints of experience; the vanilla conditions have been checked.attacking_is the player who last hurt it, if any. Changeplayer amount(0 or less drops nothing), or setcancelto drop none. A sculk catalyst that takes the experience does not call this. As in NeoForge'sdropAllDeathLoot, it fires after the loot rolls and just beforeliving_hears the item list. Server-side.drops
living_fall - Side
- both
- Contract
- cancel
- Host / context
&dyn LoopContext- NeoForge
LivingFallEvent- Summary
- 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 loopcontextof 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 noHost.
living_flying_ speed - Side
- both
- Contract
- listen
- Host / context
&dyn LoopContext- NeoForge
- —
- Summary
- A living entity's airborne acceleration (
LivingEntity.getFlyingSpeed) is about to be used by its travel.entityis its id andkindits type; a mod may changespeed. Fires on both sides, on the client's replayed ticks too, with the loopcontextof 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.
living_get_ projectile - Side
- both
- Contract
- collect
- Host / context
HostSide- NeoForge
LivingGetProjectileEvent- Summary
LivingEntity.getProjectile(weapon)(NeoForge'sLivingGetProjectileEvent) for a player (playerandname) or a mob (entity,kind): a skeleton or illusioner's shot, or the crossbow load of a pillager or piglin.projectileis the vanilla ammunition; replace it to choose another. A replaced stack is not taken from the inventory.
living_heal - Side
- both
- Contract
- cancel
- Host / context
&dyn LoopContext- NeoForge
LivingHealEvent- Summary
- A living entity is about to heal. Mods may change the amount or cancel.
entityidentifies the affected entity. It is given the loopcontextof 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.
living_incoming_ damage - Side
- server
- Contract
- cancel
- Host / context
&mut dyn HitHost- NeoForge
LivingIncomingDamageEvent- Summary
- NeoForge's
LivingIncomingDamageEvent:LivingEntity.hurtServer, past its guards (an invulnerable or dead entity, fire on a fire-resistant one), is about to hurt entityentityof typekind(minecraft:zombie,minecraft:player) bysource: 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 formagic()and any other source with no direct entity, even during that projectile's impact), and where it comes from (getSourcePosition).victimis where the entity stands and looks, andweaponthe direct entity's weapon (getWeaponItem) when it is known.causing_is the causing living entity's current main-hand weapon (weapon getEntity().getWeaponItem), read at hit time, not a projectile's saved weapon; None for an absent, unknown or non-living cause, or once the shooter is gone. It is an addition: NeoForge'sLivingIncomingDamageEventdoesn't carry it, and mods there read the source entity's main hand themselves.containeris a live mutable borrow of the hit's damage container before any reduction; engine sequencing and normalization remain game-owned. Change itsnew_, the invulnerability ticks a fresh hit leaves (vanilla's 20), or install an owned reduction modifier closure withdamage add_(run in registration order when that reduction stage executes, receiving a read-only view of the live container and the preceding reduction value). Setreduction_ modifier canceledand nothing ofhurtServerhappens (no damage, hurt sound, knockback, cooldown, statistics or criteria); a canceled hit on the ender dragon still counts as landed (EnderDragon.hurtreturns true whateverreallyHurtdid). It fires on every damage route, for players, mobs and the ender dragon. The host is the hit's (HitHost): its blocks, random and own attachments, level sounds, and the own random of the entities the hit lends; the hurt entity is in the middle of its hit.
living_jump - Side
- both
- Contract
- listen
- Host / context
&dyn LoopContext- NeoForge
LivingEvent.LivingJumpEvent- Summary
- A living entity jumped (
LivingEvent.LivingJumpEvent):entityofkind(minecraft:player,minecraft:cow...), andvelocity, its motion in blocks per tick right after the jump. It is given the loopcontextof 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 noHost. It fires only when the jump power is above vanilla's 1.0E-5 threshold, as NeoForge's event does. Like NeoForge's event it cannot be cancelled; the velocity is read-only, and a write toevent.velocityis not applied (change the jump's height withliving_).jump_ power
living_jump_ power - Side
- both
- Contract
- listen
- Host / context
&dyn LoopContext- NeoForge
- —
- Summary
- A living entity's jump power (
LivingEntity.getJumpPower: jump strength attribute, block jump factor and Jump Boost) is about to be used byjumpFromGround.entityis its id andkindits type; a mod may changepower. 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 loopcontextof 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.
living_knockback - Side
- server
- Contract
- cancel
- Host / context
&mut dyn LevelRandomHost- NeoForge
LivingKnockBackEvent- Summary
- NeoForge's
LivingKnockBackEvent:LivingEntity.knockbackis about to push entityentityof typekind(minecraft:zombie,minecraft:player)strengthaway 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.sourceis the push'sDamageSource, named asnative_names a hit's.living_ incoming_ damage attackeris the attacking entity's network id, falling back to the victim's last hurt-by mob, or 0 when unknown;attacker_andmain attacker_are what it holds (a player's selected and off-hand stacks, a mob's main hand), none when unknown.off LivingRef::has an unattributedknockback minecraft:genericsource: this same attacker fallback and the victim's existing kill credit still apply. The call deals no damage and creates no credit.entryisShortwhen the push came in throughknockback(power, x, z), which only delegates to the full entry, andFullwhen the full entry was called directly. The hook fires once per call of the full entry either way, so a listener that wants its change applied twice for a short-entry push, as a mixin on both entries would, applies it twice whenentryisShort. Changestrength,xorz, or setcanceled, and the push follows them: canceled, the entity's motion is left alone. Astrengthof 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 forLivingRef::and for vanilla living knockbacks: 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 (knockback SulfurCube.knockbackdoes not callsuperthere), for the pushes vanilla doesn't make withLivingEntity.knockback(the ender dragon's wings, Punch arrows, explosions, wind charges, a mace smash's area, a hoglin's throw). The level is the victim's: its blocks, random and own attachments.kill_is the pushed living entity's kill credit at this pre-motion moment: a remembered player takes precedence over its last hurting mob, even when that player cannot resolve (then 0, without falling back).credit kill_is that entity's current main-hand stack, or none. This is not the immediate damage-source attacker. Accepted-hit memories, including a tame wolf's owner, are committed before this read. Both are additions: NeoForge'scredit_ main LivingKnockBackEventdoesn't carry them, and mods there read the pushed entity's kill credit and its holder's main hand themselves.
living_shield_ block - Side
- server
- Contract
- listen
- Host / context
&mut dyn HitHost- NeoForge
LivingShieldBlockEvent- Summary
- NeoForge's
LivingShieldBlockEvent: entityentityof typekind(minecraft:player,minecraft:zombie) is hit fordamagefromsource(its type and entities, asnative_names them), andliving_ incoming_ damage LivingEntity.applyItemBlockingis about to resolve what a raisedblocks_item stops. Every hit with damage asks, raised item or not:attacks original_is whether vanilla blocks (only a player raises one). Changeblocked block:blockedmakes the entity block or not (a block forced on a hit vanilla lets through stops all of it),blocked_what is stopped (kept within 0 anddamage damage) andshield_the durability a raised item loses (below 0: vanilla'sdamage itemDamageof what is stopped). Setblockedto false and nothing is blocked, as NeoForge'ssetBlocked(false); the event has no cancel. The host is the hit's (HitHost): its blocks, random and own attachments, level sounds, and the own random of the entities the hit lends.
living_speed - Side
- both
- Contract
- listen
- Host / context
&dyn LoopContext- NeoForge
- —
- Summary
- A living entity's movement speed (
LivingEntity.getSpeed) is about to drive its travel on the ground and through fluids.entityis its id andkindits type; a mod may changespeed. Fires on both sides, on the client's replayed ticks too, with the loopcontextof 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.
living_travel - Side
- server
- Contract
- cancel
- Host / context
&dyn LoopContext- NeoForge
- —
- Summary
- Before the server's
Player.travelbranch (after swim steering) or a mob'sLivingEntity.travelbranch.entity,kindandmodeidentify the body and the branch it is about to run, including species overrides. A body that doesn't travel, such as a shulker, fires no hook. Neither does a replayed player tick. A branch that callsentity_can still meet a move veto there.move
living_use_ totem - Side
- server
- Contract
- cancel
- Host / context
&mut dyn HitHost- NeoForge
LivingUseTotemEvent- Summary
- NeoForge's
LivingUseTotemEvent: a killing blow on entityentityof typekindfromsource(named asnative_names it) would be taken by theliving_ incoming_ damage death_itemprotection itemin itshand(main or off;LivingEntity.checkTotemDeathProtection). Setcanceland 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.player_still hears a server player's totem that did save them, after this. The host is the hit's (totem HitHost): its blocks, random and own attachments, level sounds, and the own random of the entities the hit lends.
living_visibility - Side
- server
- Contract
- listen
- Host / context
&dyn Host- NeoForge
LivingEvent.LivingVisibilityEvent- Summary
- How visible
entityis tolooking(NeoForge'sLivingVisibilityEvent, last inLivingEntity.getVisibilityPercent): the range a mob's targeting check sees it from is scaled byvisibility. It comes in as vanilla's percent (sneaking 0.8, invisibility by armour cover, a worn head'smob_: 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 any living target, by the mobs whose targeting checks scale by visibility (hostile targeting, sensors, the happy ghast's tempt). A mob target comes in without the sneaking factor, which vanilla reads throughvisibility isDiscrete. Server-side.
loot_drops - Side
- server
- Contract
- collect
- Host / context
&mut dyn ServerHost- NeoForge
LivingDropsEvent, BlockDropsEvent- Summary
- A block broke or a mob died, and
dropsare the items about to drop, in the order they drop: what the loot tables rolled (afterloot_'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'stable_ load LootTableEvents.MODIFY_);DROPS contextsays what dropped them and how, and it is called even whendropsis empty. A player's use drops through it too (LootDrops::: 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,used /), nor a creative break or a tool that can't harvest the block, nor experience. For deaths,setblock ... destroy context.damage_carries the death invocation's damage type and causing/direct IDs (not remembered player credit), andsource context.toolis None (the entity context has no TOOL). Resolve the causing ID throughhost.entityandhost.livingto read its main hand live withliving.with_, including earlier listeners' changes. Usehand_ item(host, Hand:: Main, |stack| stack.item()) stack.project()inside the callback if you need components or an owned hand stack; projection may refuse.context.weapon_returns an owned snapshot of the recorded projectile weapon or the live melee weapon, including a player's active auto-spin stack. Block and use drops retain their tool meaning. A changed drop keeps any non-negative signed-int damage, even above its maximum durability. Server-side, for every player.item(host)
loot_table_ load - Side
- server
- Contract
- collect
- Host / context
&dyn DataLoadContext- NeoForge
LootTableLoadEvent- Summary
- A native mod's hook point (docs/modding/src/how-to/native-mods.md), declared in
hooks/with the game's: the loot table*.rs id(minecraft:chests/,simple_ dungeon minecraft:blocks/,stone minecraft:entities/) as it loads, its JSON after the data packs', before anything rolls it (NeoForge'szombie LootTableLoadEvent, Fabric'sLootTableEvents.MODIFY). Add pools totable["pools"]or entries to a pool'sentries, change or replace it (no pools: it drops nothing; keep itsrandom_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 thesequence DataLoadContextof that owning load (origin()is alwaysServerDataLoad: the client never loads loot tables, so the hook never fires there).
map_decoration_ types - Side
- both
- Contract
- collect
- Host / context
&RegistrationContext- NeoForge
RegisterEvent- Summary
- The map decoration types a mod adds (NeoForge's
RegisterEventforRegistries.MAP_): callDECORATION_ TYPE event.register(decoration)with aMapDecorationTypeper type. Asked once at startup on every side.
map_decorations - Side
- client
- Contract
- collect
- Host / context
&dyn ClientHost- NeoForge
MapDecorationType- Summary
- Icons a mod puts on map
mapeach 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). PushMapDecorations (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.scaleandmap.dimensionsay which blocks the map shows, andMapDecoration::has the formula. Vanilla's decorations are not passed in. Asked every frame a map is drawn, so keep it cheap. The client half ofx MapDecorationTypeandaddDecoration: a type registered on the server and saved in the map's data is not here.
menu_background - Side
- client
- Contract
- listen
- Host / context
&dyn ClientHost- NeoForge
- —
- Summary
- The normal menu blur request, before finite/range validation. None disables it.
menu_closed - Side
- server
- Contract
- listen
- Host / context
&mut dyn ServerHost- NeoForge
PlayerContainerEvent.Close- Summary
- A menu a mod opened closed: the player closed it, the server or a mod opened another, or the player left.
opening_is the hand the opener supplied, if any. For a generichand owned_menu (without declaredslots results),owned_contains the transient container's final values in slot order and those stacks are not returned or dropped automatically by the game. For a processing owned menu (declaring bothslots owned_andslots results), the game automatically returns non-result inputs to the player's inventory (dropping overflow, or dropping on disconnect or death), discards declaredresultsslots, and passes an emptyowned_slice here so items cannot be duplicated. The window is already detached; a listener can use the Host to return generic owned slots or update the opening item if the player is still available.slots
menu_extra_ data - Side
- server
- Contract
- replace
- Host / context
&mut dyn ServerHost- NeoForge
IPlayerExtension.openMenu- Summary
- Block
blockatposopens its mod menu typemenufor server playerplayer: setdatato hand the menu's screen bytes of your own (a machine's tier, mode or recipes), up to 1,048,555 bytes (vanilla's 1 MiB clientbound custom payload limit minus the 21-byte envelope header), which the client reads only fromMenuScreenOpen::during construction (NeoForge'sextra openMenuwith an extra-data writer). Oversize data is logged and refuses the menu open. For live values use the menu's data slots (MenuScreenFrame::on the client). The first mod to setdata datawins, so answer only for your blocks. The player's state is not swapped in.
menu_links - Side
- server
- Contract
- collect
- Host / context
&mut dyn ServerHost- NeoForge
- —
- Summary
- Containers exposed by linked slots of server player
player's open mod menumenu(namespace:path) atpos. The player's state is not swapped in. Push container positions tolinks, in order. The engine resolves containers and refreshes their linked slots in the same tick. Asked each server tick only for open mod menu types declaring links, and dispatched only to subscribers. With no subscribers the linked-container tick does no work and allocates nothing. Silently skipspos, duplicate positions, missing or non-lendable containers, and positions after 64 accepted containers (MAX_). First accepted occurrence wins, preserving answer order.MENU_ LINKS
mob_despawn - Side
- server
- Contract
- listen
- Host / context
&dyn Host- NeoForge
MobDespawnEvent- Summary
- NeoForge's
MobDespawnEvent: the mobmob(of typekind, atpos) is about to runMob.checkDespawn, which fires once per tick for every mob on the entity tick list (its chunk is entity-ticking, which player tickets give across the whole view distance), persistent ones and peaceful-mode ones included. A listed mob beyond the simulation distance is checked without being ticked; a mob in a loaded chunk that is not entity-ticking is neither checked nor told. The hook is told while the game has lent its mob list to the tick, somobresolves through the tick's own read view (#795): the ticking mob itself, and the other present mobs in its tick snapshot, are readable through the host. The ticking mob is read directly; an already-ticked peer exposes its post-turn state and a not-yet-ticked peer its pre-turn state. A mob spawned during the pass does not resolve in this scoped view until the next pass. Removed mobs do not resolve; a dead-but-present mob is not a removed mob. This is the scoped read-host first step for #795, not an in-place ownership redesign.kindandposstay as plain data for listeners that only need them. Setresult:Allowdiscards the mob now,Denykeeps it this tick, andDefault(the starting value) leaves vanilla's rules to decide. Anything butDefaultskips vanilla's checks, including thenextInt(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 overridecheckDespawnwithoutsuper, so the event is not fired for them. Server-side. Tick-time effect: onelistenedbranch per mob per tick with no listeners.
mob_effect_ added - Side
- server
- Contract
- listen
- Host / context
&mut dyn ServerHost- NeoForge
MobEffectEvent.Added- Summary
- NeoForge's
MobEffectEvent.Added, vanilla'sMobEffect.onEffectStarted: everyLivingEntity.addEffectof the content mod's effecteffect, new or not, changed or not, afteron_. Server-side.effect_ added
mob_effect_ applicable - Side
- server
- Contract
- replace
- Host / context
&mut dyn ServerHost- NeoForge
MobEffectEvent.Applicable- Summary
- NeoForge's
MobEffectEvent.Applicable, vanilla'sLivingEntity.canBeAffected: asked wherever the game checks whether the resolvedEffectKeyeffect(minecraft:poison) can land on the living entityentity(aLivingRef, the player's own included), beforeaddEffectaccepts 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:AlloworDenyoverrides the vanilla tag check; an unanswered hook falls back to it. Server-side.
mob_effect_ expired - Side
- server
- Contract
- cancel
- Host / context
&dyn Host- NeoForge
MobEffectEvent.Expired- Summary
- NeoForge's
MobEffectEvent.Expired, vanillaLivingEntity.tickEffects: the resolvedEffectKeyeffect(minecraft:speed, amplifieramplifier) on the living entityentity(aLivingRef, 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.
mob_effect_ remove - Side
- server
- Contract
- cancel
- Host / context
&mut dyn ServerHost- NeoForge
MobEffectEvent.Remove- Summary
- NeoForge's
MobEffectEvent.Remove, vanillaLivingEntity.removeEffect: the resolvedEffectKeyeffect(minecraft:speed, amplifieramplifier) on the living entityentity(aLivingRef, 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.
mob_killed - Side
- server
- Contract
- listen
- Host / context
&mut dyn ServerHost- NeoForge
LivingDeathEvent- Summary
player's melee blow killed the mobentityofkind(other deaths aren't told yet). It only hears, after the blow landed. Server-side.
mob_spawn_ placement_ check - Side
- server
- Contract
- listen
- Host / context
&dyn Host- NeoForge
MobSpawnEvent.SpawnPlacementCheck- Summary
- NeoForge's
MobSpawnEvent.SpawnPlacementCheck: may the entity typekindspawn atposinlevelforreason? This server hook runs afterSpawnPlacements.checkSpawnRulesevaluates the type's spawn predicate.default_is the effective predicate result, including predicates composed or replaced throughresult Registrar::. It can differ from vanilla even for a vanilla entity type.register_ spawn_ placement resultstarts asDefault, which keeps that answer. SetSucceedorFailto override it for this check. The predicates have already drawn fromevent.random, the caller's live stream (NeoForge'sSpawnPlacementCheck.getRandom()). Each listener borrows that same stream; replacing its local reference cannot redirect later listeners. Draws advance the stream even if the result staysDefaultor the spawn is later refused.
mob_spawn_ position_ check - Side
- server
- Contract
- listen
- Host / context
&dyn Host- NeoForge
MobSpawnEvent.PositionCheck- Summary
- NeoForge's
MobSpawnEvent.PositionCheck: may the freshly created mob of typekindstand atpos(its position, a mob's centre) inlevelforreason? Vanilla's two checks areMob.checkSpawnRules(the type's own rules) andMob.checkSpawnObstruction(inside blocks or fluids, an ocelot's grass and sea level).resultstarts asDefault, which runs them;SucceedorFailanswers 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 skipsMob.checkSpawnRulesonDefault, as vanilla does). A trial spawner runs onlycheckSpawnObstruction, so only that is skipped.spawneris the block that asked (Spawner::orBlock Spawner::),Trial Nonefor natural spawning, chunk generation and a spawner minecart.mobis 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 answersExpired. 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 andUnsupportedfor the rest. Server-side. With no listener orDefaultthe checks and their random draws are vanilla's (creating the mob for the listener draws nothing from the level's random);SucceedandFailskip 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.
mob_spawned - Side
- server
- Contract
- listen
- Host / context
&mut dyn ServerHost- NeoForge
EntityJoinLevelEvent, FinalizeSpawnEvent- Summary
- A new mob of
kindjoineddimensionatpos:naturalwhen the world's spawning made it, false when something else did (a breed, a raid, a spawner, a conversion,/, and the second mob of a jockey the world spawned). One call a mob: asummon /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.summon
mob_split - Side
- server
- Contract
- cancel
- Host / context
&mut dyn ServerHost- NeoForge
MobSplitEvent- Summary
- A slime, magma cube or sulfur cube is dying and about to split into smaller ones (NeoForge's
MobSplitEvent, vanilla'sAbstractCubeMob.remove):dimensionis the level it dies in (aPendingMobSpecfor a new child names it),parentits entity id,kindits type,sizeits size andchild_the size of the children (half of it). The children 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) are already constructed, in order, and wait in an engine-owned list thatsize edits.children()names andeditschanges: read it withedits.lenandedits.child, then edit a child (edits.set_,position edits.set_,yaw edits.set_,baby edits.set_), replace one (size edits.replace), remove one (edits.remove) or append a new one (edits.construct, thenedits.append; at most 64 children). Each child is a complete mob that is in no level yet: it has no entity number, no join and nothing a player or another mod can see, and every handle (edits.children()and the childrenedits.childgave) is borrowed for one listener only; kept past it, or used by a later listener, it answersExpired. Setcancel(or leave the list empty) to spawn no children: the children's construction draws stay spent and the parent still dies. A panicking callback is reported and disabled for the session, and this split is cancelled. A refusal (including an explicit veto) rolls back journaled listener writes in the split's level. The accepted children are inserted once, in order, before deferred join callbacks run. If the listener invalidates the split, or the list ends up invalid, nothing spawns. Only for a parent above size 1, once its children are made. With no listener nothing is allocated for the list. On the server.
mod_container_ viewers - Side
- server
- Contract
- listen
- Host / context
&mut dyn ServerHost- NeoForge
- —
- Summary
- The number of players with the mod container at
posofdimensionopen went fromprevioustoviewers(vanilla'sContainerOpenersCounter, as a barrel keeps it): 0 to more than 0 isonOpen, back to 0 isonClose, any changeopenerCountChanged, so a block can show itself open whileviewersis not 0. Incremented synchronously when a non-spectator opens the menu, decremented when it closes (including disconnect), and rechecked every five ticks while open, including copper golems in range. Rechecks also report unchanged counts. Zero crossings post container_open/container_close game events: the opening or closing player is the source, none on a recheck. Server-side; open/close runs with the player's state in place.
mod_mismatch - Side
- both
- Contract
- collect
- Host / context
HostSide- NeoForge
ModMismatchEvent- Summary
- A saved mod list (code and content mods) was read while opening a world. Fires when a nonempty list exists, changed or unchanged, never when the lists are absent or empty (an empty saved list counts as absent), once per open. Versions use the loader's comparison; minecraft is excluded. Newly added mods are not differences. Push a mod id converted with
.into()intoresolved. Dispatch assigns the first resolving listener and preserves earlier markers. When a saved mod is no longer loaded, it fires before the world opens, on the side that asks (the client in singleplayer, the dedicated server), and a resolved id is taken off the question; otherwise it fires on the opening server before world-state restoration, after preparation.
model_baking_ completed - Side
- client
- Contract
- listen
- Host / context
&mut dyn ClientHost- NeoForge
ModelEvent.BakingCompleted- Summary
- 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_), in the storemodels modelnow reads. Fires once per successful model load, after bothtexture_calls, at the model manager's apply step on first load and reload. Listeners ordered after the model manager apply after this hook. It precedesatlas_ stitched client_on startup andsetup client_on later reloads. A refused prepare fires nothing, and the old handles stay valid. Resolve models once throughresources_ reloaded render_and keep theassets().model ModelRefs until the nextmodel_, when the old ones answerbaking_ completed ModelError::. UseStaleModel host.render_to borrow published geometry during this callback; it does not edit the store. Never look them up by name every frame. Client-side. A panic rolls back the callback's journaled writes; the mod is reported and its callback skipped for the session without suppressing other mods' notifications.assets().baked_ model(key)
modify_custom_ spawners - Side
- server
- Contract
- listen
- Host / context
&dyn Host- NeoForge
ModifyCustomSpawnersEvent- Summary
- NeoForge's
ModifyCustomSpawnersEvent: the leveldimensionis about to tick its custom spawners for the first time.spawnersis the listServerLevelticks, in order, and it starts with vanilla's (WanderingTrader,Patrol,Cat,VillageSiegeandPhantom, in the order Sunrise ticks them). Take a vanilla spawner out withremoveand it never ticks, so its random draws are gone with it; add a spawner of the mod's own withaddand aSpawnerKeythe mod owns, andcustom_runs for it every tick, after the ones before it in the list. 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, wherever it is in the list. 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.spawner_ tick
modify_default_ components - Side
- both
- Contract
- collect
- Host / context
&dyn DataLoadContext- NeoForge
ModifyDefaultComponentsEvent- Summary
- NeoForge 26.3's ModifyDefaultComponentsEvent: set or remove entries in
components, the default component map foritem, 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.
moisture_change - Side
- server
- Contract
- cancel
- Host / context
&dyn LevelHost- NeoForge
- —
- Summary
- Farmland at
posis about to change moisture fromfromtoto. Setcancelto keep its old moisture. Server-side.
mouse_button_ post - Side
- client
- Contract
- listen
- Host / context
&mut dyn ClientHost- NeoForge
InputEvent.MouseButton.Post- Summary
- An accepted raw button event finished dispatch, including a screen handler's early return.
mouse_button_ pre - Side
- client
- Contract
- cancel
- Host / context
&mut dyn ClientHost- NeoForge
InputEvent.MouseButton.Pre- Summary
- 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.
mouse_scrolling - Side
- client
- Contract
- cancel
- Host / context
&mut dyn ClientHost- NeoForge
InputEvent.MouseScrollingEvent- Summary
- Gameplay scrolling after accumulation, before hotbar/spectator handling.
scrollis scaled x/y,accumulatedwhole x/y steps,buttonsleft/middle/right, andcursorthe GUI position. Cancel skips gameplay scrolling.
movement_input_ update - Side
- client
- Contract
- listen
- Host / context
&dyn ClientHost- NeoForge
MovementInputUpdateEvent- Summary
- Lends the local player's sampled
MovementInputafter sampling, before auto-jump and sprint decisions. Every listener sees the preceding listeners' edits.
music- Side
- client
- Contract
- listen
- Host / context
&dyn ClientHost- NeoForge
SelectMusicEvent- Summary
- Choose this client's music, once a client tick:
musicandvolumehold what vanilla chose (Minecraft.getSituationalMusicandgetMusicVolume: the biome's track, the creative or underwater one, a boss's, the menu's; None for silence). Setmusicto a track of your own, a sound event of your content mod'ssounds.jsonsuch asMusic::(the delays in ticks between songs, and whether it cuts off a different song playing), None to keep vanilla's quiet, or changenew("mymod:music.spring", 1200, 6000, false) volume(0 to 1) to fade it.
music_layers - Side
- client
- Contract
- collect
- Host / context
&dyn ClientHost- NeoForge
- —
- Summary
- 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 bestream: trueinsounds.json.
neighbor_notify - Side
- server
- Contract
- cancel
- Host / context
&dyn LevelHost- NeoForge
BlockEvent.NeighborNotifyEvent- Summary
- The block at
pos(state) is about to tell its neighbours it changed (NeoForge'sBlockEvent.NeighborNotifyEvent): atServerLevel.updateNeighborsAt, which notifies all six sides (skipped_isside None), andupdateNeighborsAtExceptFromFacing, which notifies all butskipped_. Setside canceland no neighbour hears, on both paths. Asked for every such update, redstone included: answer fast. Server-side.
note_block_ change - Side
- server
- Contract
- cancel
- Host / context
&dyn LevelHost- NeoForge
NoteBlockEvent.Change- Summary
- A player is tuning a note block on the authoritative server, not in client prediction.
contextgives its dimension, position, instrument and old note;new_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.note
note_block_ play - Side
- server
- Contract
- cancel
- Host / context
&dyn LevelHost- NeoForge
NoteBlockEvent.Play- Summary
- The note block at
posis about to play (NeoForge'sNoteBlockEvent.Play, inNoteBlock.playNote), once a block above no longer mutes it.playerandplayer_name the player who tuned or punched it, and areentity_ id Nonefor redstone.instrumentis its instrument andnoteits note, 0 to 24; change either to play another (a note out of range keeps the block's own). Setcanceland it doesn't play: no sound, no particle, nonote_game event. Server-side.block_ play
on_effect_ added - Side
- server
- Contract
- listen
- Host / context
&mut dyn ServerHost- NeoForge
- —
- Summary
MobEffect.onEffectAdded:LivingEntity.addEffectgaveentitythe content mod's effecteffect, which it didn't have. Server-side.
on_equip - Side
- server
- Contract
- listen
- Host / context
&mut dyn ServerHost- NeoForge
- —
- Summary
- A player's equipment slot
slot(head,chest,legs,feet,offhand, andmainhandon a swap of the hands or/) took a different item,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).
panel_event - Side
- client
- Contract
- listen
- Host / context
&mut dyn ClientHost- NeoForge
- —
- Summary
eventhappened on modmod_'s panel (id native_): the player's click, key or edit, or (panel_ items Search, since version 2) the owner's ownpanel_reaching its box, on the first frame that draws it, with no player edit. Since version 3 a left click on an item with nothing carried comes assearch Clickedwhen the button comes up without a drag, and a drag off the list ends asDropped. Act on it when it is yours.
permissions_changed - Side
- server
- Contract
- cancel
- Host / context
&mut dyn ServerHost- NeoForge
PermissionsChangedEvent- Summary
- NeoForge's
PermissionsChangedEvent: the operator list is about to give playerplayer(name) the permission levelnewin place ofold, throughPlayerList.op(/, the console'sop op, the management API'soperators/andadd operators/) orset PlayerList.deop(/and the same on the console and the management API;deop newis thenAll). Setcanceland the list keeps the old level. The player need not be online:player_is their server entity id when they are. Clearing the list (entity_ id operators/) is not a call to either, as in vanilla. Dedicated servers only; a single-player world has no operator list. Server-side.clear
pickup_xp - Side
- server
- Contract
- cancel
- Host / context
&mut dyn ServerHost- NeoForge
PlayerXpEvent.PickupXp- Summary
- Before
playerpicks up orborbindimension. Mutations tovalueandcounttake 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 fromexperience_, to NeoForge'sorb_ pickup PlayerXpEvent.PickupXp.
piston_post - Side
- server
- Contract
- listen
- Host / context
&dyn LevelHost- NeoForge
PistonEvent.Post- Summary
- On an authoritative server, the piston at
pistonpushed the blocks atpushone stepdirection([0, 1, 0]is up; pulling when it retracts,extendingfalse) and destroyed those atdestroy(NeoForge'sPistonEvent.Post, at the end ofPistonBaseBlock.moveBlocks, after the neighbour updates). It only hears;piston_is the veto. Server-side. Diverges from upstream:pre piston_is split intomove piston_andpre piston_.post
piston_pre - Side
- server
- Contract
- cancel
- Host / context
&dyn LevelHost- NeoForge
PistonEvent.Pre- Summary
- On an authoritative server, the piston at
pistonis about to push the blocks atpushone stepdirection([0, 1, 0]is up; pulling when it retracts,extendingfalse) and destroy those atdestroy(NeoForge'sPistonEvent.Pre, inPistonBaseBlock.moveBlocks, once its structure resolved). Setcanceledand 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_is renamed tomove piston_, andpre piston_is new.post
play_level_ sound_ at_ entity - Side
- both
- Contract
- cancel
- Host / context
HostSide- NeoForge
PlayLevelSoundEvent.AtEntity- Summary
- A sound bound to
entityis about to play (NeoForge'sPlayLevelSoundEvent.AtEntity, inLevel.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. Queued server sounds are asked as they go out. For a transactional server request, the hook runs synchronously at the call; only the resolved effect is deferred. Sounds emitted by a level-sound listener are not re-dispatched to level-sound listeners. The fields and their rules areplay_'s. Client entity-sound packets ask before playback and keep following their emitter; an absent emitter plays nothing.level_ sound_ at_ position LocalPlayer.playSoundalso asks this hook, including steps, falls, hurt, bundle clicks and consumption; these remain positional sounds, not following sounds. Both sides, distinguished byHostSide.
play_level_ sound_ at_ position - Side
- both
- Contract
- cancel
- Host / context
HostSide- NeoForge
PlayLevelSoundEvent.AtPosition- Summary
- A sound is about to play at
positioninlevel(NeoForge'sPlayLevelSoundEvent.AtPosition, inLevel.playSeededSound): every server sound not bound to an entity, mobs' own sounds included (Entity.playSoundplays at the entity's position). A mod may changesound,source,volumeandpitch, or setcanceland no player hears it;original_andvolume original_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.pitch /sends its packet directly and isn't asked, as in vanilla on the server. On the client, incoming sound packets ask before playback, includingplaysound /; 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:playsound HostSideidentifies which one is being edited. UI and sound-engine-only playback do not ask this hook. For a transactional server request, the hook runs synchronously at the call; only the resolved effect is deferred. Sounds emitted by a level-sound listener are not re-dispatched to level-sound listeners. Both sides.
play_sound - Side
- client
- Contract
- listen
- Host / context
&dyn LoopContext- NeoForge
PlaySoundEvent- Summary
startingis true for starts and loop replays, false for a live channel refresh. A ticking sound's live refresh applies volume, pitch andeffectstransiently; a refresh for a category volume change applies volume and pitch.Nonestops the channel. Invalid edited numeric values refuse that refresh,effectsbySoundEffects::. A sound is about to play (valid PlaySoundEvent, vanilla'sSoundEngine.play):originalis the sound as asked for,soundstarts as a copy of it. Editsound(its volume, pitch, source, position, identifier, looping, delay, attenuation, relativeness oreffects) to change what plays, or set it toNoneto play nothing.effects(SoundEffects) is the mixer's DSP for this one sound: its gain, a low-pass and a high-pass on the direct sound and sends to the sharedroom,hallandcavernreverbs, each in a fixed range (SoundEffects::: a value out of range, NaN or an infinity refuses the play, never clamped). A sound that doesn't tick keeps the effects it started with. 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 invalid soundand the sound as asked for inoriginal. A newidentifieris resolved again, with its own weighted pick.contextis the client'sLoopContext: no game is at hand inside the sound engine. Client-side only; a server has no sound.instanceis an engine-local sound instance id, unchanged across its live updates.
play_sound_ source - Side
- client
- Contract
- listen
- Host / context
&dyn LoopContext- NeoForge
PlaySoundSourceEvent- Summary
- A sound that is not streamed has started on
channel(PlaySoundSourceEvent), after the engine set its pitch, volume, attenuation, looping and position:soundis what is playing, afterplay_'s edits. A notice: the channel is an id only and gives no control. Streamed sounds (music, records) firesound play_instead. Client-side only.streaming_ source
play_streaming_ source - Side
- client
- Contract
- listen
- Host / context
&dyn LoopContext- NeoForge
PlayStreamingSourceEvent- Summary
- A streamed sound (music, a record) has started on
channel(PlayStreamingSourceEvent):soundis what is playing, afterplay_'s edits. A notice: the channel is an id only and gives no control. Other sounds firesound play_instead. Client-side only.sound_ source
player_advancement_ done - Side
- server
- Contract
- listen
- Host / context
&mut dyn ServerHost- NeoForge
AdvancementEvent.AdvancementEarnEvent- Summary
- A server player completed an advancement, after progress was recorded.
player_advancement_ progress - Side
- server
- Contract
- listen
- Host / context
&mut dyn ServerHost- NeoForge
AdvancementEvent.AdvancementProgressEvent- Summary
- 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.
progressis 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.
player_arm_ swing - Side
- server
- Contract
- listen
- Host / context
&mut dyn ServerHost- NeoForge
- —
- Summary
- A guest's arm swing was handled by the server.
handismainhand. Server-side.
player_attack_ cooldown_ reset - Side
- server
- Contract
- listen
- Host / context
&mut dyn ServerHost- NeoForge
- —
- Summary
- 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.
player_bed_ enter - Side
- server
- Contract
- cancel
- Host / context
&mut dyn ServerHost- NeoForge
- —
- Summary
- A server player is about to enter a bed after the sleep checks pass. Set
cancelto keep them out. The player's state is swapped in.
player_bed_ leave - Side
- server
- Contract
- listen
- Host / context
&mut dyn ServerHost- NeoForge
PlayerWakeUpEvent- Summary
PlayerWakeUpEvent: a server player is getting out of the bed atpos(Player.stopSleepInBed), heard first, while they still read as sleeping there.wake_is vanilla's flag for skipping the wake-up fade: generic stop-sleeping, death and bed-missing wakes pass true; morning, explicit leave and bed-rule refusal pass false.immediately update_is false for morning, true for those individual wakes.level
player_break_ speed - Side
- both
- Contract
- cancel
- Host / context
HostSide- NeoForge
PlayerEvent.BreakSpeed- Summary
- A player's destroy speed for the block at
posmay be changed or canceled. A client without this mod predicts vanilla destroy speed; the server remains authoritative and corrects the resulting block-breaking progress.
player_brewed_ potion - Side
- server
- Contract
- listen
- Host / context
&mut dyn ServerHost- NeoForge
PlayerBrewedPotionEvent- Summary
- A server player took
stackfrom a brewing stand bottle slot (BrewingStandMenu.PotionSlot.onTake):playeris their UUID andplayer_their network id.entity_ id
player_bucket_ entity - Side
- server
- Contract
- listen
- Host / context
&mut dyn ServerHost- NeoForge
- —
- Summary
- A server player caught a mob in a bucket, after it was removed and the filled bucket was given. Server-side.
player_bundle_ item_ select - Side
- server
- Contract
- listen
- Host / context
&mut dyn ServerHost- NeoForge
- —
- Summary
- A server player selected a bundle item in
slotatindex. The guest's state is not swapped in during packet handling.
player_change_ beacon_ effect - Side
- server
- Contract
- listen
- Host / context
&mut dyn ServerHost- NeoForge
- —
- Summary
- 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.
player_changed_ dimension - Side
- server
- Contract
- listen
- Host / context
&mut dyn ServerHost- NeoForge
PlayerEvent.PlayerChangedDimensionEvent- Summary
player(name) changed dimension (NeoForge'sPlayerChangedDimensionEvent):fromandtoare dimension ids (minecraft:overworld,minecraft:the_,nether minecraft:the_). Fires once a cross-dimension teleport lands: a Nether or End portal (including travel on a vehicle and later End portal exits), or a command such asend /. The destination level is in place and the player's state is swapped in, soexecute in ... run tp host.players().acting_andplayer() PlayerRef::reach them. Runs on the logical server, not the client. Does not fire for a move within a level, a player who leaves before arrival, or a replacement created by respawn, even in another level. Usetell player_for respawns after death or after the End credits.respawned
player_client_ loaded_ world - Side
- server
- Contract
- listen
- Host / context
&mut dyn ServerHost- NeoForge
- —
- Summary
- 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.
player_clone - Side
- server
- Contract
- listen
- Host / context
&mut dyn ServerHost- NeoForge
PlayerEvent.Clone (not cancellable)- Summary
- A player's data was copied to their new player (NeoForge's
PlayerEvent.Clone, fromServerPlayer.restoreFrom):was_is true after a death, false when they left the End after the credits (death respawnwithkeepAllPlayerData).originalis a direct, callback-scoped loan (OriginalPlayer) of the retained original player, enforced at compile time so it cannot outlive the hook. It supports attachment reads on the old player without default insertion. Saved values decode once, and cache writes, explicit writes and removals are journaled tohost.transactionwithout touching the replacement. It also provideswith_over the 43-slot vanilla inventory,inventory persistent_, health, experience, active effects, position, source dimension and source level.data playeris the replacement's UUID, already assigned its final level, including anyplayer_redirect. Heard after removal of the old player's menus and after the data copy, before placement or bulk attachment publication. Old bulk tokens are stale. Not cancellable.respawn_ position
player_command - Side
- server
- Contract
- cancel
- Host / context
&mut dyn ServerHost- NeoForge
CommandEvent- Summary
- A command a player typed (NeoForge's
CommandEvent, beforeCommands.performCommandruns it), without its slash: any command, vanilla's and the mods' own, also one the player may not run. Setcanceledto stop it: nothing runs and nothing is answered but the lines pushed toreplies, 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, soPlayerRef::and the other player helpers reach nobody here: answer throughtell replies. Once for each command a player sends, on a server, and for each line of a quiet command batch (sunrise:quiet_, whose replies are dropped). A command the server refuses before reading it (unsigned chat arguments, the chat rate limit) never reaches it.commands
player_commands_ sent - Side
- server
- Contract
- collect
- Host / context
&mut dyn ServerHost- NeoForge
- —
- Summary
- 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 /, the LAN settings).deop namesare 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,player_stops it. For a player who is already on, their state is swapped in and the helpers (command PlayerRef::...) 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.tell
player_container_ close - Side
- server
- Contract
- listen
- Host / context
&mut dyn ServerHost- NeoForge
PlayerContainerEvent.Close- Summary
player(name) closed themenu_thattype player_told of (NeoForge'scontainer_ open PlayerContainerEvent.Close, posted inServerPlayer.doCloseContainerafter the menu'sremoved): they closed it, walked out of reach, died, changed level, or another menu opened. A player who leaves closes it beforeplayer_(vanilla posts nothing for a disconnect; Sunrise 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.logged_ out
player_container_ open - Side
- server
- Contract
- listen
- Host / context
&mut dyn ServerHost- NeoForge
PlayerContainerEvent.Open- Summary
player(name) opened a menu (NeoForge'sPlayerContainerEvent.Open, posted whenServerPlayer.openMenusets the newcontainerMenu): any menu, vanilla or a mod's.menu_is the menu type's name (type minecraft:generic_,9x3 minecraft:furnace,minecraft:merchant,minecraft:crafting,minecraft:lectern, a mod's own),posthe block it is of indimension(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 assunrise:mount_). The player's own inventory is not one, nor is failed construction. Heard synchronously after construction, the open packet is queued and full contents sent, with the new menu already current. Replacing a menu follows its close; even inside one tick, open precedesinventory player_.container_ close menuis the current menu handle, valid during this call, as returned byPlayerRef::. It iscontainer_ menu Nonefor unsupported menus such as crafting tables, merchants, workstations, lecterns and mount inventories. A supported menu keeps its handle when backing indices are permanently excluded; its slot methods still refuse those indices. The player's state is swapped in. Server-side.
player_deep_ sleep - Side
- server
- Contract
- listen
- Host / context
&mut dyn ServerHost- NeoForge
- —
- Summary
- A server player has slept for 100 ticks in a bed and now counts as deeply asleep for the night-skip check.
player_destroy_ item - Side
- both
- Contract
- listen
- Host / context
HostSide- NeoForge
PlayerDestroyItemEvent- Summary
- The player's item was used up or broke.
originalis the complete stack before the use or durability loss, including count, damage and components.handis the hand it was in, or None for worn equipment and ammunition consumed from the inventory.playerandplayer_identify the acting player, including the local host. Listen only, after consumption or the break has applied and before a use remainder is installed. A mining break notifies after block drops. Both sides hear their own actions; the client does not report a break inferred from an equipment status packet. Partial consumption, refused actions and creative use that preserves the stack do not fire.entity_ id
player_destroyed_ block - Side
- server
- Contract
- listen
- Host / context
&mut dyn ServerHost- NeoForge
- —
- Summary
- A player's break removed the block
statefrompos: theBlock.destroy(level, pos, state)callServerPlayerGameMode.destroyBlockmakes only afterLevel.removeBlocksucceeded, before a creative player's return andplayerDestroy's drops.stateis the block the removal took out, read just before it: whatplayerWillDestroyleft there (a cracked decorated pot; a disarmed tripwire, where vanilla passesBlock.destroythe armed one) or what abreak_listener put there.block block_is the saved data of the block entity that stood atentity pos(BlockEntity.saveWithoutMetadata, read withstate), none for a block without one; the entity itself is gone from the level by now, so a live handle would be stale. The level is writable. Server-side, for every player of the world: the helpers read the acting one. Not heard for a breakbreak_canceled, nor for a break the level makes (a piston, water, an explosion).block
player_died - Side
- server
- Contract
- listen
- Host / context
&mut dyn ServerHost- NeoForge
LivingDeathEvent- Summary
playerdied: whereServerPlayer.diestarts, with the death message's key when the game knows it (death.attack.lava; none for a message it builds from the combat). A lethal landing is still in progress when this fires. It only hears. Server-side, for every player of the world, whether death messages are shown or not.
player_edit_ book - Side
- server
- Contract
- cancel
- Host / context
&mut dyn ServerHost- NeoForge
- —
- Summary
- A server player's book edit or signing packet is about to be applied.
pagesis its page count;signingmeans the packet has a title. Setcancelto drop the edit.
player_egg_ throw - Side
- server
- Contract
- listen
- Host / context
&mut dyn ServerHost- NeoForge
- —
- Summary
- A server player threw an egg, after its projectile was launched and the use was applied. Server-side.
player_elytra_ boost - Side
- server
- Contract
- listen
- Host / context
&mut dyn ServerHost- NeoForge
- —
- Summary
- A server player used a firework rocket to boost while gliding, after the rocket was launched and consumed. Server-side.
player_enchant_ item - Side
- server
- Contract
- listen
- Host / context
&mut dyn ServerHost- NeoForge
PlayerEnchantItemEvent- Summary
- A server player enchanted
itemat an enchanting table (EnchantmentMenu.clickMenuButton):enchantmentsare the ones it was given, in order, as (id, level).itemis the enchanted stack (an enchanted book for a book). Fires after the levels are paid, beforeenchant_. Server-side.item
player_exp_ cooldown_ change - Side
- server
- Contract
- listen
- Host / context
&mut dyn ServerHost- NeoForge
- —
- Summary
- A server player's XP orb pickup cooldown changed to
ticks. It is reported after the value changes. Server-side.
player_fish - Side
- server
- Contract
- cancel
- Host / context
&mut dyn ServerHost- NeoForge
- —
- Summary
- A server player's fishing rod, with
state: 0 the cast (FishingRodItem.usethrowing 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'sPlayerFishEvent; NeoForge'sItemFishedEventis later, inFishingHook.retrieve). Setcancelon 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, sohost.players().acting_,player() PlayerRef::and the item helpers reach them. Once for each cast, bite and reel-in, on a server.tell
player_flower_ pot_ manipulate - Side
- server
- Contract
- listen
- Host / context
&mut dyn ServerHost- NeoForge
- —
- Summary
- A server player put a plant into a flower pot, after the potted block state was stored and the item consumed.
plantis the item id andposthe pot position. Server-side.
player_flyable_ fall - Side
- server
- Contract
- listen
- Host / context
&mut dyn ServerHost- NeoForge
PlayerFlyableFallEvent- Summary
- NeoForge's
PlayerFlyableFallEvent: server playerplayer(name) landed after fallingdistanceblocks at damage multipliermultiplierwhile allowed to fly (a creative or spectator player walking), soPlayer.causeFallDamagereturned 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.
player_game_ mode_ changed - Side
- server
- Contract
- cancel
- Host / context
&mut dyn ServerHost- NeoForge
PlayerEvent.PlayerChangeGameModeEvent- Summary
- A server player's game mode is about to change (NeoForge's
PlayerChangeGameModeEvent): fromfromtoto, both the sharedGameModeused by commands andPlayerRef.playeris the UUID andnamethe name. Heard for the/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. Setgamemode toto send the player to another mode instead: listeners run in order and each sees the mode the one before left. ReturnFlow::, or leaveCancel toat the player's current mode, and the player keeps their mode (nothing is sent, the command counts it as no change); the command's message names the mode it asked for, as vanilla's does. For a change the game makes inside a player's turn their state is swapped in; for the hardcore respawn it is not.
player_handshake - Side
- server
- Contract
- cancel
- Host / context
&mut dyn ServerHost- NeoForge
- —
- Summary
- A login or allowed transfer reached the server, after the transfer and network protocol checks and before the login hello, authentication, or admission. Runs once on the server thread. There is no player or profile yet.
player_harvest_ check - Side
- both
- Contract
- collect
- Host / context
HostSide- NeoForge
PlayerEvent.HarvestCheck- Summary
- A player's ability to harvest the block at
posmay be changed.
player_heart_ type - Side
- client
- Contract
- listen
- Host / context
&mut dyn ClientHost- NeoForge
PlayerHeartTypeEvent- Summary
- Which hearts the local player's health bar draws this frame (NeoForge's
PlayerHeartTypeEvent, fromHud.HeartType.forPlayer):kindcomes in as vanilla's pick (poisoned, else withered, else frozen when fully frozen, else normal); set it to draw another kind. This runs inside the vanillaminecraft:player_body, afterhealth gui_. A canceled or replaced layer does not fire this hook, and a wrapper fires it only by drawing the vanilla body. Only the heart sprites change, not the layout or the separate armour, food, vehicle-health or air layers. Client-side.layer_ pre
player_input - Side
- server
- Contract
- listen
- Host / context
&mut dyn ServerHost- NeoForge
- —
- Summary
- A guest sent the server's current
PlayerInputflags, after they were applied to the hub. The guest's state is swapped in. Server-side.
player_insert_ lectern_ book - Side
- server
- Contract
- listen
- Host / context
&mut dyn ServerHost- NeoForge
- —
- Summary
- A server player inserted a book into a lectern, after the block entity and inventory changed.
bookis the item id. Server-side.
player_inventory_ changed - Side
- server
- Contract
- listen
- Host / context
&mut dyn ServerHost- NeoForge
- —
- Summary
player_: a server player's inventory changed, at the moment vanilla'sinventory_ changed(player, stacks) InventoryChangeTriggeris checked (the per-tick check found another item or count in a slot), heard before any criterion and whether or not the tree hasinventory_advancements.changed stacksare the 41 slots inInventorynumbering: 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@.
player_item_ cooldown - Side
- server
- Contract
- cancel
- Host / context
&mut dyn ServerHost- NeoForge
- —
- Summary
- An item cooldown is about to start for a server player.
itemis the item id andticksits duration. The player's state is not swapped in. Setcancelto skip starting the cooldown. Server-side.
player_item_ frame_ change - Side
- server
- Contract
- listen
- Host / context
&mut dyn ServerHost- NeoForge
- —
- Summary
- A server player changed an item frame after its contents or rotation changed.
actionisput,rotate,remove_oritem break;itemis empty when no item remains, androtationis the resulting step. Server-side.
player_item_ mend - Side
- server
- Contract
- listen
- Host / context
&mut dyn ServerHost- NeoForge
- —
- Summary
- Mending repaired a server player's item with experience from an orb.
repairis durability restored andexperienceis the orb's value. Server-side.
player_item_ smithed - Side
- server
- Contract
- listen
- Host / context
&mut dyn ServerHost- NeoForge
PlayerEvent.ItemSmithedEvent- Summary
PlayerEvent.ItemSmithedEvent: a server player tookresultfrom a smithing table (SmithingMenu.onTake, oronQuickCraftfor a shift-click):playeris their UUID andplayer_their network id,entity_ id inputsthe template, base and addition as they were before the take used them (Nonefor 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.
player_jump - Side
- server
- Contract
- listen
- Host / context
&mut dyn ServerHost- NeoForge
- —
- Summary
- A guest's accepted movement made the server jump them from the ground. Server-side.
player_kicked - Side
- server
- Contract
- listen
- Host / context
&mut dyn ServerHost- NeoForge
- —
- Summary
- A network or fake guest was kicked, after the hub recorded the rendered
reason. The guest's state is swapped in unless they were already removed in the same poll.
player_launch_ projectile - Side
- server
- Contract
- listen
- Host / context
&mut dyn ServerHost- NeoForge
- —
- Summary
- A server player launched a projectile item, after it was created.
itemis the projectile's held item.
player_lectern_ page_ change - Side
- server
- Contract
- listen
- Host / context
&mut dyn ServerHost- NeoForge
- —
- Summary
- A server player changed the page of a lectern, after its page and redstone pulse changed.
pageis the zero-based new page. Server-side.
player_level_ change - Side
- server
- Contract
- listen
- Host / context
&mut dyn ServerHost- NeoForge
- —
- Summary
- A server player's experience level changed, after the new level was applied.
player_load_ from_ file - Side
- server
- Contract
- listen
- Host / context
&mut dyn ServerHost- NeoForge
PlayerEvent.LoadFromFile (not cancellable)- Summary
- A player was loaded from the world's save (NeoForge's
PlayerEvent.LoadFromFile,PlayerList.loadPlayerData): their.dathas been read and applied, and they are not placed in a level yet.directoryis the world's player directory (players/): a mod reads its own file there, nameddata <uuid>.<suffix>asgetPlayerFile(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.
player_logged_ in - Side
- server
- Contract
- listen
- Host / context
&mut dyn ServerHost- NeoForge
PlayerEvent.PlayerLoggedInEvent- Summary
player(name) joined the game (NeoForge'sPlayerLoggedInEvent): placed in the world and listed inhost.players().server_, soplayers() PlayerRef::reaches them. Once a join, with no player's state swapped in. Server-side.send_ payload
player_logged_ out - Side
- server
- Contract
- listen
- Host / context
&mut dyn ServerHost- NeoForge
PlayerEvent.PlayerLoggedOutEvent- Summary
player(name) left the game (NeoForge'sPlayerLoggedOutEvent), by any path: a lost connection, a kick, the server stopping or failing. Once for each playerplayer_told of, and also for a kicked fake player without a preceding login. Silentlogged_ in remove_sends no logout. The player is still infake host.players().server_when the hook fires. A listener's edits persist only on leaves this server saves. A completed proxy hand-over or a crash writes no logout save. Only when the server stops can a player still get a last message. A kicked fake has already left the list and is not saved. Server-side.players()
player_login - Side
- server
- Contract
- cancel
- Host / context
&mut dyn ServerHost- NeoForge
- —
- Summary
- A player whose login the server has accepted (NeoForge's
PlayerNegotiationEventstage): 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. Setcancelto refuse them: they are disconnected withreason(a plain "Disconnected" if it is left unset) and nothing else of the join (the join message,player_) 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 andlogged_ in PlayerRef::reaches nobody: the refusaltell reasonis 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.
player_login_ profile - Side
- server
- Contract
- collect
- Host / context
&mut dyn ServerHost- NeoForge
- —
- Summary
- The properties of an admitted login's profile, before
LoginFinishedsends them (ServerLoginPacketListenerImpl.finishLoginAndWaitForClient): the name, ban, whitelist, capacity and duplicate-player checks have passed; configuration andplayer_come after.login propertiesstarts with the login's own, signedtexturesincluded when there are some, and none for an ordinary offline login; each mod gets the list the mods before it left, and the final list goes to login success and to the player's profile in the player list. The UUID and name are read-only, the login can't be refused here, and the hook can't wait for a profile lookup.
player_loom_ pattern_ select - Side
- server
- Contract
- listen
- Host / context
&mut dyn ServerHost- NeoForge
- —
- Summary
- A server player selected a loom pattern, after the loom menu accepted the button.
patternis the zero-based button index. Server-side.
player_map_ filled - Side
- server
- Contract
- listen
- Host / context
&mut dyn ServerHost- NeoForge
- —
- Summary
- A server player filled an empty map, after the filled map and its saved data were created. Server-side.
player_move - Side
- server
- Contract
- cancel
- Host / context
&mut dyn ServerHost- NeoForge
- —
- Summary
- A player's movement report is about to be applied: they would move from
fromtoto, or turn fromfrom_torotation to_(rotation [yaw, pitch]). Heard once for each validated report whose position or rotation differs from the player's last reported location, after the server's own validation and before the report is committed. That location is kept on the player's connection, apart from the accepted position: it is the position given to the listener before it runs, and the destination of every server-side teleport (a join, a teleport in the level, a level change, a respawn, the resend of an unconfirmed teleport, and the correction after a veto).fromis that location. Setcancelfor a real veto and not a rollback: the report is not applied and its bookkeeping is skipped, and the client is corrected to the accepted position and rotation through the existing teleport correction. The report was already seen by the server's own checks before the hook, and what a violation of those would have done still happens. The values are the exact ones: there is no once-per-tick accumulation and no threshold in the engine, so the mod filters (if (to - from).length() < 1.0 /skips anything under 1/16 of a block). Their state is swapped in (16.0 { return; } host.players().acting_,player() PlayerRef::).tell
player_name_ entity - Side
- server
- Contract
- listen
- Host / context
&mut dyn ServerHost- NeoForge
- —
- Summary
- A server player named a mob with a name tag, after its name and persistence changed and the tag was consumed. Server-side.
player_name_ format - Side
- both
- Contract
- collect
- Host / context
&dyn LoopContext- NeoForge
PlayerEvent.NameFormat- Summary
- A player's display name was formatted. Replace
displaynameto change it. Both sides:context.side()says which. It runs wherever vanilla asksPlayer.getDisplayName(): when a chat line, a join or leave line, a command's feedback, a death message or an advancement message is built, and for the name tag over a player (every frame it shows, so it is not asked when no mod listens). Answer from the arguments andcontextalone, and fast:contextholds the side, the registries and the settings of the resource generation, and a/builds the next one. A name the API can't carry (a component tree deeper than the text limit) skips the listeners for that call; areload displaynamethe engine can't take back is dropped, and the name stays as it was.
player_open_ sign - Side
- server
- Contract
- listen
- Host / context
&mut dyn ServerHost- NeoForge
- —
- Summary
- A server player opened a sign for editing, after the editor state was made.
frontselects the front or back side. Server-side.
player_passage_ cross - Side
- server
- Contract
- cancel
- Host / context
&mut dyn ServerHost- NeoForge
- —
- Summary
player's client crossedpassage(#3775), one of the player's level's, fromfrom(its feet before), and the server is about to follow: the move tofrompassed the move checks and both ends are tracked for the player, and the server has not yet worked out where the player comes out. Setcanceland the server refuses the crossing (PassageCrossRefusal::) and puts the player back atVetoed from, as a portal Immersive Portals'canTeleportEntityturns down does. A listener that removes the passage or teleports the player refuses it too. Server-side. Diverges from upstream: new hook.
player_pick_ item - Side
- server
- Contract
- cancel
- Host / context
&mut dyn ServerHost- NeoForge
- —
- Summary
- A server player picked an item from a block or entity, before it enters the hotbar.
posis zero for an entity;entity_is zero for a block. The player's state is swapped in. Setid cancelto leave the inventory and client unchanged.
player_pickup_ arrow - Side
- server
- Contract
- listen
- Host / context
&mut dyn ServerHost- NeoForge
- —
- Summary
- A server player picked up an arrow after it was removed and its pickup was applied.
itemis the arrow's pickup item id. Server-side.
player_pong - Side
- server
- Contract
- listen
- Host / context
&mut dyn ServerHost- NeoForge
- —
- Summary
- A connected
playersent a play-phase pong (ServerCommonPacketListenerImpl.handlePong). Runs on the server thread at the packet's turn in that connection's inbox.nameis the player's profile name;idis the signed 32-bit value the client sent. Unsolicited and repeated IDs are reported as-is: an ID does not prove the client answered a particularPlayerRef::. This notice is not cancellable and does not affect keep-alive latency. Configuration and status traffic do not fire it. Each listener gets its own event.send_ ping
player_ready_ arrow - Side
- server
- Contract
- listen
- Host / context
&mut dyn ServerHost- NeoForge
- —
- Summary
- A server player released a drawn bow with
arrowselected, by the use-item key or a mod'sLivingRef::. The player's state is swapped in.release_ using_ item
player_recipe_ book_ click - Side
- server
- Contract
- listen
- Host / context
&mut dyn ServerHost- NeoForge
- —
- Summary
- A server player's recipe book requested a known recipe be placed in their crafting grid.
recipeis the recipe id;allis the shift click form. Server-side.
player_recipe_ book_ settings_ change - Side
- server
- Contract
- listen
- Host / context
&mut dyn ServerHost- NeoForge
- —
- Summary
- A server player's authoritative recipe book pair changed.
bookis a typed RecipeBookIdentity, never a custom vanilla ordinal. Rejected and unchanged custom requests do not notify. The guest is not swapped in.
player_recipe_ discovered - Side
- server
- Contract
- cancel
- Host / context
&mut dyn ServerHost- NeoForge
- —
- Summary
- A recipe is about to be unlocked for a server player. Set
cancelto keep it locked. The player's state is not swapped in. Server-side.
player_respawn_ position - Side
- server
- Contract
- listen
- Host / context
&mut dyn ServerHost- NeoForge
PlayerRespawnPositionEvent- Summary
PlayerRespawnPositionEvent: whereplayerrespawns, once the server has found it: the bed or anchor they stand up at (facing it), or the world spawn's free column.original_andlevel original_are that point;position missing_says the bed or anchor was gone, so the player came back at the world spawn. Changerespawn_ block level,position,yawandpitchto choose their final destination; no preliminary placement is made.copy_(default: the block wasn't missing) says whether they keep their respawn point. Runs on the removed original player, beforeoriginal_ spawn_ position player_and placement. To change the point copied for future respawns, callclone event.player.set_here, even on death, and setrespawn_ config(host, ...) copy_to true. This does not change the current destination.original_ spawn_ position from_is true for the respawn after the End credits, false for death. An ordinary End portal teleport does not run this hook. Server-side.end_ fight
player_respawned - Side
- server
- Contract
- listen
- Host / context
&mut dyn ServerHost- NeoForge
PlayerEvent.PlayerRespawnEvent- Summary
player(name) respawned (NeoForge'sPlayerRespawnEvent): at the end ofPlayerList.respawn, after placement and initial synchronization, with the replacement in scope.end_is true after the End credits (the player keeps health, food and experience), false after death. An ordinary End portal teleport does not fire this hook. Server-side.conquered
player_riptide - Side
- server
- Contract
- listen
- Host / context
&mut dyn ServerHost- NeoForge
- —
- Summary
- 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.
player_save_ to_ file - Side
- server
- Contract
- listen
- Host / context
&mut dyn ServerHost- NeoForge
PlayerEvent.SaveToFile (not cancellable)- Summary
- 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.directoryis the world's player directory (players/): write your own file there, nameddata <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.
player_set_ spawn - Side
- server
- Contract
- cancel
- Host / context
&mut dyn ServerHost- NeoForge
PlayerSetSpawnEvent- Summary
- 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,/, and the copy to the replacement afterspawnpoint player_whenclone player_allows copying (by default unless the saved block was missing).respawn_ position posis the block position anddimensionits level;posis none when no point is set.forcedis/'s flag. Cancel to keep the current point, including a point already set on the replacement by a clone listener.spawnpoint player_is the server's entity id for the player. Server-side.entity_ id
player_shear_ entity - Side
- server
- Contract
- cancel
- Host / context
&mut dyn ServerHost- NeoForge
- —
- Summary
- A player shearing a mob is about to do so. Set
cancelto leave the mob and shears unchanged. The guest's state is swapped in. The listener may change the world: straight after it returns without cancelling, the game finds the mob again by its entity id and checks that it still exists, is not removed, and that the held stack keeps its item and count; if not, the click is spent and nothing is sheared.
player_shield_ disable - Side
- server
- Contract
- listen
- Host / context
&mut dyn ServerHost- NeoForge
- —
- Summary
- A server player's shield was disabled by a blocked melee hit. The shield cooldown is set immediately after this call. Server-side.
player_spawn_ phantoms - Side
- server
- Contract
- replace
- Host / context
&mut dyn ServerHost- NeoForge
PlayerSpawnPhantomsEvent- Summary
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.resultstarts empty, meaningDefault(skylight and sea level check);Allowskips that check andDenystops the attempt.phantomsstarts with a randomly drawn group size; set it to override the count. Without mods the original draw order is kept.
player_sprint - Side
- server
- Contract
- listen
- Host / context
&mut dyn ServerHost- NeoForge
- —
- Summary
- A server player's sprint started or stopped: their client sent
START_orSPRINTING STOP_(the sprint key, a double tap forward, or letting go) and the server's player is nowSPRINTING sprinting(vanilla'ssetSprintinginhandlePlayerCommand). 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 andPlayerRef::work. Once for each change, on a server.tell
player_start_ spectating_ entity - Side
- server
- Contract
- listen
- Host / context
&mut dyn ServerHost- NeoForge
- —
- Summary
- A server player started spectating
entity_, after their camera moved to it (id ServerPlayer.setCamerawith a new target: a spectator's click or/) and their client was told. Heard once per change of target, not again while the camera follows it. The mirror ofspectate player_.stop_ spectating_ entity
player_start_ tracking - Side
- server
- Contract
- listen
- Host / context
&mut dyn ServerHost- NeoForge
PlayerEvent.StartTracking- Summary
- A client started tracking an entity (NeoForge's
PlayerEvent.StartTracking, posted at the end ofServerEntity.addPairing):player(name) has just been sent the spawn bundle ofentity(its ID,uuidits UUID,kindits type,minecraft:zombie) and counts as tracking it. It came into range, its client's chunks reached it, or it was put in the level; another player is an entity too, and a player never tracks their own. The entity is still in the level. What a listener sends the player (PlayerRef::) reaches it right after that bundle, before the entity's next changes. Heard in the tick's tracking pass, after the pass has built every player's packets: the player already counts as tracking the other entities the same pass paired. The engine is still walking its tracker: read the game and send payloads, but don't spawn, remove or teleport entities from here. No player's state is swapped in. Server-side.send_ payload
player_stat_ award - Side
- server
- Contract
- cancel
- Host / context
&mut dyn ServerHost- NeoForge
StatAwardEvent- Summary
- A statistic is about to be awarded to a server player, before its count and scoreboard criteria change.
stat_andtype statare ids such asminecraft:minedandminecraft:stone, andvaluethe amount. All three may be rewritten; ids must use their canonical namespaced spelling. Unknown types or entries, noncanonical ids and negative amounts are refused together, warning once and keeping the entire original award. Setcancelto 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.
player_stays_ on_ ground_ surface - Side
- both
- Contract
- listen
- Host / context
&dyn LoopContext- NeoForge
- —
- Summary
- 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).entityis the player's id; a mod may changestaying, 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 loopcontextof 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.
player_stonecutter_ recipe_ select - Side
- server
- Contract
- listen
- Host / context
&mut dyn ServerHost- NeoForge
- —
- Summary
- A server player selected a stonecutter recipe, after the menu accepted its button.
recipeis the zero-based button index. Server-side.
player_stop_ spectating_ entity - Side
- server
- Contract
- listen
- Host / context
&mut dyn ServerHost- NeoForge
- —
- Summary
- A server player stopped spectating
entity_, after their camera returned to the player.id
player_stop_ tracking - Side
- server
- Contract
- listen
- Host / context
&mut dyn ServerHost- NeoForge
PlayerEvent.StopTracking- Summary
- A client stopped tracking an entity (NeoForge's
PlayerEvent.StopTracking, posted at the end ofServerEntity.removePairing):entitywent out of range, left the level or died, orplayer(name) left, changed level or respawned, which stops everything they tracked.entity,uuidandkindare asplayer_told, once for each start; the player no longer counts as tracking it. A stop of the tracking pass is heard right after the removal packet, and what a listener sends the player reaches it after that removal. A leaving player's stops come afterstart_ tracking player_; those of a respawn or a level change, which send their own removals, at the next tracking pass. The entity is not necessarily still there, and a player who left is gone. As inlogged_ out player_, the engine is walking its tracker: don't spawn, remove or teleport entities from here. No player's state is swapped in. Server-side.start_ tracking
player_stop_ using_ item - Side
- server
- Contract
- listen
- Host / context
&mut dyn ServerHost- NeoForge
- —
- Summary
- A server player released the use-item key, or a mod's
LivingRef::did, before the item finished being used. The player's state is swapped in.release_ using_ item
player_swap_ hands - Side
- server
- Contract
- cancel
- Host / context
&mut dyn ServerHost- NeoForge
LivingSwapItemsEvent.Hands- Summary
- Heard before a non-spectator player's swap-hands action. The two mutable stacks start as the off-hand and main-hand stacks; the hands receive the listener's outputs unless it cancels. slots. Set
cancelto keep the items where they are: the player's client is sent both slots again. The player's state is swapped in, sohost.players().acting_,player() PlayerRef::and the item helpers reach them. Once for each press, on a server: a LAN or dedicated server's players, the single-player owner and a LAN host. Not heard: the same swap made in an open inventory (hovering a slot and pressing the key, a menu click).tell
player_swap_ with_ equipment_ slot - Side
- server
- Contract
- listen
- Host / context
&mut dyn ServerHost- NeoForge
- —
- Summary
- A server player swapped their main and off hands, after both inventory slots changed. Server-side.
player_switch_ hotbar_ slot_ post - Side
- server
- Contract
- listen
- Host / context
&mut dyn ServerHost- NeoForge
PlayerSwitchHotbarSlotEvent.Post- Summary
PlayerSwitchHotbarSlotEvent.Post: a server player switched from hotbar slotold_toslot new_(0 to 8), after the selected slot changed and a main-hand item use stopped. Fired only when the slot differs andslot player_didn't cancel it. The player's state is not swapped in.switch_ hotbar_ slot_ pre
player_switch_ hotbar_ slot_ pre - Side
- server
- Contract
- cancel
- Host / context
&mut dyn ServerHost- NeoForge
PlayerSwitchHotbarSlotEvent.Pre- Summary
PlayerSwitchHotbarSlotEvent.Pre: a server player is switching from hotbar slotold_toslot new_(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. Setslot cancelto keep the old slot; the client is sent that slot again, andplayer_doesn't fire.switch_ hotbar_ slot_ post
player_tab_ list_ name_ format - Side
- server
- Contract
- collect
- Host / context
&dyn LoopContext- NeoForge
PlayerEvent.TabListNameFormat- Summary
- ServerPlayer.getTabListDisplayName: the name the Tab list shows for
player, None to let the client choose it. Replacedisplay_to change it. It runs while the Tab list is built. Answer from the arguments andname contextalone, and fast:contextholds the side, the registries and the settings of the resource generation, and a/builds the next one. A name the API can't carry skips the listeners for that call; areload display_the engine can't take back is dropped, and the name stays as it was.name
player_take_ lectern_ book - Side
- server
- Contract
- listen
- Host / context
&mut dyn ServerHost- NeoForge
- —
- Summary
- A server player took the book from a lectern, after the menu and block entity changed.
bookis the removed item id. Server-side.
player_teleport_ end_ gateway - Side
- server
- Contract
- cancel
- Host / context
&mut dyn ServerHost- NeoForge
- —
- Summary
- A server player is about to travel through an End gateway at
gateway. Setcancelto leave them at the entrance; the gateway is not consumed and its cooldown does not start. Server-side.
player_teleported - Side
- server
- Contract
- listen
- Host / context
&mut dyn ServerHost- NeoForge
- —
- Summary
- A server player a command teleported (NeoForge's
EntityTeleportEvent, for a player):/andtp /, inside their level or into another one.teleport fromandtoare their feet before and after,dimensionthe 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 andPlayerRef::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.tell
player_tick_ post - Side
- both
- Contract
- listen
- Host / context
HostSide- NeoForge
PlayerTickEvent.Post- Summary
- After a player's tick on both logical sides (NeoForge 26.3
PlayerTickEvent.Post). Non-cancellable. On the client, fires through death tick 20, but not after the local player is removed.playeris the same identity as inplayer_; 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. On the server, neither player tick hook fires for a spectator whose bounds touch an unloaded chunk; that player's body tick is skipped.tick_ pre
player_tick_ pre - Side
- both
- Contract
- listen
- Host / context
HostSide- NeoForge
PlayerTickEvent.Pre- Summary
- Before a player's tick on both logical sides (NeoForge 26.3
PlayerTickEvent.Pre). Non-cancellable. On the client, fires through death tick 20, but not after the local player is removed.playeridentifies the ticked player; on the server their state is acting. Fires before sleep, cooldowns and body work. Players still tick under/, but not while the level is paused. On the server, neither player tick hook fires for a spectator whose bounds touch an unloaded chunk; that player's body tick is skipped.tick freeze
player_toggle_ entity_ age_ lock - Side
- server
- Contract
- listen
- Host / context
&mut dyn ServerHost- NeoForge
- —
- Summary
- A server player toggled an ageable mob's age lock with a golden dandelion, after the lock and item use changed.
player_toggle_ flight - Side
- server
- Contract
- cancel
- Host / context
&mut dyn ServerHost- NeoForge
- —
- Summary
- A player's client started (
flying) or stopped flying (vanilla'shandlePlayerAbilities, 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, soPlayerRef::and the other helpers reach them. The player is already flying or not as asked, as vanilla leaves them; settell cancelto 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 (/), and not a LAN host's own player.gamemode
player_toggle_ sneak - Side
- server
- Contract
- listen
- Host / context
&mut dyn ServerHost- NeoForge
- —
- Summary
- 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.
player_totem - Side
- server
- Contract
- listen
- Host / context
&mut dyn ServerHost- NeoForge
- —
- Summary
- 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'sEntityResurrectEvent), 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, sohost.players().acting_,player() PlayerRef::and the item helpers reach them. When a fall triggered the totem, the same landing is still in progress. Once for each totem, on a server; the host of a LAN world's totem is not heard.tell
player_trade - Side
- server
- Contract
- listen
- Host / context
&mut dyn ServerHost- NeoForge
- —
- Summary
- A server player completed a villager or wandering trader trade.
entity_is the merchant network id. Server-side.id
player_unleash_ entity - Side
- server
- Contract
- listen
- Host / context
&mut dyn ServerHost- NeoForge
- —
- Summary
- A server player removed an entity's leash, after it was cleared.
player_velocity - Side
- server
- Contract
- listen
- Host / context
&mut dyn ServerHost- NeoForge
- —
- Summary
- A server applied
velocityto a player, when syncing changed motion to that player's client.
player_xp_ change - Side
- server
- Contract
- cancel
- Host / context
&mut dyn ServerHost- NeoForge
PlayerXpEvent.XpChange- Summary
- A server player's experience points are about to change through
Player.giveExperiencePoints(NeoForge'sPlayerXpEvent.XpChange): an orb pickup after mending, an advancement reward, or/. Change the signedxp add ... points amount(in points) or setcancelto give nothing. Experience bottles and furnaces make orbs, so they come through the orb path. Server-side.
player_xp_ level_ change - Side
- server
- Contract
- cancel
- Host / context
&mut dyn ServerHost- NeoForge
PlayerXpEvent.LevelChange- Summary
- A server player's level is about to change through
Player.giveExperienceLevels: once per level gained or lost by points, and for the anvil,/andexperience add ... levels PlayerRef::. Changegive_ levels levels, or setcancelto leave the level unchanged. The player's state is swapped in, sohost.players().acting_,player() PlayerRef::and the item helpers reach them. Server-side.tell
portal_create - Side
- server
- Contract
- listen
- Host / context
&mut dyn ServerHost- NeoForge
- —
- Summary
- A Nether portal was built for a dimension travel, or an End platform was made for an arrival.
posis the lower corner of the Nether portal rectangle or the End platform origin. The completed blocks are already in the world.
portal_spawn - Side
- server
- Contract
- cancel
- Host / context
&dyn LevelHost- NeoForge
BlockEvent.PortalSpawnEvent- Summary
- A fire placed at
pos(state) found an empty obsidian frame,shape, and is about to fill it with a nether portal (BlockEvent.PortalSpawnEvent, inBaseFireBlock.onPlace), in the Overworld or the Nether. Setcanceland no portal forms: the fire stays where it can survive, as without a frame. Server-side.
potential_spawns - Side
- server
- Contract
- cancel
- Host / context
&dyn Host- NeoForge
LevelEvent.PotentialSpawns- Summary
- 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.
potion_brew_ post - Side
- server
- Contract
- listen
- Host / context
&mut dyn ServerHost- NeoForge
PotionBrewEvent.Post- Summary
- A brewing stand at
posbrewed (PotionBrewEvent.Post, at the end ofBrewingStandBlockEntity.doBrew), orpotion_was cancelled:brew_ pre stacksholds 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, asdoBrewends: afterbrewing_, the brew sound and the ingredient's remainder dropping. Server-side.complete
potion_brew_ pre - Side
- server
- Contract
- cancel
- Host / context
&mut dyn ServerHost- NeoForge
PotionBrewEvent.Pre- Summary
- A brewing stand at
posis about to brew (PotionBrewEvent.Pre, inBrewingStandBlockEntity.doBrew):stacksis a copy of its five slots (three bottles, the ingredient, the fuel). Setcancelto skip vanilla's brew: the stand then takesstacksas the mods left them, uses no ingredient and plays no brew sound, andpotion_fires with those slots;brew_ post brewing_doesn't, as nothing was brewed. Uncancelled, changes tocomplete stacksare dropped. Server-side.
potion_splash - Side
- server
- Contract
- listen
- Host / context
&mut dyn ServerHost- NeoForge
- —
- Summary
- A thrown splash or lingering potion applied its hit effects.
prepare_hopper_ transfer - Side
- server
- Contract
- listen
- Host / context
&mut dyn ServerHost- NeoForge
- —
- Summary
- A hopper at
posbegan 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.
prepare_item_ craft - Side
- server
- Contract
- replace
- Host / context
&mut dyn ServerHost- NeoForge
- —
- Summary
- A crafting-grid result was prepared for a server player;
posis the crafting table, or None for the inventory grid. Changeresultbefore it is sent. An accepted result retains valid damage even when it exceeds that stack's maximum durability.
prepare_item_ enchant - Side
- server
- Contract
- listen
- Host / context
&mut dyn ServerHost- NeoForge
- —
- Summary
- Enchanting offers were calculated for a server player at
pos. Changecostsbefore they are sent to the menu.
prepare_smithing - Side
- server
- Contract
- replace
- Host / context
&mut dyn ServerHost- NeoForge
- —
- Summary
- A smithing result was prepared for a server player at
pos. Change it before it is sent.
projectile_impact - Side
- server
- Contract
- cancel
- Host / context
&mut dyn ServerHost- NeoForge
ProjectileImpactEvent- Summary
- 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 typekind(minecraft:arrow), shot byowner(a mob's or a player's entity id, 0 for none) in the leveldimension. It hit the entityentityof typeentity_(a player iskind minecraft:player; a dragon's part isminecraft:ender_), or, withdragon entityNone, the block atblockon itsface(the face's normal,[0, 1, 0]for the top), at the pointat. Setcanceledand 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. Cancellation alone leaves the projectile alive. Resolve the live owner withhost.entity(event.projectile)and callEntityRef::to consume it instead. Removal suppresses the hit even if the event is not canceled. A decision invalidated by listener writes is not recomputed. A flying bobber skips hooking and redirection to the hit point, but its ordinary move still stops against solid blocks. Water is not an impact. Bobbers notify before vanilla's entity deflection and world-border bounce; rockets notify after deflection and cancellation skips their impact explosion only. Covers arrows, tridents, thrown items, fireballs, wither skulls, wind charges, llama spit, shulker bullets, bobbers and rockets. Other families skip breeze deflections and hits on wind charges. A dragon part or End crystal is told by the id of the dragon or crystal. Heard only when a mod also setsdiscard hears_. Server-side. Version 2 adds bobbers and rockets; listeners retaining the earlier family set filter outprojectile_ impacts minecraft:fishing_andbobber minecraft:firework_.rocket
projectile_launch - Side
- server
- Contract
- listen
- Host / context
&mut dyn ServerHost- NeoForge
- —
- Summary
- A server projectile was added to the level.
playeris set only for a player launch; other sources have an emptyname.
raid_spawn_ wave - Side
- server
- Contract
- listen
- Host / context
&mut dyn ServerHost- NeoForge
- —
- Summary
- A raid wave has been spawned at
pos;waveis its one-based wave number andraiderscounts the raiders, not the mobs they ride.
raid_state_ change - Side
- server
- Contract
- listen
- Host / context
&mut dyn ServerHost- NeoForge
- —
- Summary
- A server raid at
poschanged tostate(triggered,victory,lossorstopped).raididentifies its owning level, including a parked level. A terminal raid already removed from storage cannot be read.
recipe_book_ categories - Side
- both
- Contract
- listen
- Host / context
HostSide- NeoForge
- —
- Summary
- 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::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.displays
recipe_property_ sets - Side
- both
- Contract
- collect
- Host / context
&dyn DataLoadContext- NeoForge
RegisterRecipePropertiesEvent- Summary
- Items a mod's own recipe type takes in a station slot, added to the recipe property sets (
RecipeManager.RECIPE_): what a furnace, blast furnace, smoker, campfire, smithing table slot or brewing stand slot accepts, and what a client predicts it accepts. Push onePROPERTY_ SETS RecipePropertyAdditionper set to add to; the vanilla recipes' own items stay in. Called once per load, after the recipes are resolved, with theDataLoadContextof the load that owns them (origin()ServerDataLoadon a server,ClientPreloadon a client's own load), and again after/. A new namespaced key creates a set when its namespace belongs to the listener's manifest (its ID orreload namespaces) or to a content package it serves (served_). 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. A client without this mod predicts vanilla here; the server corrects it.by
recipe_sources - Side
- server
- Contract
- collect
- Host / context
&mut dyn ServerHost- NeoForge
- —
- Summary
- Additional ingredient containers for server player
playerplacing or checking a recipe in the mod crafting menumenu(namespace:path) atpos. The player's state is not swapped in. Push block positions tosources; containers are used after the player's inventory, in mod order and then push order. The engine silently skipspos, duplicates (first wins), unavailable or non-lendable containers, and all containers after the first 64 accepted sources, without per-call logging. Chest-like block entities and mod containers with declared slots are lendable. No answer preserves vanilla placement. The engine takes ingredients and writes changed containers back, firingcontainer_; this hook only names sources. Asked once per recipe-book placement/apply or server transfer check, not per tick.changed
recipes_received - Side
- client
- Contract
- listen
- Host / context
&mut dyn ClientHost- NeoForge
RecipesReceivedEvent- Summary
- The server's recipes of
recipe_arrived (NeoForge'stypes RecipesReceivedEvent): from now on the recipe helpers (native_,recipes native_) give the server's recipes of those types in place of the window's own, so rebuild what you made of them. Vanilla serializers expose resolved candidates, not native ingredient predicates; matching on the server remains authoritative. The window retains the resolved recipes of the types not sent. It comes after a join, once the window has its player, and after everyrecipes_ of_ type /, on a server whose mods asked for them (reload native_), single player included; with no types when the server stopped sending them and the window is back on its own recipes. A recipe's recipe book ids are not part of what arrives:datapack_ sync recipe_answers them. Client-side.book_ ids
register_block_ state_ models - Side
- client
- Contract
- collect
- Host / context
&RegistrationContext- NeoForge
RegisterBlockStateModels- Summary
- Register the block-state definition types a mod adds (NeoForge's
RegisterBlockStateModels, itsregisterDefinition). Asked once at start on the client, before resources load. UseRegisterBlockStateModelsEvent::to bind each type identifier to its provider callback; a blockstate file whoseregister neoforge:definition_names a registered id invokes that provider directly on every load and reload. Any validtype <namespace>:<path>identifier is accepted; a later registration for the same id replaces the earlier one.
register_block_ tint_ sources - Side
- client
- Contract
- listen
- Host / context
&RegistrationContext- NeoForge
RegisterColorHandlersEvent.BlockTintSources- Summary
- The tint sources of blocks (NeoForge's
RegisterColorHandlersEvent.BlockTintSources, vanilla'sBlockColors.register):register(layers, blocks), and a model face withtintindexi 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 ownBlockTintSource. 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. If this listener panics or a phase call is refused, none of its registrations take effect.
register_cauldron_ fluid_ content - Side
- server
- Contract
- listen
- Host / context
&RegistrationContext- NeoForge
RegisterCauldronFluidContentEvent- Summary
- 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. Giveevent.contents.register(block, fluid, total, level)the block and fluid keys yourregisterhook 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. If this listener panics or a phase call is refused, none of its registrations take effect.
register_cauldron_ interaction - Side
- both
- Contract
- listen
- Host / context
&RegistrationContext- NeoForge
RegisterCauldronInteractionEvent- Summary
- Register cauldron item interactions, by exact item or by item tag, on both sides before snapshot publication. Vanilla dye tags take precedence, then item tags in registration order, then exact items; registering the same key again overwrites the entry in place. Registered callbacks run on the server through
Interaction::. A panic or phase refusal discards that listener's entries, including queued registrations to all dispatchers, before the next listener runs.interact
register_client_ commands - Side
- client
- Contract
- collect
- Host / context
&mut dyn ClientHost- NeoForge
RegisterClientCommandsEvent- Summary
- The client's own commands (NeoForge's
RegisterClientCommandsEvent), whichcommandruns: push aCommandper 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 nonzerolevelis left out.
register_client_ item_ extensions - Side
- client
- Contract
- listen
- Host / context
&RegistrationContext- NeoForge
RegisterClientExtensionsEvent- Summary
- Register this load's worn equipment models, textures and item providers together. Registration is client-only and repeats on every resource load, before any reload listener applies. The validated bindings are installed with the candidate models. Models are baked once and may use any namespace owned by the registering mod (its manifest namespaces or a content package it serves via
served_); frame callbacks choose references, never geometry. A duplicate item provider or an unknown texture returned by a completed listener refuses preparation with a named diagnostic. A panic or phase refusal discards that listener's models, textures and item providers together. Do not retain references from a discarded registration. Server-only packages cannot listen.by
register_client_ tooltip_ component_ factories - Side
- client
- Contract
- listen
- Host / context
&RegistrationContext- NeoForge
RegisterClientTooltipComponentFactoriesEvent- Summary
- Register client tooltip component factories for custom
TooltipComponentDatatypes (NeoForge'sRegisterClientTooltipComponentFactoriesEvent). Asked once at client startup. Callevent.factories.register::to map each custom<MyData, MyClientComponent>(|data| ...) TooltipComponentproduced byItemPart::ortooltip_ image render_into atooltip_ gather_ components ClientTooltipComponentthat measures and draws itself. A later registration for the same type replaces the earlier one. A listener that panics leaves all previously registered factories in place and publishes none of its own.
register_color_ resolvers - Side
- client
- Contract
- listen
- Host / context
&RegistrationContext- NeoForge
RegisterColorHandlersEvent.ColorResolvers- Summary
- The colour resolvers block tints blend over the biomes around a block (NeoForge's
RegisterColorHandlersEvent.ColorResolvers):register(resolver)adds the mod's ownBiomeColorResolverand returns theColorResolverto pass toClientHost::orbiome_ tint BlockAndTintGetter::. 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, beforeblock_ tint register_and before resources load. If this listener panics or a phase call is refused, none of its registrations take effect.block_ tint_ sources
register_commands - Side
- server
- Contract
- collect
- Host / context
&mut dyn ServerHost- NeoForge
RegisterCommandsEvent- Summary
- The commands native mods add to the server's command tree: push each usage with its executor attached by
Command::. Asked whenever the server builds its command tree, as the reference loader'sexecutes Commandsdoes: when a world opens (a dedicated server, a LAN host, single player's server thread), before its functions load, so a function line may name your command; on each/and data pack change, so a command you stop pushing is refused by the next functions loaded; and after a mod callsreload host.commands().refresh_. Every player's chat box completes them as vanilla's, within their level. A usage under a root vanilla owns merges into it, ascommands() RegisterCommandsEventregisters into vanilla'sCommandDispatcher(Brigadier'sCommandNode.addChild): vanilla's usages and permissions stay, the mod's children are added beside them, and an executor at a vanilla node replaces vanilla's (seeCommand). A lower-level child opens traversal through a prefix without changing that prefix's own execution permission. When accepted usages execute at the same node (including optional prefixes), each later accepted registration overwrites that node's executor (matching Brigadier'sCommandNode.addChild, which setschild.command = node.getCommand()) together with Sunrise's paired execution permission level for that node. Only that node's executor runs, attributed to its mod; if the owner is disabled, execution is refused rather than handed to another mod. Clients get the command tree, not executors. An argument's kind is one ofword,text,integer,integer(min,max),long,long(min,max),number,boolean,player,item,block_andpos vec3, or a command argument type a mod registered (Registrar::), named by its namespaced id.register_ command_ argument
register_configs - Side
- both
- Contract
- collect
- Host / context
&dyn ConfigContext- NeoForge
ModContainer.registerConfig- Summary
- The config files native mods keep (NeoForge's
registerConfig): push yours, each of a kind, with the text written toconfig/when the file is missing. Asked by the window when the game starts (itsClientandCommonconfigs), by a dedicated server when it starts (CommonandServer) and by a server before each world it opens (Server); a game reads only its own kinds, so push them all every time. Receives aConfigContextwith settings reads and the scopedConfigFilesservice. A file outsideconfig/, or one already registered, is skipped.
register_configuration_ tasks - Side
- server
- Contract
- listen
- Host / context
&mut dyn ServerHost- NeoForge
RegisterConfigurationTasksEvent- Summary
- Append tasks for this connecting profile, on the server thread after the built-in configuration steps. Runs for every peer, including vanilla. The profile has no player handle yet. Use
event.connection.has_to check what the peer negotiated andchannel event.register(task)to give this connection an owned task. Tasks start in registration order, including tasks of the same type, and can finish, wait or fail this peer. A panic while reading a task's type refuses admission and disables that task implementation for its mod. If a registration listener itself panics, only its staged tasks, diagnostic and journaled writes are discarded. Other listeners still configure the same peer, and the panicking registration listener is skipped for later peers. Delayed tasks complete viaIPayloadContext::with their task type from either a server main-thread or network-thread configuration payload handler. There is no task timeout: answering keep-alives can hold configuration indefinitely. A silent or disconnected connection still ends normally.finish_ configuration_ task
register_debug_ entries - Side
- client
- Contract
- collect
- Host / context
&RegistrationContext- NeoForge
RegisterDebugEntriesEvent- Summary
- Register F3 debug entries once at client startup (NeoForge's
RegisterDebugEntriesEvent). Each mod receives an empty batch. PushDebugEntry::with its line callback ortext DebugEntry::for a renderer toggle. Callrenderer DebugEntry::to opt an entry into showing under reduced debug info (defaultwith_ reduced_ debug_ info false, matching vanilla'sDebugScreenEntry.isAllowed). Text callbacks run only while their entry is visible. Malformed or duplicate IDs (including built-in vanilla entry IDs) are logged and left out.
register_debug_ renderers - Side
- client
- Contract
- collect
- Host / context
&RegistrationContext- NeoForge
RegisterDebugRenderersEvent- Summary
- Collect world-space debug renderers at each client renderer-list refresh (NeoForge's
RegisterDebugRenderersEvent). PushDebugRenderer::for each renderer that should run until the next refresh. Usenew(draw) event.is_to gate a renderer on a vanilla or startupdebug_ entry_ enabled(id) DebugEntryswitch, or push unconditionally.
register_dimension_ transition_ screen - Side
- client
- Contract
- collect
- Host / context
&RegistrationContext- NeoForge
RegisterDimensionTransitionScreenEvent- Summary
- Register loading-screen factories once at client startup (NeoForge's
RegisterDimensionTransitionScreenEvent). Each mod receives an empty batch. Conditional pairs take priority over incoming, then outgoing. The first valid factory for a key wins. Unmatched travel, login and death use vanilla for a new screen. The client keeps whichever presentation is already open on an in-place load update.
register_enchantment_ damage_ effects - Side
- server
- Contract
- listen
- Host / context
&RegistrationContext- NeoForge
RegisterEvent- Summary
- Register namespaced enchantment damage value effects once before content loads. Custom nodes in
minecraft:damage, including nestedminecraft:all_, 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. If this listener panics or a phase call is refused, none of its registrations take effect.of
register_entity_ layers - Side
- client
- Contract
- listen
- Host / context
&RegistrationContext- NeoForge
EntityRenderersEvent.AddLayers- Summary
- The layers a mod adds to living entity renderers (NeoForge's
EntityRenderersEvent.AddLayers):add(target, layer), and every living entity of the type, or every player of the player model, in view drawsEntityRenderLayer::after its model and the layers added before. The final body model is borrowed forsubmit submit; it isNonewhen no body was posed, as after a successful replacement renderer.entity_,types is_,living player_andmodels has_tell what renderers this load built. A target that is no living entity type is refused by name. Asked on the client on every resource load, the first one and each reload, after the renderers resolve (mod_ renderer register_): layers don't carry over from one load to the next, so add them again each time. In the ordered body pass, layers submit in level join order, interleaved with general entity renderer submissions. If this listener panics, none of its registrations take effect; later listeners still register in the same order.entity_ renderers
register_entity_ renderers - Side
- client
- Contract
- listen
- Host / context
&RegistrationContext- NeoForge
EntityRenderersEvent.RegisterRenderers- Summary
- The code-defined renderers of entity types (NeoForge's
EntityRenderersEvent.RegisterRenderers,registerEntityRenderer):register(type, renderer), and every entity of the typetype(mymod:bolt) in view is drawn byEntityRenderer::in place of the type's own drawing. A later registration for a type replaces the earlier one; a type the game does not know is logged with its id and draws nothing new. Asked once at start on the client, before resources load; the game resolves each type's renderer on every resource load. This build draws the registered renderers of content mods' thrown types, of the living types drawn as mobs (in place of the model and its vanilla layers), of primed TNT (in place of the flashing cube), of experience orbs (in place of the billboarded orb quad) and of paintings (in place of the painting's quads) and of item frames and glow item frames (in place of the frame model and the item or map on its face); general entity types draw only through their renderer, if registered. That renderer reads the published generation of synced attachments throughsubmit EntityRenderState::. Other entity families keep their own drawing, including the dragon and end crystals. General, living, primed TNT and experience orb renderers submit at each entity's slot in level join order. If this listener panics, none of its registrations take effect.attachments
register_entity_ spectator_ shaders - Side
- client
- Contract
- collect
- Host / context
&RegistrationContext- NeoForge
RegisterEntitySpectatorShadersEvent- Summary
- 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. Pass eachEntitySpectatorShadertoevent.register(shader). 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.
register_fluid_ models - Side
- client
- Contract
- collect
- Host / context
&RegistrationContext- NeoForge
RegisterFluidModelsEvent- Summary
- The models of your world fluids (NeoForge's
RegisterFluidModelsEvent): callevent.register(model)with aFluidModelper 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.
register_game_ tests - Side
- server
- Contract
- listen
- Host / context
&dyn Host- NeoForge
RegisterGameTestsEvent- Summary
- 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. A listener that panics or incurs a phase refusal publishes neither its definitions nor its functions.
register_gui_ layers - Side
- client
- Contract
- listen
- Host / context
&RegistrationContext- NeoForge
RegisterGuiLayersEvent- Summary
- Register, wrap or replace a HUD layer with an owned draw callback (NeoForge's
RegisterGuiLayersEvent). Asked once at client startup. The installed body runs betweengui_andlayer_ pre gui_unless Pre cancels it. Uselayer_ post event.layers.register(id, placement, Box::to insert a new slot, ornew(draw)) replace_andlayer wrap_to change an existing slot's body.layer minecraft:player_is the heart slot only. Usehealth minecraft:air_as thelevel Aboveanchor to place a layer above all status rows. A status replacement or wrapper runs even when the original body would not draw, including under F1. A listener sees its pending edits; they publish only after a successful return. A panic during registration, including while dropping a superseded staged body, disables that listener for the session and reports its mod in the log and client error toast.
register_item_ models - Side
- client
- Contract
- collect
- Host / context
&RegistrationContext- NeoForge
RegisterItemModelsEvent- Summary
- Register the item model node types a mod adds (NeoForge's
RegisterItemModelsEvent). Asked once at start on the client, before resources load. UseRegisterItemModelsEvent::to bind each type identifier directly to its decode-time factory, which parses the node's JSON object throughregister ItemModelConfigonce on each load/reload, declares any nested child item models throughItemModelChildren, and returns the per-stack callback that pushesItemModelLayerchoices referencing those child keys. Any validIdentifier(includingminecraft:) is accepted; a later registration for the same id replaces the earlier one (last-writer-wins), and registering a built-in vanilla or engine item model type id overrides that built-in when decoding item definitions.
register_item_ tint_ sources - Side
- client
- Contract
- collect
- Host / context
&RegistrationContext- NeoForge
RegisterColorHandlersEvent.ItemTintSources- Summary
- Register the item tint sources a mod adds (NeoForge's
RegisterColorHandlersEvent.ItemTintSources). Asked once at start on the client, before resources load. UseRegisterItemTintSourcesEvent::to bind each tint source identifier directly to its decode-time factory, which parses the tint entry's JSON object once on each load/reload and returns the per-stack ARGB colour callback. Any validregister <namespace>:<path>identifier (includingminecraft:) is accepted; a later registration for the same id replaces the earlier one (last-writer-wins), and registering a built-in vanilla tint source id overrides that built-in when decoding item definitions.
register_json_ animation_ types - Side
- client
- Contract
- collect
- Host / context
&RegistrationContext- NeoForge
RegisterJsonAnimationTypesEvent- Summary
- Register the custom animation targets and interpolations a mod adds for keyframe animation files to name (NeoForge's
RegisterJsonAnimationTypesEvent). Asked once at start on the client, before resources load. UseRegisterJsonAnimationTypesEvent::andregister_ target RegisterJsonAnimationTypesEvent::to bind each identifier directly to its callbacks. Any validregister_ interpolation <namespace>:<path>identifier (includingminecraft:) is accepted; duplicates and collisions with the built-in targets (minecraft:position,minecraft:rotation,minecraft:scale) or built-in interpolations (minecraft:linear,minecraft:catmullrom) are rejected as registration errors.
register_layer_ definitions - Side
- client
- Contract
- collect
- Host / context
&RegistrationContext- NeoForge
EntityRenderersEvent.RegisterLayerDefinitions- Summary
- Register suppliers for entity model layers (NeoForge's
EntityRenderersEvent.RegisterLayerDefinitions). Called once at client startup. UseRegisterLayerDefinitionsEvent::to bind each layer ID to its supplier; accepted suppliers run once when the layer table is frozen. Bake the realized definitions throughregister ClientHost::. API @API:model_layers@.bake_ layer
register_load_ conditions - Side
- server
- Contract
- listen
- Host / context
&RegistrationContext- NeoForge
RegisterEvent- Summary
- Register named conditions once at mod load, before server data admission. Each handler is a raw-JSON handler: it reads the condition's JSON value. IDs may use any namespace, but a listener that completes with a built-in or duplicate ID error refuses mod load, even if it ignored the returned error. A listener that panics or incurs a phase refusal publishes neither handlers nor preparation errors. Whether an unknown ID refuses a load or skips a file is determined by the loader, not the namespace.
register_model_ loaders - Side
- client
- Contract
- collect
- Host / context
&RegistrationContext- NeoForge
ModelEvent.RegisterLoaders- Summary
- Register the model loaders a mod adds (NeoForge's
ModelEvent.RegisterLoaders). Asked once at start on the client, before resources load. UseRegisterModelLoadersEvent::to bind each loader identifier to its schema and bake callback. Each model and set of resolved texture slots invokes that callback once per load or reload. The callback's quads replace the cuboid geometry unless the loader explicitly delegates to the cuboid decoder. An absent required loader rejects its declaring model file. A reference to that file uses the missing model at that link without discarding a descendant's own geometry. Duplicates and collisions with built-ins (register neoforge:composite,neoforge:obj,fusion:model) are registration errors.
register_particle_ groups - Side
- client
- Contract
- collect
- Host / context
&RegistrationContext- NeoForge
RegisterParticleGroupsEvent- Summary
- Register the render groups a mod's particles draw in (NeoForge's
RegisterParticleGroupsEvent). Called once at client startup. UseRegisterParticleGroupsEvent::to bind an ID to a factory run once per particle engine construction. Sprite loads and reloads only resolve each particle type against the constructed groups.register
register_particle_ providers - Side
- client
- Contract
- listen
- Host / context
&RegistrationContext- NeoForge
RegisterParticleProvidersEvent- Summary
- Binds a logical client's sprite-set providers to already registered
ParticleTypes (NeoForge'sRegisterParticleProvidersEvent). Each provider creates particles from typed options, ticks its live particles in one batch, and extracts quads for visible particles. Later registration for the same type replaces the previous provider. Registration runs once before resources load; each reload rebinds the sprite sets and discards live provider particles. If this listener panics or a phase call is refused, none of its registrations take effect.
register_preset_ editors - Side
- client
- Contract
- collect
- Host / context
&RegistrationContext- NeoForge
RegisterPresetEditorsEvent- Summary
- Register client editor factories for world-preset keys once at startup (NeoForge's
RegisterPresetEditorsEvent). UseRegisterPresetEditorsEvent::to bind each preset identifier directly to its factory. Any validregister <namespace>:<path>identifier (includingminecraft:) is accepted; a later registration for the same preset replaces the earlier one (last-writer-wins), and registering a vanilla preset (minecraft:flat,minecraft:single_) overrides its built-in editor. Unregistered presets retain their built-in editor, or their disabled Customize button.biome_ surface
register_range_ select_ item_ model_ property - Side
- client
- Contract
- collect
- Host / context
&RegistrationContext- NeoForge
RegisterRangeSelectItemModelPropertyEvent- Summary
- Register the numeric
minecraft:range_item model properties a mod adds (NeoForge'sdispatch RegisterRangeSelectItemModelPropertyEvent). Asked once at start on the client, before resources load. UseRegisterRangeSelectItemModelPropertyEvent::to bind each property identifier directly to its decode-time factory, which parses theregister range_node's JSON object once on each load/reload and returns the per-stack numeric callback. Any validdispatch <namespace>:<path>identifier (includingminecraft:) is accepted; a later registration for the same id replaces the earlier one (last-writer-wins), and registering a built-in vanilla property id overrides that built-in when decoding item definitions.
register_render_ pipelines - Side
- client
- Contract
- collect
- Host / context
&RegistrationContext- NeoForge
RegisterRenderPipelinesEvent- Summary
- Register the mod's own render pipelines, once at client startup (NeoForge's
RegisterRenderPipelinesEvent; 1.21.1 mods usedRegisterShadersEvent): callevent.register(pipeline)with eachRenderPipeline. The game builds them with its own at startup and again on every resource reload. An id outside the mod's own or served (served_) namespaces, or one already registered, is logged with the mod and dropped. A required pipeline whose shader is missing or doesn't build fails the load: the game does not start, and a reload fails and keeps the previous resources. An optional) one is logged and resolves toby RenderPipelineError::.Invalid
register_select_ item_ model_ property - Side
- client
- Contract
- collect
- Host / context
&RegistrationContext- NeoForge
RegisterSelectItemModelPropertyEvent- Summary
- Register the categorical
minecraft:selectitem model properties a mod adds (NeoForge'sRegisterSelectItemModelPropertyEvent). Asked once at start on the client, before resources load. UseRegisterSelectItemModelPropertyEvent::to bind each property identifier directly to its decode-time factory, which parses theregister selectnode's JSON object once on each load/reload and returns both the per-casewhenvalue decoder (&Tag -> Result<T, String>) and the per-stack categorical callback (-> Option<T>). Any validIdentifier(includingminecraft:) is accepted; a later registration for the same id replaces the earlier one (last-writer-wins), and registering a built-in vanilla property id overrides that built-in when decoding item definitions.
register_special_ model_ renderer - Side
- client
- Contract
- listen
- Host / context
&RegistrationContext- NeoForge
RegisterSpecialModelRendererEvent- Summary
- Register factories for special item model types (NeoForge's
RegisterSpecialModelRendererEvent). Called once at client startup, before resources load. The last registration of a type wins, including for vanilla's types. Eachminecraft:specialnode is decoded and baked afresh on resource reload; the baked renderer submits to a scoped collector when the item is drawn. A listener that panics or incurs a phase refusal leaves the previous factories and replacement reports unchanged.
register_sprite_ sources - Side
- client
- Contract
- collect
- Host / context
&RegistrationContext- NeoForge
RegisterSpriteSourcesEvent- Summary
- Register the atlas sprite source types a mod adds (NeoForge's
RegisterSpriteSourcesEvent). Asked once at start on the client, before resources load. UseRegisterSpriteSourcesEvent::to bind each type identifier directly to its provider callback; an entry of an atlas definition'sregister sourceswhosetypeis a registered id invokes that provider at its place in the list, on every load and reload. Any valid<namespace>:<path>identifier (includingminecraft:) is accepted; a later registration for the same id replaces the earlier one, and registering a built-in vanilla source id overrides that built-in when decoding atlas definitions.
register_texture_ atlases - Side
- client
- Contract
- collect
- Host / context
&RegistrationContext- NeoForge
RegisterTextureAtlasesEvent- Summary
- Declare atlases beside the game's (
RegisterTextureAtlasesEvent). Callevent.register(atlas)with eachTextureAtlasRegistration, which names the atlas definition that lists its sprites. Called at first client load and every resource reload, before textures are stitched.
register_villager_ professions - Side
- server
- Contract
- listen
- Host / context
&RegistrationContext- NeoForge
RegisterEvent- Summary
- 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. NeoForge adds a profession through
RegisterEventonRegistries.VILLAGER_; this hook declares it as data, so only the registration moment corresponds. If this listener panics or a phase call is refused, none of its registrations take effect.PROFESSION
render_arm - Side
- client
- Contract
- cancel
- Host / context
&dyn ClientHost- NeoForge
RenderArmEvent- Summary
- Before this window's player's first-person
leftor right arm is drawn (RenderArmEvent, inrenderPlayerArmandrenderMapHand): the empty main hand's arm, and the arms under a held map, never while the player is invisible.playerandplayer_are the local player's UUID and entity id.entity_ id draw's pose stack starts at the arm model's origin, in blocks, posed as vanilla's arm is (with anyrender_), lit with the light at the eyes; add geometry withhand native_,draw_ cube native_,draw_ quad native_anddraw_ block native_. Setdraw_ item canceledto leave out vanilla's arm; what the mods drew stays. Client-side.
render_fog - Side
- client
- Contract
- listen
- Host / context
&dyn ClientHost- NeoForge
ViewportEvent.RenderFog- Summary
- Final world fog, after the computed color hook, ordinary calculations and Sunrise's fog option, before upload. Title panoramas skip it. Invalid color or distance values retain the original whole fog.
render_frame_ post - Side
- client
- Contract
- listen
- Host / context
&mut dyn ClientHost- NeoForge
RenderFrameEvent.Post- Summary
- Once a frame, in a world or not, right after the frame was rendered (NeoForge's
RenderFrameEvent.Post).elapsedis the frame's time. It fires for a frame that was skipped too;flip_is the moment a frame was presented.frame world_is the interpolation used by that frame, held while paused or frozen;partial_ tick partial_is the advancing window clock. Outside a world both use the window clock. Neither is recomputed after listeners run. Client-side.tick
render_frame_ pre - Side
- client
- Contract
- listen
- Host / context
&mut dyn ClientHost- NeoForge
RenderFrameEvent.Pre- Summary
- Once a frame, in a world or not, after Sunrise's extras and just before the frame is rendered (NeoForge's
RenderFrameEvent.Pre).elapsedis the frame's time.world_is the interpolation about to be drawn, held while paused or frozen;partial_ tick partial_is the window clock, which keeps advancing. Outside a world both use the window clock. Listener writes do not change this frame's captured interpolation. Client-side.tick
render_gui_ post - Side
- client
- Contract
- listen
- Host / context
&dyn ClientHost- NeoForge
RenderGuiEvent.Post- Summary
- After the complete in-world HUD layer walk (NeoForge's
RenderGuiEvent.Post), including under F1, and before the open screen draws. Place a box withevent.corners.place(boxes stack away from their edge) and draw withevent.draw. UseClientHost::to avoid drawing over the debug overlay. Not heard when a mod canceleddebug_ overlay_ visible() render_. A panicking listener's drawing and corner placement are both discarded. Client-side.gui_ pre
render_gui_ pre - Side
- client
- Contract
- cancel
- Host / context
&dyn ClientHost- NeoForge
RenderGuiEvent.Pre- Summary
- Before the in-world HUD layer walk (NeoForge's
RenderGuiEvent.Pre), including under F1. ReturnFlow::to skip the walk (including layer Pre and Post),Cancel render_and the HUD chat layer. Focused chat is drawn by its screen, not the layer walk. Toasts draw after the active screen or overlay and are outside this veto. F1 hides ordinary toasts and audio stream failure notices, but not other callback error toasts. Does not fire when a server dialog or the connection screen covers the world HUD. Client-side.gui_ post
render_hand - Side
- client
- Contract
- cancel
- Host / context
&dyn ClientHost- NeoForge
RenderHandEvent- Summary
- 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. Adjustrender's pose, draw in the hand withdraw, 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, andrender.handsays which one is asked. It is lit with the light at the eyes.HandDrawContext::submits either physical arm with the local avatar's skin, sleeve and model width, at the current draw pose and light. 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 andrender_ arm hand_see it as they see vanilla's hand. Unlike NeoForge, the pose stack isdrawn draw's own: turning it moves what you draw,render's pose moves the default geometry, and player render state is not exposed.
render_item_ in_ frame - Side
- client
- Contract
- cancel
- Host / context
&dyn ClientHost- NeoForge
RenderItemInFrameEvent- Summary
- Before a visible item frame's item or map is drawn. Cancel hides the item, not the frame.
render_level_ stage - Side
- client
- Contract
- listen
- Host / context
&dyn ClientHost- NeoForge
RenderLevelStageEvent- Summary
- Draw world geometry at one stage of a world view (NeoForge 26.3's
RenderLevelStageEvent), asked for eachRenderLevelStagein frame order.drawis the view'sWorldDrawContextand shares its limits withsubmit_; its lines and quads draw atcustom_ geometry stage, itsname_labels with the world's name tags. Client-only, noncancellable.tag
render_living_ post - Side
- client
- Contract
- listen
- Host / context
&dyn ClientHost- NeoForge
RenderLivingEvent.Post- Summary
- After a living entity is drawn (NeoForge's
RenderLivingEvent.Post): once a frame for each mob and player in view whoserender_wasn't canceled, after its model, its vanilla layers and the mods' layers.living_ pre entityis its render state, asrender_has it;living_ pre drawis posed at its feet, turned with its body, and what it draws is kept.event.modelborrows the finalcrate::the entity's layers saw, including custom pack models and the pose under layers-only draws. It is read-only and scoped to this callback. UseFrameModel part(name)or the hierarchy to read a part's localpose()and effectivevisibleflag after animation and Pre edits. A successful replacement renderer or other draw without a body pose suppliesNone. The order today: before this hook its model, its vanilla layers and the mods' layers are drawn; after it, the frame's later passes draw its name tag, its leash, and the flames of a burning entity and its shadow, each as its own pass. This hook neither sees nor replaces the flames and the shadow, and a canceledrender_doesn't stop them. A type with a mod's registered renderer (living_ pre register_) has the same later passes, the renderer in the model's place. The reference draws the leash and the name tag before this hook: that move is the follow-up in #1285. For a player, itsentity_ renderers render_follows. In the ordered body pass, each entity's hooks finish before the next entity's submission begins, including any general entity renderer at its own level join slot.player_ post
render_living_ pre - Side
- client
- Contract
- cancel
- Host / context
&dyn ClientHost- NeoForge
RenderLivingEvent.Pre- Summary
- Before a living entity is drawn (NeoForge's
RenderLivingEvent.Pre): once a frame for each mob and player in view (one the frame culls is not asked), before its pose, model and layers.entityis its render state (its id, kind, custom name, the frame's partial tick, its body and head turns and walk cycle,LivingEntityRenderState).drawis posed at its feet, turned with its body: +z the way it faces, +x its left, +y up, in blocks, with the helpers block entities draw with (cube,quad,block,item,model_); what it draws is kept. Setpart canceledto skip all of the entity's drawing this frame: its model, armour, held items and layers, the mods' layers, its name tag, leash and glowing outline, andrender_, and the renderer a mod registered for its type (living_ post register_), which draws in the model's place; a mod drawing a model of its own draws it here and cancels. The flames of a burning entity and its shadow, which the frame queues after the entity's drawing, still draw. A player'sentity_ renderers render_comes first and edits the sameplayer_ pre event.model; a cancel here still callsrender_withplayer_ post model: None.event.modellends the selected body's baked hierarchy and bind pose as acrate::. UseFrameModelEdit model.part("nose")to get a villager's nose index, thenmodel.hide(index)to leave it and its descendants out of the body and layers drawn on that model (such as a spider's eyes). Armour, held items and independent layers are unaffected. Missing names returnNone; invalid indices returnfalsewithout an edit. Edits last for this draw only;draw.keep()does nothing here. In the ordered body pass, this hook follows level join order, including this window's player at its own slot, interleaved with general entity renderer submissions.
render_name_ tag - Side
- client
- Contract
- listen
- Host / context
&dyn ClientHost- NeoForge
RenderNameTagEvent- Summary
- Name tag visibility and optional replacement text.
render_player_ post - Side
- client
- Contract
- listen
- Host / context
&dyn ClientHost- NeoForge
RenderPlayerEvent.Post- Summary
- After a player is drawn (NeoForge's
RenderPlayerEvent.Post): once a frame for each player whoserender_wasn't canceled, after itsplayer_ pre render_, or right after itsliving_ post render_when only that one was canceled.living_ pre player,whoanddraware asrender_has them, and what it draws is kept.player_ pre event.modelborrows the same finalcrate::asFrameModel render_, read-only for the callback. Its poses and effective visibility include this draw's animation, Skin Customization and Pre edits. It isliving_ post Noneif no body pose was produced, including when only Living Pre canceled. The player's name tag, leash, and the flames of a burning player and its shadow are each drawn in a later pass of the same frame, as inrender_. A canceled pre hook doesn't stop the flames or the shadow. In the ordered body pass, this player's pair finishes at its slot in level join order, before the next body submits, including bodies drawn by a general entity renderer.living_ post
render_player_ pre - Side
- client
- Contract
- cancel
- Host / context
&dyn ClientHost- NeoForge
RenderPlayerEvent.Pre- Summary
- Before a player is drawn (NeoForge's
RenderPlayerEvent.Pre): once a frame for each other player in view and for this window's player in third person (including front view) when it holds the camera, before itsrender_.living_ pre playeris its render state,whoits profile name and whether it is this window's own player, anddrawthe framerender_gets. Setliving_ pre canceledto skip the player's own drawing this frame,render_,living_ pre render_andliving_ post render_included. Canceling onlyplayer_ post render_skips Living Post but still calls Player Post withliving_ pre model: None. Either cancel leaves eligible flames and shadows to the frame; a replacement body should not submit them again.event.modelborrows the selected player's hierarchy and bind pose as acrate::. Look upFrameModelEdit model.part("head")and callmodel.hide(index)if it exists. That leaves the head and its children out for this draw after Skin Customization. Living Pre sees the same draw-local edits. Armour, held items and other independent layers, including the cape, are unaffected. In the ordered body pass, the pair wraps this player's living hooks at its slot in level join order, interleaved with general entity renderer submissions, for local and remote players alike.
render_tooltip_ gather_ components - Side
- client
- Contract
- cancel
- Host / context
&dyn ClientHost- NeoForge
RenderTooltipEvent.GatherComponents- Summary
RenderTooltipEvent.GatherComponents: the elements ofstack's tooltip (ItemStack.getTooltipLinesasTooltipElement::lines, plus anyText TooltipElement::supplied by the built-in bundle tooltip or the item'sComponent(TooltipComponent) ItemPart::), oncetooltip_ image item_has run and before any wrapping, factory preparation, or measuring. Add, change, reorder or remove elements; each element is then prepared into atooltip PreparedTooltipComponent(custom components via factories registered inregister_) beforeclient_ tooltip_ component_ factories render_runs. Gather wraps logical text in the item's tooltip font when it cannot fit on either side of the cursor. Assign a positive GUI-pixel width totooltip_ pre event.max_to further constrain wrapping (width -1by default). ReturnFlow::and nothing is drawn; neitherCancel render_nortooltip_ pre render_is asked. A panicking destructor of custom data published here disables this listener for the session without disabling other listeners. Asked each frame the tooltip shows, never for one the stack hides. An input conversion refusal skips Gather and preserves the unwrapped engine tooltip. Text is used in memory without serialized component limits. Client-side.tooltip_ texture
render_tooltip_ pre - Side
- client
- Contract
- cancel
- Host / context
&dyn ClientHost- NeoForge
RenderTooltipEvent.Pre- Summary
RenderTooltipEvent.Pre: a tooltip whose components have been prepared and are about to be measured, positioned and drawn.stackis the item the tooltip describes, orNonefor a non-item tooltip.componentsare the read-only prepared components (PreparedTooltipComponent, in display order, built-in and custom alike) asrender_and component preparation left them; measure them with a font borrowed viatooltip_ gather_ components draw.with_or inspect them withtooltip_ font(font, ...) as_,text as_, andbundle downcast_.ref placeholds the anchor point in GUI pixels beforepositioneradds its offset and keeps the box on screen; cursor anchors truncate to whole GUI pixels, and a widget positioner may ignore the anchor.screenis[screen_in GUI pixels.width, screen_ height] positioneris the activeClientTooltipPositionerthat places the tooltip box once measured. Text lines are wrapped only whererender_ran: with no Gather listener, each line arrives whole, as vanilla passes it. A stack that can't be converted skips Gather and Pre, and the engine's prepared tooltip is drawn as it is.tooltip_ gather_ components fontis the font identifier used for measurement and drawing (minecraft:default, or the item font, queried again before Pre); change it to measure and draw with a replacement font without rewrapping the lines. A prepared component'swidthandheightreturnNoneon failure, distinct from a valid size of zero. A failed component measurement or draw aborts the whole tooltip.drawis the tooltip's GUI drawing context; paint from Pre stays visible on cancellation or failure. ReturnFlow::and the tooltip box and components are not drawn andCancel render_is not asked. Asked each frame a tooltip shows, only while a mod listens. An input conversion refusal skips Pre and leaves the prepared tooltip intact. Client-side.tooltip_ texture
render_tooltip_ texture - Side
- client
- Contract
- listen
- Host / context
&dyn ClientHost- NeoForge
RenderTooltipEvent.Texture- Summary
RenderTooltipEvent.Texture: the look of a tooltip box about to be drawn. Settextureto a tooltip style (<namespace>:<name>) and the box draws as vanilla draws atooltip_: the GUI spritesstyle <namespace>:tooltip/and<name>_ background <namespace>:tooltip/from the resource packs, each nine-sliced as its<name>_ frame gui.scalingsays or stretched without one. A style whose background or frame no pack has keeps the fills, where vanilla draws the missing texture. LeftNone, the box is Sunrise's solid fills, inbackgroundand theborder_totop border_gradient, as ARGB.bottom stackis the item the tooltip describes,Nonefor a text tooltip. Asked each frame a tooltip shows, only while a mod listens. Client-side.
resolve_player_ skin - Side
- client
- Contract
- collect
- Host / context
&dyn ClientHost- NeoForge
- —
- Summary
- Select the local player's skin texture and model together, at vanilla's
AbstractClientPlayer.getSkinmoment. Asked once per frame with a local avatar, before the third-person body and skin layers, first-person arms and inventory previews are extracted. Client-side, with a read-only host; it does not change the player's profile, cape, tab-list entry or what other clients see.
resource_pack_ status - Side
- server
- Contract
- listen
- Host / context
&mut dyn ServerHost- NeoForge
- —
- Summary
- A server player's client answered a resource pack in play (vanilla's
ServerboundResourcePackPacket):statusisAction'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 andPlayerRef::work. The pack a dedicated server offers in the configuration (tell resource-packinserver.properties) is answered before the player has joined, and those answers are not heard. Once for each answer, on a server.
right_click_ block - Side
- both
- Contract
- cancel
- Host / context
HostSide- NeoForge
PlayerInteractEvent.RightClickBlock- Summary
- A player right clicks a block (NeoForge's
PlayerInteractEvent.RightClickBlock): once per hand, whereuseItemOnstarts, on the clicking client and on the server (clicksays which, with the block, the hit, the hand and its stack, and the player), for a spectator too (the server then only lets one open a menu). Before the block's own use (a chest, a door, a lever) and the item's (Item.useOn,native_).use_ on
right_click_ empty - Side
- client
- Contract
- listen
- Host / context
&mut dyn ClientHost- NeoForge
PlayerInteractEvent.RightClickEmpty- Summary
- The local player right-clicks empty space with an empty
hand. Client-side only; the server does not receive this event.
right_click_ item - Side
- both
- Contract
- cancel
- Host / context
HostSide- NeoForge
PlayerInteractEvent.RightClickItem- Summary
PlayerInteractEvent.RightClickItem, immediately beforeItem.use. Cancel skips its Part and vanilla behaviour; its result defaults toPass.Success,SuccessServerandConsumeend the client's hand loop.Successswings on the client,SuccessServeron the server, andConsumehas no swing. A client without this mod predicts vanilla here; the server corrects it.
screen_char_ typed_ post - Side
- client
- Contract
- listen
- Host / context
&dyn ClientHost- NeoForge
ScreenEvent.CharacterTyped.Post- Summary
- A typed character that neither the receiving screen nor its mounted widgets took (
ScreenEvent.CharacterTyped.Post, vanilla'sScreen.charTypedreturning false), once per printable character thatscreen_let through:char_ typed_ pre candmodifiersas there. Not cancellable (matching NeoForge'sScreenEvent.CharacterTyped.Post, which is an unhandled post-dispatch notice). Window characters (including IME commits and text without a physical key) and the control socket'stypefire it on the receiving screen when the matching Pre did not cancel. A held edit modifier makes a physical key a shortcut instead of text; a controller's keyboard does not synthesize this hook.
screen_char_ typed_ pre - Side
- client
- Contract
- cancel
- Host / context
&dyn ClientHost- NeoForge
ScreenEvent.CharacterTyped.Pre- Summary
- A character was typed at the open screen (
ScreenEvent.CharacterTyped.Pre, vanilla'sScreen.charTyped):screenis the screen it is,cthe character,modifiersGLFW's bits (shift 1, control 2, alt 4, super 8), andfielda copy of the focused text box. Setcanceledand that one character never reaches the focused child or text box.
screen_closing - Side
- client
- Contract
- listen
- Host / context
&dyn ClientHost- NeoForge
ScreenEvent.Closing- Summary
- The
screenthat was open is being replaced (ScreenEvent.Closing), afterscreen_let it.opening
screen_exclusion_ areas - Side
- client
- Contract
- collect
- Host / context
&dyn ClientHost- NeoForge
- —
- Summary
- The hook
native_asks: a mod adds the rectangles it draws overscreen_ exclusion screen(a side panel, a button column) toareas, 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'sIGuiContainerHandler.getGuiExtraAreas). Client-side.
screen_init_ post - Side
- client
- Contract
- listen
- Host / context
&dyn ClientHost- NeoForge
ScreenEvent.Init.Post- Summary
- A screen initialized or rebuilt its children (
ScreenEvent.Init.Post, vanilla'sScreen.init/Screen.rebuildWidgets). Useevent.widgetsto list and remove children or mount buttons, text fields, and custom widgets. A layout-only resize keeps the existing children and focus and does not fire this hook. A panicking listener publishes no edits.
screen_key_ pressed_ post - Side
- client
- Contract
- cancel
- Host / context
&dyn ClientHost- NeoForge
ScreenEvent.KeyPressed.Post- Summary
- A key press that neither the receiving screen nor its mounted widgets took (
ScreenEvent.KeyPressed.Post, vanilla'sScreen.keyPressedreturning false):key,repeatandmodifiersas inscreen_. If the mod browser's search editor declines, the container still handles raw bindings (including rebound inventory close and sort) before this hook can fire. Slot swap, pick and drop can act before an unhandled result; a translated mapping reached after Post cannot sort the container. Setkey_ pressed_ pre canceledto keep the game's own key handling (bindings, hotbar and toggles) from seeing it. A key that has no vanilla name fires nothing. Fires for window key presses and the control socket'skey ... down,key ... repeat, and the press phase ofkey ... tap, on the receiving screen and only when the matching Pre did not cancel it. A controller does not synthesize this hook.
screen_key_ pressed_ pre - Side
- client
- Contract
- cancel
- Host / context
&dyn ClientHost- NeoForge
ScreenEvent.KeyPressed.Pre- Summary
- A key went down over the open screen (
ScreenEvent.KeyPressed.Pre, vanilla'sScreen.keyPressed):screenis the screen it is,keyvanilla's name for the key (key.keyboard.e) — a key with no name fires nothing —repeatwhether it is the keyboard's auto-repeat of a held press (Sunrise's extra; NeoForge folds repeats into the event), andmodifiersGLFW's bits (shift 1, control 2, alt 4, super 8). Setcanceledand the press goes no further: no focus move, no Escape-close, no inventory or hotbar key, no typing by the key itself.
screen_key_ released_ post - Side
- client
- Contract
- cancel
- Host / context
&dyn ClientHost- NeoForge
ScreenEvent.KeyReleased.Post- Summary
- A key release that neither the receiving screen nor its mounted widgets took (
ScreenEvent.KeyReleased.Post, vanilla'sScreen.keyReleasedreturning false):keyandmodifiersas inscreen_. Setkey_ released_ pre canceledand 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 for window key releases and the control socket'skey ... upand release phase ofkey ... tap, on the receiving screen and only when the matching Pre did not cancel it. A controller does not synthesize this hook.
screen_key_ released_ pre - Side
- client
- Contract
- cancel
- Host / context
&dyn ClientHost- NeoForge
ScreenEvent.KeyReleased.Pre- Summary
- Before the currently open screen handles a named key's release. Window releases, control-socket
key ... up, and the release phase ofkey ... tapreach the current receiving screen, even if it did not see the press. Cancel skips the screen handler and Post. A cancelled window Pre still releases the device key and applies mapped keyboard release cleanup. A cancelled socket Pre skips the ordinary control-key release; a held mapping can stay down. Cancelling an unhandled release in Post instead skips normal mapped release on either route, after the screen has declined.
screen_mouse_ button_ pressed_ post - Side
- client
- Contract
- collect
- Host / context
&dyn ClientHost- NeoForge
ScreenEvent.MouseButtonPressed.Post- Summary
- A mouse press after the receiving screen handled or declined it (
ScreenEvent.MouseButtonPressed.Post). The matching Pre must not have cancelled.screen,button,modifiersanddouble_are the press Pre values, even if the press closed or replaced that screen. Every listener seesclick was_, the receiving handler's original answer. A hit on the first child counts as handled even when that child declines and does not take focus.click_ handled
screen_mouse_ button_ pressed_ pre - Side
- client
- Contract
- cancel
- Host / context
&dyn ClientHost- NeoForge
ScreenEvent.MouseButtonPressed.Pre- Summary
- A press about to go to
Screen.mouseClicked(ScreenEvent.MouseButtonPressed.Pre).screenis the receiving screen andscreen.mouseis the pointer position.buttonis the GLFW index (0 left, 1 right, 2 middle, 3 back, 4 forward; beyond those, the platform's own number).modifiersare GLFW bits (shift 1, control 2, alt 4, super 8). The receiver and press Post get the samedouble_: true for a real press when the last handled real press was of this button on this screen instance less than 250 ms ago. Cancel to skip the screen handler, Post and gameplay mappings; a cancelled real press still counts as handled for double-click detection.click
screen_mouse_ button_ released_ post - Side
- client
- Contract
- collect
- Host / context
&dyn ClientHost- NeoForge
ScreenEvent.MouseButtonReleased.Post- Summary
- A mouse release after the receiving screen handled or declined it (
ScreenEvent.MouseButtonReleased.Post). The matching Pre must not have cancelled.screen,buttonandmodifierscome from the release's Pre, not the earlier press or a screen the release opened. Every listener seeswas_, the original answer from the receiving handler. Completing quick-craft is not itself a handled release: the child still answers. An early swallowed container release is handled.release_ handled
screen_mouse_ button_ released_ pre - Side
- client
- Contract
- cancel
- Host / context
&dyn ClientHost- NeoForge
ScreenEvent.MouseButtonReleased.Pre- Summary
- A mouse button went up over the open screen (
ScreenEvent.MouseButtonReleased.Pre, vanilla'sScreen.mouseReleased), with the samescreen,buttonandmodifiersasscreen_and fired at the same point. Setmouse_ button_ pressed_ pre canceledand the release goes no further: a pressed slot keeps what it took and no drag, slider or scrollbar lets go.
screen_mouse_ dragged_ post - Side
- client
- Contract
- listen
- Host / context
&dyn ClientHost- NeoForge
ScreenEvent.MouseDragged.Post- Summary
- A held-button pointer movement that the receiving screen (and its mounted widgets) did not handle (
ScreenEvent.MouseDragged.Post, vanilla'sScreen.mouseDraggedreturning false):button,delta(GUI pixels,screen.mousethe new position) andmodifiersas inscreen_. Not cancellable. Fires on the receiving screen only when unhandled and when the matching Pre did not cancel it, on the window only, for real mouse input and not a pad's or keyboard focus's.mouse_ dragged_ pre
screen_mouse_ dragged_ pre - Side
- client
- Contract
- cancel
- Host / context
&dyn ClientHost- NeoForge
ScreenEvent.MouseDragged.Pre- Summary
- Before a real held-button movement reaches screen drag handlers.
screen.mouseis the current GUI position;deltais its GUI-space movement. Cancel keeps the new cursor position but skips all screen drag handlers. Same receiving screens asscreen_, including dialogs, confirmation prompts, books, lecterns and sign editors.mouse_ button_ pressed_ pre
screen_mouse_ scrolled_ post - Side
- client
- Contract
- listen
- Host / context
&dyn ClientHost- NeoForge
ScreenEvent.MouseScrolled.Post- Summary
- A mouse wheel scroll that the receiving screen (and its mounted widgets) did not handle (
ScreenEvent.MouseScrolled.Post, vanilla'sScreen.mouseScrolledreturning false):scrollandmodifiersas inscreen_. Not cancellable. Fires on the receiving screen only when unhandled and when the matching Pre did not cancel it, on the window only, for real mouse input and not a pad's or keyboard focus's.mouse_ scrolled_ pre
screen_mouse_ scrolled_ pre - Side
- client
- Contract
- cancel
- Host / context
&dyn ClientHost- NeoForge
ScreenEvent.MouseScrolled.Pre- Summary
- The wheel turned over the open screen (
ScreenEvent.MouseScrolled.Pre, vanilla'sScreen.mouseScrolled):screenis the screen it is,screen.mousewhere the pointer is (so there is no position of its own),scrollthe 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), andmodifiersGLFW's bits (shift 1, control 2, alt 4, super 8). Setcanceledand 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.
screen_opening - Side
- client
- Contract
- replace
- Host / context
&dyn ClientHost- NeoForge
ScreenEvent.Opening- Summary
Gui.setScreenis about to replace thecurrentscreen withnew(ScreenEvent.Opening; the screenplayingis none: vanilla's null). AnswerScreenOpening::to keep the current one,Cancel ScreenOpening::to open a mod's own screen instead, orModScreen ScreenOpening::to open another vanilla screen instead. The waiting screen and a warning's live return dialog can replace a receiver with the sameVanilla dialogid.Cancelkeeps its mounted widgets and focus, without emitting Closing or the replacement's Init.Post. A server's container close that leaves no screen fires no Opening and can't be cancelled;screen_still gets the screen it closes. One that opens the title or the death screen fires Opening for it.closing
screen_preedit_ post - Side
- client
- Contract
- listen
- Host / context
&dyn ClientHost- NeoForge
ScreenEvent.Preedit.Post- Summary
- 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) andscreen_did not cancel. Reports the receiver captured at Pre. A built-in mountedpreedit_ pre TextFieldcan consume preedit; a customScreenWidgetdoes not. Same arguments as Pre.
screen_preedit_ pre - Side
- client
- Contract
- cancel
- Host / context
&dyn ClientHost- NeoForge
ScreenEvent.Preedit.Pre- Summary
- Before a screen's preedit handler (
ScreenEvent.Preedit.Pre, vanilla'sGuiEventListener.preeditUpdated): the input method is composingfull_(empty when the composition ended), with the caret at bytetext caret_, split intoposition blocksof whichfocused_is the one being converted. Setblock canceledand no text field sees it, andscreen_does not fire. Fires on the window while a screen is open, even when no text field is focused.preedit_ post
screen_render_ background - Side
- client
- Contract
- listen
- Host / context
&dyn ClientHost- NeoForge
ScreenEvent.Render.Background- Summary
- The open screen is about to draw its contents (
ScreenEvent.Render.Background, after vanilla'srenderBackgroundand beforerender): draw here for what must sit under the screen's widgets, items and tooltips. Not cancellable. The screen has drawn its background panel; its widgets, slots and items draw over this hook. Screens without a panel, such as the title and chat, fire it before their contents. It does not fire whenscreen_cancelled. Fires once a frame on the window, for the screensrender_ pre screen_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 withrender_ post native_,fill native_andsprite native_;text screen.rectis the screen's container panel (or the whole window).
screen_render_ foreground - Side
- client
- Contract
- listen
- Host / context
&dyn ClientHost- NeoForge
ScreenEvent.Render.Foreground- Summary
- The open screen has drawn its contents (
ScreenEvent.Render.Foreground, vanilla's point before the deferred tooltips and the preedit overlay). Not cancellable. Tooltips, the dragged stack and the preedit overlay draw over this hook; usescreen_for drawing over the screen's tooltips. It does not fire whenrender_ post screen_cancelled. Fires once a frame on the window, for the screensrender_ pre screen_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 withrender_ post native_,fill native_andsprite native_;text screen.rectis the screen's container panel (or the whole window).
screen_render_ inventory_ mob_ effects - Side
- client
- Contract
- cancel
- Host / context
&dyn ClientHost- NeoForge
ScreenEvent.RenderInventoryMobEffects- Summary
- Ahead of the effect panels beside the survival and creative inventories (
ScreenEvent.RenderInventoryMobEffects, vanilla'sEffectsInInventory.extractRenderState):available_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).space compactpicks icons over full panels (vanilla's choice is compact under 120) andhorizontal_shifts the stack right (negative left). Setoffset canceledand the panels are not drawn: draw your own withscreen_. 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.render_ post
screen_render_ post - Side
- client
- Contract
- listen
- Host / context
&dyn ClientHost- NeoForge
ScreenEvent.Render.Post- Summary
- The open screen has drawn itself and its tooltips (
Screen.render, the point ofScreenEvent.Render.Post): draw over it withnative_,fill native_andsprite native_,text screen.rectbeing its container panel (or the whole window) andscreen.idthe 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.
screen_render_ pre - Side
- client
- Contract
- cancel
- Host / context
&dyn ClientHost- NeoForge
ScreenEvent.Render.Pre- Summary
- Before the open screen draws itself (
ScreenEvent.Render.Pre, vanilla'sScreen.renderWithTooltips): draw to put something under it, or setcanceledand the screen is not drawn, and neither is itsscreen_orrender_ background screen_. The world, the HUD layers and the toasts still draw, andrender_ foreground screen_still fires. Fires once a frame on the window, for the screensrender_ post screen_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 withrender_ post native_,fill native_andsprite native_;text screen.rectis the screen's container panel (or the whole window).
screen_room - Side
- client
- Contract
- collect
- Host / context
&dyn ClientHost- NeoForge
- —
- Summary
- Room for a mod's own panel right of the open container screen's window, in GUI pixels:
rightstarts at 0; raise it to the width your panel takes beside the window, its gap included, and leave it be otherwise. Later mods see earlier mods' answers: keep the larger (event.right = event.right.max(mine)). When the window, the recipe book open beside it and that room all fit across the screen, the window and the book move left by half the room (rounded down), so the three stay centred as vanilla's recipe book moves the window right to make room for itself (RecipeBookComponent.updateScreenPosition); when they don't fit, nothing moves. This API is right-only: mod panels reserve the right while the existing recipe book occupies the left; left reservations are not part of this hook. The query'sScreenView::is pre-reservation. Later draw/input views expose the shifted window; check that rectangle's right edge plus the room against the viewport. Keep this query pure and cheap. Its answer is memoized for the frame and screen; recursive queries during dispatch see zero. Asked once a frame while the player's inventory, a container or a mod's menu screen is open, not for the creative inventory, a merchant's or a beacon's screen, nor while the recipe book covers the window of a narrow screen; an answer that changes geometry builds the layout again in the same frame (slots, book and effect panels move with the window). Not finite or below 0 counts as 0. Beyond NeoForge: a mod there reads the container screen'srect leftPosbut has no event to move it, so it draws in the space that's left.
screen_transparent_ background - Side
- client
- Contract
- cancel
- Host / context
&dyn ClientHost- NeoForge
ScreenEvent.Render.Pre (transparent background)- Summary
Screen.renderTransparentBackground: draws the translucent dark background behind an in-game screen (inventory, container, creative, book, sign, editor). Setcanceled(or returnFlow::) to suppress the vanilla dark gradient, allowing a mod to draw its own background or apply menu background blur viaCancel Host::. API @API:screen_transparent_background@.apply_ screen_ blur
screenshot- Side
- client
- Contract
- cancel
- Host / context
&mut dyn ClientHost- NeoForge
ScreenshotEvent- Summary
- An F2 screenshot has been read back, before either PNG is written (
ScreenshotEvent). Runs on the client thread with aClientHost.imageis the in-memory frame (getImage): RGBA8, top to bottom,width * height * 4bytes. Change it and the normal PNG is that image. A length other thanwidth * height * 4writes nothing and reports screenshot failure. The HDR copy is not this image. Changefile_, a relative path inside the player's screenshots folder, or setname messageto replace the success chat line.Noneuses the normal translated, clickable line for the final file name. ReturnFlow::to write no files and postCancel message, or the translated cancellation line whenmessageisNone. 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.
sculk_bloom - Side
- server
- Contract
- listen
- Host / context
&mut dyn ServerHost- NeoForge
- —
- Summary
- A sculk catalyst at
poshas begun blooming after taking experience. The catalyst block state has changed. Server-side.
section_visibility - Side
- client
- Contract
- collect
- Host / context
&dyn ClientHost- NeoForge
- —
- Summary
- A chunk section in the player's current level is about to mesh: return one
SectionVisibilityorNone.inputis the raw section with its one-block border, read before any mod hid a state.SectionCell::gives the canonicalState BlockState. Asked on the client world thread before the section goes to a meshing worker, including remeshes after a neighbouring column arrives or unloads, a resource reload, orClientHost::. A first all-air compile is skipped if no mod contributes section geometry. Other levels drawn through level views do not call this hook. Answers only take away, and every mod's are combined, so no mod brings back what another hid. An answer that breaks a bound is refused whole, logged once, and the section draws without it. With no mod listening, the mesher pays nothing.refresh_ render_ visibility
server_about_ to_ start - Side
- server
- Contract
- listen
- Host / context
&mut dyn ServerHost- NeoForge
ServerAboutToStartEvent- Summary
- 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'sMinecraftServer.loadLevelstart. Server-side: the single player server thread once Play is pressed, a dedicated server once its settings are read. Each is followed byserver_orstarted world_'slifecycle WorldOpenFailed.dedicatedtells a dedicated server from the single player one.
server_chat - Side
- server
- Contract
- cancel
- Host / context
&mut dyn ServerHost- NeoForge
ServerChatEvent- Summary
- NeoForge's
ServerChatEvent: a player's chat message, through their chain, is about to be broadcast.player_is the server's entity id for the player,id playertheir UUID,usernametheir name andraw_what they typed.text messagestarts as that text; replace it and players see the new message (withUnsignedContent: a signed message keeps its signature), and the log shows it. Setcanceland nobody sees it, and it doesn't count toward the chat spam limit. Commands (/,say /...) 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.msg
server_started - Side
- server
- Contract
- listen
- Host / context
&mut dyn ServerHost- NeoForge
ServerStartedEvent- Summary
- 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 whereWorldOpenReadywas, on the single player server thread and on a dedicated server, once per open that succeeds (a failed open firesWorldOpenFailedinstead).dedicatedtells a dedicated server from the single player one.
server_starting - Side
- server
- Contract
- listen
- Host / context
&mut dyn ServerHost- NeoForge
ServerStartingEvent- Summary
- Fired once before the server accepts play. On a dedicated server this follows world and data loading, and the adopted packs' English is available. On an integrated server it follows
server_immediately, where text uses the client's active language. A failed startup still reachesabout_ to_ start server_.stopped
server_stopped - Side
- server
- Contract
- listen
- Host / context
&mut dyn ServerHost- NeoForge
ServerStoppedEvent- Summary
- Fired once at the end of server teardown, after
server_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 emitstopping WorldCloseFinal.
server_stopping - Side
- server
- Contract
- listen
- Host / context
&mut dyn ServerHost- NeoForge
ServerStoppingEvent- Summary
- The server begins teardown (NeoForge's
ServerStoppingEvent), including after startup or the tick loop failed: the start of vanilla'sMinecraftServer.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.world_'slifecycle WorldCloseFinalfollows once the worlds are saved. A server whose loop fails still fires this before the final save attempt andserver_.stopped
server_tick - Side
- server
- Contract
- listen
- Host / context
&mut dyn ServerHost- NeoForge
ServerTickEvent.Pre, ServerTickEvent.Post- Summary
- The authoritative server tick's phases:
ServerTickStartbefore any level is ticked (NeoForge'sServerTickEvent.Pre),ServerTickEndafter the last (.Post). Read blocks withnative_, by dimension: which levelserver_ block self.worldholds here is not defined. A paused pass fires nothing; a frozen world carriesworld_false except during a requested step.running host.server_says whether optional work still fits before the next tick is due (has_ time() ServerTickEvent.hasTime).
server_tick_ rate_ changed - Side
- server
- Contract
- listen
- Host / context
&mut dyn ServerHost- NeoForge
- —
- Summary
/set the server's rate, or atick rate /ended (tick sprint MinecraftServer.onTickRateChanged, before its autosave wait is adjusted). Vanilla calls this for every/, the rate it already had included, and at each end of a sprint: on its own, bytick rate /or bytick sprint stop /, the rate then being what it was.tick freeze host.tick_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.stats()
setting_changed - Side
- client
- Contract
- listen
- Host / context
&mut dyn ClientHost- NeoForge
ModConfigEvent.Reloading (a ModConfigSpec value set on the config screen)- Summary
- The player changed setting
keyof modmod_on its page in Options > Mods (id Registrar::); the new value is kept already, so read it withregister_ setting setting_and its siblings. Only modbool mod_hears it: a mod is told of its own settings, never another's.id
shader_params - Side
- client
- Contract
- listen
- Host / context
&dyn ClientHost- NeoForge
- —
- Summary
- The values native mods hand their shader packs in this frame,
partialticks past the last tick (0 to 1): a pack's WGSL reads them asframe.mods(eightvec4<f32>). Write the slots your own pack reads; a mod that bundles its pack asnative-<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
sign_changed - Side
- server
- Contract
- cancel
- Host / context
&mut dyn ServerHost- NeoForge
- —
- Summary
- A player finished editing a sign:
ServerGamePacketListenerImpl.updateSignTexthas taken their update packet and every check has passed (they were editing that sign, within reach, the sign is not waxed), right before the lines go on the sign.posindimension, thefrontor back side, and the fourlinesas written, plain text with the formatting codes still in (vanilla strips them afterwards). Rewritelines(made four lines again) and that is what the sign gets, or setcanceland the sign keeps its old text. With the player's state swapped in, soPlayerRef::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,tell /,data /, mods'setblock native_).with_ mod_ block_ entity
sleep_finished_ time - Side
- server
- Contract
- cancel
- Host / context
&mut dyn ServerHost- NeoForge
SleepFinishedTimeEvent- Summary
- Enough players have slept through the night in level
dimensionand the clock is about to move to the morning (NeoForge'sSleepFinishedTimeEvent, vanilla'sServerLevel.tickwhen it moves the clock towake_).up_ from_ sleep adjustmentsays where the clock goes and may be changed: it comes in asMarker(minecraft:wake_, vanilla's own, and a mod may setup_ from_ sleep) Absolute,Relative(fromcurrent, the day time now) or anotherMarker; a later mod reads what an earlier one left.new_is the morning vanilla resolved, read only, for a mod that computes from it. Contract versiontime 2: in version1,new_was the value a mod wrote; a time is now written astime Absolute.currentand the result are times of the level's own clock (its dimension type's default clock, else the Overworld's). The game resolvesadjustmentonce after every mod: a time beforecurrent, a time pasti64::, or a marker the level's clock does not define is refused, asMAX setTimeAdditionrefuses one, and the clock moves to the morning. Only the Overworld's clock defines markers today, so on any other clock everyMarker, vanilla's included, falls back to the morning. When even the morning is pasti64::,MAX new_istime currentand the clock stays. On the server, only when theadvance_rule is on;time time_then hears the jump to the resolved time and may still cancel it. The players wake and the weather resets as usual either way. Setskip canceledand the clock is left where it is, as NeoForge's cancel leaves it:time_is not asked either.skip
sound_engine_ load - Side
- client
- Contract
- listen
- Host / context
&dyn LoopContext- NeoForge
SoundEngineLoadEvent- Summary
- The sound engine opened its output (
SoundEngineLoadEvent): once at window start, after each resource reload (with thecontextof 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.
spawn_change - Side
- server
- Contract
- listen
- Host / context
&mut dyn ServerHost- NeoForge
- —
- Summary
- The world's spawn point changed to
posin leveldimension, facingangle.
sponge_absorb - Side
- server
- Contract
- listen
- Host / context
&dyn LevelHost- NeoForge
- —
- Summary
- A sponge at
posabsorbed water and became wet. Server-side.
spread_players_ teleport - Side
- server
- Contract
- cancel
- Host / context
&mut dyn ServerHost- NeoForge
EntityTeleportEvent.SpreadPlayersCommand- Summary
- A server entity is about to be placed by
/(NeoForge'sspreadplayers EntityTeleportEvent.SpreadPlayersCommand, vanilla'sSpreadPlayersCommand.setPlayerPositions): once per entity, after the spread worked out its spot.entityis its network id,playerits UUID (None for a non-player),fromwhere it stands andtargetthe spot. A mod may movetarget(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.
standalone_models - Side
- client
- Contract
- collect
- Host / context
&RegistrationContext- NeoForge
ModelEvent.RegisterStandalone- Summary
- Models no blockstate names, registered once on the client before resources load. Use
StandaloneModelsEvent::for plain files orregister_ model StandaloneModelsEvent::to bind a baker and its file dependencies. Every resource load rebakes both from the active pack files. Failed bakes publish no model and log the registering mod. Look up results throughregister RenderAssets::in or aftermodel model_.baking_ completed
submit_custom_ geometry - Side
- client
- Contract
- listen
- Host / context
&dyn ClientHost- NeoForge
SubmitCustomGeometryEvent- Summary
- Submit unlit geometry after particle submission, before opaque rendering (NeoForge 26.3
SubmitCustomGeometryEvent, vanillaLevelRenderer.submitFeatures). Client-only, noncancellable.viewholds only camera, partial tick and game time, not full extracted level state or visible sections. Submit from extracted state.
substitute_inline_ images - Side
- client
- Contract
- collect
- Host / context
&dyn ClientHost- NeoForge
- —
- Summary
- Propose inline images for one nonempty, translated text run in chat history or on either face of a sign, after legacy formatting and before wrapping, measuring and bidi reordering. Existing inline objects are not passed to the hook. The
runis one resolved style span; ranges cannot cross spans or line breaks. Push UTF-8 byte ranges intoimages, in priority order. The first valid, nonoverlapping proposal wins in hook dispatch order. Missing sprites and invalid ranges are ignored, leaving the original characters available to later proposals.
sweep_attack - Side
- both
- Contract
- cancel
- Host / context
HostSide- NeoForge
SweepAttackEvent- Summary
- NeoForge's
SweepAttackEvent: a player's damaging melee hit on atarget(minecraft:zombie,minecraft:oak_) is about to sweep or not, afterboat critical_.hit vanilla_issweep Player.isSweepAttack(a charged, grounded, not critical sword hit below the speed limit);sweepingstarts as it and may force or stop the sweep;canceledskips the later mods and keepssweepingas it is (a mod doing its own sweep cancels withsweepingfalse). A critical hit that sweeps has both sounds. Fires on the Game that runs the attack, and on the attacking client, which only asks.
tab_complete - Side
- server
- Contract
- collect
- Host / context
&mut dyn ServerHost- NeoForge
- —
- Summary
- A guest asked to complete
command; owned APISuggestionrecords may be added to or filtered fromsuggestions.rangeis the replaced byte range. The game snapshots completions only when a listener subscribes.
tags_updated - Side
- both
- Contract
- listen
- Host / context
&dyn ReloadContext- NeoForge
TagsUpdatedEvent- Summary
- Tags changed, and what depends on them should be rebuilt (NeoForge's
TagsUpdatedEvent);causesays how. The place to drop caches derived from the data and to rebind what depends on it.
target_hit - Side
- server
- Contract
- listen
- Host / context
&mut dyn ServerHost- NeoForge
- —
- Summary
- A projectile hit the target block at
pos, which now hasstrengthoutput power. Server-side.
teleport_command - Side
- server
- Contract
- cancel
- Host / context
&mut dyn ServerHost- NeoForge
EntityTeleportEvent.TeleportCommand- Summary
- A server entity is about to be teleported by
/ortp /(NeoForge'steleport EntityTeleportEvent.TeleportCommand, inTeleportCommand.performTeleport, once per teleported entity):dimensionis the level it arrives in,entityits network id,fromits feet now andtowhere the command sends it. A mod may moveto(a value that is not a number is ignored). Canceling leaves the entity where it is; the command still reports success.entity_andteleport player_hear it after. Server-side. Diverges from upstream: new hook.teleported
texture_atlas_ stitched - Side
- client
- Contract
- listen
- Host / context
&mut dyn ClientHost- NeoForge
TextureAtlasStitchedEvent- Summary
- An atlas was stitched and published (
TextureAtlasStitchedEvent):atlasnames it. Fires once per atlas, the blocks' first and then the GUI's, during atlas publication before the model manager applies. Model lookups still see the previous generation (none at startup). It precedesclient_on startup andsetup client_on later reloads. Listeners ordered after the model manager apply after both stitches. A refused prepare fires nothing. Look the sprites a mod draws up here, once, and keep what it finds until the next stitch of that atlas:resources_ reloaded texture_forsprites TextureAtlas::,Blocks gui_forsprite TextureAtlas::. Never look them up by name every frame. Client-side. A panic rolls back the callback's journaled writes; the mod is reported and its callback skipped for the session without suppressing other mods' notifications.Gui
thunder_change - Side
- server
- Contract
- cancel
- Host / context
&mut dyn ServerHost- NeoForge
- —
- Summary
- The server changed its thunder state through
/. Setweather cancelto keep the previous thunder state and timer. Server-side.
tick_target_ millis - Side
- client
- Contract
- listen
- Host / context
&dyn ClientHost- NeoForge
- —
- Summary
- How many milliseconds a client tick lasts (
Minecraft.getTickTargetMillis, the target the window'sDeltaTracker.Timerdivides the frame's time by):milliscomes in as vanilla's (50 at 20 ticks a second, longer when the server's/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.tick rate
time_skip - Side
- server
- Contract
- cancel
- Host / context
&mut dyn ServerHost- NeoForge
- —
- Summary
- The overworld clock is about to jump, from sleep or
/. Settime cancelto keepfrom.
tnt_primed - Side
- server
- Contract
- cancel
- Host / context
&mut dyn ServerHost- NeoForge
- —
- Summary
- TNT at
posis 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.playeris the server player whose click lit it, with their state swapped in (soPlayerRef::answers them), None when no player is behind it (fire, redstone, an arrow, a dispenser). Settell canceland 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 (explosion_spares blocks), a TNT minecart and a sulfur cube. Server-side and in single player.detonate
toast_add - Side
- client
- Contract
- cancel
- Host / context
&dyn ClientHost- NeoForge
ToastAddEvent- Summary
- A client toast is about to enter its queue (
ToastAddEvent). ReturnFlow::to discard only this candidate, before slot allocation, animation or sound.Cancel kindidentifies its family; music isOther. Replacetitleanddescriptionto 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. Requests fromClientHost::enter asadd_ toast ToastKind::, including requests that would replace an existing mod toast. Integrated-server error notices are new system toast candidates on the owning client, not on the server or its guests. Pending chunk I/O reports stay with that window when the world closes. Client-lib and title producers prepare candidates for the game to admit with aMod ClientHostbefore applying. Diagnostics naming a mod's panicking callback are not candidates for this hook and cannot be edited or cancelled.
trade_select - Side
- server
- Contract
- listen
- Host / context
&mut dyn ServerHost- NeoForge
- —
- Summary
- A server player selected trade
indexfromvillagerin the trading menu.
trade_with_ villager - Side
- server
- Contract
- collect
- Host / context
&mut dyn ServerHost- NeoForge
TradeWithVillagerEvent- Summary
- A server player's take from a villager or wandering trader, once per trade, after its statistic and
villager_criterion.trade merchantis the trader's entity id,kindits type, andofferthe post-take snapshot: the use is counted and the result is what that iteration took.host.players().acting_names the player.player()
use_item_ on_ block - Side
- both
- Contract
- cancel
- Host / context
HostSide- NeoForge
UseItemOnBlockEvent- Summary
UseItemOnBlockEvent: after a phase was chosen, before its Part or vanilla behaviour. Cancel skips that behaviour and returnscancellation_(initiallyresult TryWithEmptyHand). InItemBeforeBlock,Passcontinues to the block, skipping the item'son_Part; any result other thanitem_ use_ first Passends the block interaction. A block-phaseTryWithEmptyHandcan still try the empty-hand behaviour. On a server-registered cauldron click, the client waits for block fallthrough beforeItemAfterBlock; a consuming server item result doesn't skip this local phase. Other clicks can predict vanilla on a client without the mod; the server corrects it.
validate_tickets - Side
- server
- Contract
- listen
- Host / context
&mut dyn ServerHost- NeoForge
LoadingValidationCallback- Summary
dimension's level has loaded the saved chunk tickets ofcontroller(NeoForge'sLoadingValidationCallback.validateTickets), before its first tick and afterlevel_, once for each open and each controller registered with a validator that has tickets in the level. At startup all built-in levels are available before validation begins.load validationholds 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. A callback's removals are visible to that callback immediately, but are discarded if it panics or incurs a phase refusal. Server-side.
vanilla_game_ event - Side
- server
- Contract
- cancel
- Host / context
&mut dyn ServerHost- NeoForge
VanillaGameEvent- Summary
- A vanilla game event is about to reach its listeners (NeoForge's
VanillaGameEvent, vanilla'sLevel.gameEvent): every event, indimension.eventis its id (minecraft:step),poswhere it happened andcausethe network id of the entity that caused it (None for none).affected_is the block state the event touched (state GameEvent.Context.affectedState, withcauseitssourceEntity): 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. A dispenser fluid transfer with no open transaction in its level publishes before overflow insertion or preparation. With a caller-owned transaction in that level, publication waits for the outermost commit. Server-side.
vault_change_ state - Side
- server
- Contract
- listen
- Host / context
&mut dyn ServerHost- NeoForge
- —
- Summary
- A vault at
poschanged tostate. Its block state is updated. Server-side.
vault_loot - Side
- server
- Contract
- listen
- Host / context
&mut dyn ServerHost- NeoForge
- —
- Summary
- A vault at
posis about to eject a loot item.
vehicle_create - Side
- server
- Contract
- listen
- Host / context
&mut dyn ServerHost- NeoForge
- —
- Summary
- A boat or minecart was created at
pos, after it joined the level.kindis the vehicle type. Server-side.
vehicle_damage - Side
- server
- Contract
- cancel
- Host / context
&mut dyn ServerHost- NeoForge
- —
- Summary
- A vehicle is about to take damage from a player's attack.
kindisboator the minecart type; mods may changedamageor setcancelto leave its damage and wobble unchanged. The attack itself still completes. Server-side.
vehicle_destroy - Side
- server
- Contract
- listen
- Host / context
&mut dyn ServerHost- NeoForge
- —
- Summary
- A boat or minecart is about to be destroyed at
pos. TNT minecarts that prime instead of breaking are not heard. Server-side.
vehicle_moved - Side
- server
- Contract
- listen
- Host / context
&mut dyn ServerHost- NeoForge
- —
- Summary
- A boat or minecart (
kind,minecraft:oak_) moved since the last tick (boat VehicleMoveEvent):fromandtoare 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 (host.players().acting_,player() PlayerRef::and the item helpers reach them;tell playeris their UUID), and for one a server player rode and left, until it has stood still for ten seconds (playeris 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.
viewed_level_ sound - Side
- client
- Contract
- listen
- Host / context
&mut dyn ClientHost- NeoForge
- —
- Summary
- A sound of a level the server opened for viewing (#3716) reached this client, and the client asks where in the player's own level to play it.
levelis the viewed level's handle (whathost.levelgives for it) andpositionthe sound's position there;sound,sourceandseedare the server's.play_starts as None, and a sound left None is not played. Set it to a position in the player's level and the sound plays there, as the player's own level plays a sound packet (no distance delay), with theat volumeandpitchthe listeners leave and the same seed. Aplay_that is not finite, or a volume or pitch that is not finite and at least 0, plays nothing. Only a server ofat sunrise:levelsrevision 3 sends these. A sound bound to an entity of the viewed level has that entity's position there, and plays atplay_without following it. Sounds of the player's own level askat play_andlevel_ sound_ at_ position play_, never this hook. With no listener the sound is dropped after one check, with nothing decoded or allocated. Client-side. Diverges from upstream: new hook, a Sunrise addition with no NeoForge counterpart.level_ sound_ at_ entity
village_siege - Side
- server
- Contract
- cancel
- Host / context
&mut dyn ServerHost- NeoForge
VillageSiegeEvent- Summary
- A village siege found a spawn position on the server. Set
canceledto stop the siege. There is one siege per dimension.
visuals- Side
- client
- Contract
- listen
- Host / context
&dyn ClientHost- NeoForge
- —
- Summary
- The world frame's local, world-space rim and colored-light sources. Push requests; Sunrise validates and limits them before rendering. Called only while a world is visible.
weather_change - Side
- server
- Contract
- cancel
- Host / context
&mut dyn ServerHost- NeoForge
- —
- Summary
- The server changed its weather parameters.
rainingandthunderingare the requested final states. Setcancelto keep the previous weather parameters. Server-side.
whitelist_state_ update - Side
- server
- Contract
- listen
- Host / context
&mut dyn ServerHost- NeoForge
- —
- Summary
- The dedicated server's whitelist changed to
enabled.
wind_burst - Side
- server
- Contract
- collect
- Host / context
&mut dyn ServerHost- NeoForge
- —
- Summary
- Before a wind burst interacts with blocks,
wind_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@.burst(dimension, center, blocks)
window_resize - Side
- client
- Contract
- listen
- Host / context
&mut dyn ClientHost- NeoForge
WindowResizeEvent- Summary
- After a window resize or applying a changed GUI scale, fullscreen, or Unicode font setting.
widthandheightare physical pixels;gui_andwidth gui_are scaled GUI pixels. Fires only when physical or scaled dimensions change.height
world_border_ bounds_ change_ finish - Side
- server
- Contract
- listen
- Host / context
&mut dyn ServerHost- NeoForge
- —
- Summary
- A timed world-border size change finished on the server, after its final size was applied. Server-side, including the single-player server.
world_border_ bounds_ changed - Side
- server
- Contract
- listen
- Host / context
&mut dyn ServerHost- NeoForge
- —
- Summary
- The server world's border bounds changed, either immediately or when its timed size change was requested.
world_border_ center_ changed - Side
- server
- Contract
- listen
- Host / context
&mut dyn ServerHost- NeoForge
- —
- Summary
- The server world's border center changed.
world_lifecycle - Side
- server
- Contract
- listen
- Host / context
&mut dyn ServerHost- NeoForge
ServerStartingEvent, ServerStartedEvent, ServerStoppingEvent, ServerStoppedEvent- Summary
- The world's phases, read-only;
error_carries the engine's error text fortext WorldOpenFailedandWorldCloseFailed, empty otherwise. Server-side. A server loop or final save failure firesWorldCloseFailed. A normal stop with only individually reported record failures still firesWorldCloseFinal.
world_saved - Side
- server
- Contract
- listen
- Host / context
&mut dyn ServerHost- NeoForge
- —
- Summary
- The server completed a world save cycle.
waitsays chunk writes were flushed before returning.
xp_orb_ targeting - Side
- server
- Contract
- listen
- Host / context
&mut dyn ServerHost- NeoForge
XpOrbTargetingEvent- Summary
- An experience orb looks for a player to follow (NeoForge's
XpOrbTargetingEvent,ExperienceOrb.followNearbyPlayer), on a server.followingstarts as the default: the nearest living player withinscan_(8) blocks who isn't a spectator, ordistance None. Set another player, orNoneto 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. Sunrise 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.
zoom- Side
- client
- Contract
- replace
- Host / context
&dyn ClientHost- NeoForge
- —
- Summary
- The zoom a native mod asks for, applied while playing (the spyglass's own view wins): set
zoomwhen it is none yet.
Part hooks
BlockEntityPart
block_entity - Side
- both
- Contract
- replace
- Host / context
LevelSide- NeoForge
- —
- Summary
- Initial saved data for a declared block entity (
EntityBlock.newBlockEntity), fired inside the write that creates it (LevelChunk.setBlockState), on a server and on a client of one.stateis the actual placed state for a block declared throughstateful_; its properties are available through the Host's state registry. The declaration owns the type id. No answer creates no entity for a state-aware factory; other declared types start with an empty compound. The level is read-only, asblock_ entity newBlockEntitygets no level.
block_entity_ client_ tick - Side
- client
- Contract
- listen
- Host / context
- —
- NeoForge
- —
- Summary
- A client tick of this client's copy of the mod block entity (
ClientLevel.tickBlockEntities), when its type is yours and its block's state ticks on the client (block_): once per client tick while the level runs, in vanilla's ticker order among the others, whether or not the copy is drawn.entity_ client_ ticks event.subjectis aBlockEntityClientScope: borrow a read-onlyBlockEntityReadViewthroughwith_for the resident copy's handle, position, level, block state, data slots, item slots and merged NBT (view block_), and borrowentity_ update_ tag ClientHostsequentially throughhost()to start, stop and fade sounds or add particles. Never called on a server, and never again for a copy removed or whose chunk unloaded.
block_entity_ client_ ticks - Side
- client
- Contract
- listen
- Host / context
&dyn ClientHost- NeoForge
- —
- Summary
- Whether block
block's block entity ticks on the client (EntityBlock.getTickerasked with the client level): settickswhen it is yours, andblock_runs for it once per client tick. Asked once for each mod block, for all of its states, when the client level initializes its ticker table (before the first column's block entities or the first ticker pass), if a part has a client tick. Setentity_ client_ tick ticksto true to make it tick, and never clear a value an earlier mod or mixin set.
block_entity_ data_ received - Side
- client
- Contract
- listen
- Host / context
- —
- NeoForge
- —
- Summary
- The synchronized
taghas been merged into this client's block entity.sourcedistinguishes chunk data from a later update packet. Empty chunk compounds send no notice; empty update-packet compounds do. Absent tags send no notice. Called once for each accepted tag, only for a matching mod block entity that the client created.event.subjectis aBlockEntityClientReadScope:with_lends a read-only view of the resident block entity with the merged data already applied, andview host()borrows&dyn ClientHost. This notice cannot change the received tag. Missing tags and vanilla block entities call nothing. Related NeoForge receive pathsIBlockEntityExtension.onDataPacketandhandleUpdateTagperform loading; they are not counterparts of this notice, which runs after the merge.
block_entity_ load_ additional - Side
- server
- Contract
- listen
- Host / context
- —
- NeoForge
- —
- Summary
- The engine applied saved data to this mod block entity on the logical server (
BlockEntity.loadAdditional).tagis the applied mod payload, andevent.subjectis aBlockEntityLevelReadScope:with_lends a read-onlyview BlockEntityReadViewcarrying the instance's handle,worldPosition, level, block state and updated data, andhost()borrows&dyn LevelHost, so a listener can store the applied data under its dimension and position, also after a later/. The notice cannot change the tag or write to the world. On a holder without declared inventory slots,data merge tagincludes any savedItemsfield as mod-owned NBT, even rows that look like canonical item stacks. Lists keep their saved order. For a declared inventory, modeled stacks remain separate from the mod payload.
block_entity_ on_ load - Side
- both
- Contract
- listen
- Host / context
- —
- NeoForge
IBlockEntityExtension.onLoad- Summary
- The mod block entity has been added to its level, with saved data already applied, before its first tick (
IBlockEntityExtension.onLoad). Fires once for each instance on both logical sides, including placement. A chunk loaded again creates new instances and calls this hook again. On a server,block_reports the saved-data application first.entity_ load_ additional event.subjectis aBlockEntitySideScope:Server(scope)lends a mutableBlockEntityViewand&mut dyn ServerHostsequentially, whileClient(scope)lends a read-onlyBlockEntityReadViewand&mut dyn ClientHostsequentially.block_is the separate server-side serialization hook.entity_ save_ additional
block_entity_ render_ bounding_ box - Side
- client
- Contract
- collect
- Host / context
&dyn ClientHost- NeoForge
IBlockEntityRendererExtension.getRenderBoundingBox- Summary
- Where the mod block entity at
posdraws, for culling (NeoForge'sgetRenderBoundingBox):boundsis min x, y, z then max x, y, z, in blocks from the block's lower north-west corner. It starts as the block with a block of margin around it; widen it when yourblock_draws further (a tall shaft, a beam), or set an infinite value for one never culled. Asked once a frame for each within its view distance (entity_ submit block_) whose chunk is drawn.entity_ view_ distance
block_entity_ save_ additional - Side
- server
- Contract
- listen
- Host / context
&dyn LevelHost- NeoForge
- —
- Summary
- Write live mod state into
tag, a copy of the instance's stored payload (BlockEntity.saveAdditional). Edits affect only the output; the entity, its inventory, identity, position, and engine-managed attachments and shapes are not changed. Parts of the entity's type run in dispatch order. For a holder without declared inventory slots,tagholds any persistedItemsas mod-owned NBT. Canonical-looking item rows keep their saved list order; they are not reconstructed in slot order. The listener may replace or remove this field. Declared slots remain engine-owned inventory, serialized by the engine after the listeners run.event.posandevent.levelare the instance's ownworldPositionand level, read-only and filled by the engine, so a listener can find its live state by dimension and position, including during unload or a removed block's loot roll. Every call has a level: the hook is not asked without one. Malformed payloads, including overlong modified-UTF-8 names and strings, fall back to the stored payload before any output is used. If the region writer cannot encode or admit the complete chunk record, it retries that snapshot with stored block-entity payloads instead of listener edits.
block_entity_ submit - Side
- client
- Contract
- listen
- Host / context
&dyn ClientHost- NeoForge
EntityRenderersEvent.RegisterRenderers- Summary
- Draw the mod block entity at
pos, of blockblock(mymod:machine), on this client: once a frame while it is in view (vanilla'sBlockEntityRenderer.submit: within its view distance, 64 blocks unlessblock_says otherwise, its chunk faded in, and its bounds,entity_ view_ distance block_, in the frustum), when itsentity_ render_ bounding_ box idis yours.stateis the block's state (blockEntity.getBlockState(): read itsfacingwithnative_),block_ state_ property entityholds what the server sent (block_). Add geometry withentity_ update_ tag native_,draw_ quad native_,draw_ cube native_anddraw_ block native_underdraw_ item draw's pose stack, which starts at the block's lower north-west corner, in blocks;drawalso has the partial tick, the game time and the block's light. WhenDrawContext::reuses this renderer,draw_ scene entityis supplied by the scene, the draw is full bright, andposis scene-local, not a position to look up in the client level.
block_entity_ tick - Side
- server
- Contract
- listen
- Host / context
- —
- NeoForge
- —
- Summary
- A server tick of a resident mod block entity of your registered
kind. The game skips the callback if the current block does not support that entity type, as inLevelChunk.BoundTickingBlockEntity.tick. The first invalid visit logs a warning; a valid tick clears it for the next episode.event.subject.with_lends its live storage. To reach the level or another object, return from the loan and callview event.subject.host(). Ask for another loan afterwards; it returnsNoneif the level, chunk load, generation or block-entity type validity (BlockEntityType.isValidfor the live block state) no longer matches. In-place block-state updates to another valid state remain borrowable with the live state. For a Part-state edit, first get the handle withevent.subject.with_, then borrowview(|view| view.handle()) event.subject.host()to calledit_. Keep a handle only to use across calls.state
block_entity_ ticks - Side
- server
- Contract
- listen
- Host / context
&dyn Host- NeoForge
- —
- Summary
- Whether block
block's block entity ticks (EntityBlock.getTicker): settickswhen it is yours. Asked for each of the block's states when a world opens. Setticksto true to make it tick, and never clear a value an earlier mod or mixin set.
block_entity_ update_ tag - Side
- server
- Contract
- replace
- Host / context
- —
- NeoForge
- —
- Summary
- What clients get of the block entity at
poswhen itsidis yours (BlockEntity.getUpdateTag): settagto it, read fromentityalone. Asked on the server whenever a chunk holding it is sent and whenever its block changes, on the server thread; a client's copy of the block entity (made byblock_there) merges it into itsentity nbt. Leave it unset to send no tag of yours. A block change puts the one-shot fields ofBlockEntityView::over it, and sends them alone when it is unset.set_ client_ update_ fields
block_entity_ view_ distance - Side
- client
- Contract
- collect
- Host / context
&dyn ClientHost- NeoForge
- —
- Summary
- How far from the camera the mod block entity of block
blockdraws, in blocks (vanilla'sBlockEntityRenderer.getViewDistance): 64 unless a part answers. Setdistancefor your own block: further for something seen from afar (a beacon-like beam, a large display), nearer for small detail. It is asked once for each mod block, the first time this client draws block entities, and kept: never per frame. A value that isn't finite and above 0 is ignored. Beyond NeoForge: the renderer's own method, no event.
can_place_ item - Side
- server
- Contract
- replace
- Host / context
- —
- NeoForge
- —
- Summary
Container.canPlaceItem: whetherslotof this mod block entity's container admits the offered nonemptystack.Some(true)orSome(false)replaces the declaredModContainer::answer;insert_ rules Nonekeeps it. A subscribed slot refuses insertion if the entity snapshot, block state or offered stack cannot be represented. Face, input-slot and stack limits still apply.
menu_quick_ move - Side
- server
- Contract
- cancel
- Host / context
- —
- NeoForge
- —
- Summary
- A player shift-clicked slot
slotof the menu of the mod block entity (AbstractContainerMenu.quickMoveStack, the method a Java menu overrides), on the server, before the game's own routing: move the stack where your block wants it.subjectlends sequential access to the live resident block entity (subject.with_), the serverview(...) Host(subject.host()), and atomic transactions (subject.transaction(...));with_returnsview Noneif the block entity was removed or replaced during the call.slotis the menu's index: belowcontainer_it is a container slot (the block's own, a linked slot, or a crafting result); from there on the player's inventory (27 main slots, then the hotbar). After the live slot allows pickup,slots stackcopies what it holds. Take what you move out ofstackand returnFlow::. The same source keeps the remainder (Cancel Noneempties it) and the client gets the menu again. A result handler consumes its own inputs; the remainder stays available for the inputs it leaves until the grid changes. Left unhandled, the game undoes the listener's journaled writes before routing the same menu click without a second pickup check. A later Part sees accepted proposals.
on_chunk_ unloaded - Side
- both
- Contract
- listen
- Host / context
HostSide- NeoForge
IBlockEntityExtension.onChunkUnloaded- Summary
- The chunk holding this mod block entity is unloading (
IBlockEntityExtension.onChunkUnloaded): told once for each of its mod block entities, on each side that holds a copy of it, before the copy is dropped.posis where it stands,block_its handle (the oneentity host.block_gave while it was loaded) andentity entityits data. Release what your mod keeps for it here. On a server its chunk may have left the level already, so don't count on the handle's reads. As withchunk_, changes made in it aren't saved: the chunk was saved before it unloads. Not told when the world closes, or on a client when its level goes (a respawn, a dimension change, leaving).unload
pre_remove_ side_ effects - Side
- server
- Contract
- collect
- Host / context
&mut dyn LevelRandomHost- NeoForge
- —
- Summary
BlockEntity.preRemoveSideEffectsof a mod's block entity: an authoritative server is removingentityfrompos, where the blockstatestood, and its updates may have side effects (not under flag 256,UPDATE_). Put inSKIP_ BLOCK_ ENTITY_ SIDEEFFECTS dropsthe stacks it held that the game doesn't: they scatter asContainers.dropItemStackscatters them, after the block entity's own container. The block entity is still in place, so its attachments read as they were. Answered from inside the level's write: don't change the world here. This also runs when a menu button callback removes the backing block through the Host. Setkeep_to skip the base container slots. Eachcontents dropsentry is a slot:Nonedraws the empty slot's scatter position but spawns nothing. Thenspawnscreates each (stack, position) with default pickup delay, andexperienceawards each (amount, position) as experience orbs. Each output list accepts at most 1024 entries; invalid positions or stacks refuse the outputs. Positions must be finite. Default outputs draw nothing.
stateful_block_ entity - Side
- both
- Contract
- listen
- Host / context
&dyn Host- NeoForge
- —
- Summary
- Opt a block with a registered block entity type into state-aware creation. Asked once per block when a level's immutable factory ownership table is built. Set true and never clear an earlier answer. For these blocks,
block_receives the actual state and no answer creates no entity. Existing entities survive property changes within the same block.entity
BlockPart
add_destroy_ effects - Side
- client
- Contract
- cancel
- Host / context
&mut dyn ClientHost- NeoForge
IClientBlockExtensions.addDestroyEffects- Summary
- Asked on the client before a non-air state's destruction debris.
stateis the destroyed state, not what the client now sees atpos; an invisible state can still be asked. ReturnFlow::to replace or omit the burst, orCancel Flow::for the normal burst (even if the state normally suppresses terrain particles). The break sound is independent.Continue randomis the client level's random.
add_hit_ effects - Side
- client
- Contract
- cancel
- Host / context
&mut dyn ClientHost- NeoForge
IClientBlockExtensions.addHitEffects- Summary
- Asked on the client for the non-air, visible block being hit, after its optional hit sound and before any outline sampling. Return
Flow::to replace or omit the crumb, orCancel Flow::for the normal crumb (even if the state normally suppresses terrain particles). The supplied face is the one being hit.Continue randomis the level's random, also used by a call toLevelRef::during this callback.add_ breaking_ particles
adjacent_block_ path_ type - Side
- server
- Contract
- replace
- Host / context
&dyn Host- NeoForge
IBlockExtension.getAdjacentBlockPathType- Summary
- The optional contribution of the neighbour
event.stateatevent.pos(IBlockExtension.getAdjacentBlockPathType).event.path_is that neighbour's own classified type, not the node's type. The readonly host reads the owning level.type Someimmediately becomes the node's type and ends the scan, even if equal to its current type;Nonekeeps that neighbour's fluid and vanilla fallback, never suppressing it. Vanilla water contributes through its classified path type: a solid waterlogged block remainsBlocked. Custom fluids default toWaterBorder. Neighbours are visited x, then y, then z, each from -1 to 1, excluding the node's own column. No mob is supplied. These answers run after static classification; per-search evaluator caches remain. Diverges from upstream: new hook.
affect_neighbors_ after_ removal - Side
- server
- Contract
- collect
- Host / context
&dyn LevelHost- NeoForge
- —
- Summary
Block.affectNeighborsAfterRemovalfor a mod's block: an authoritative server removed the blockstatefrompos(moved: a piston pushed it) and has run its template class's own updates. Push ontoupdatesthe neighbour updates it wants, in order:OutputSignal(updateNeighbourForOutputSignal),Neighbours(updateNeighborsAt) andNeighboursExcept(direction)(updateNeighborsAtExceptFromFacing); the level runs each at once, as the block's own override would. Answered from inside the level's write: it reads, and cannot write blocks or spawn entities.
analog_output - Side
- server
- Contract
- collect
- Host / context
&mut dyn LevelRandomHost- NeoForge
- —
- Summary
BlockState.getAnalogOutputSignal: the signal a comparator reads from the blockstateatpos,facethe side that touches the comparator (or the conductor in front of it).outputholds vanilla's answer: change it when the block is yours (0 to 15; anything else is clamped). Asked only for blockshas_answered for, from inside the level's update: don't change the world here. When the answer changes without the block's state changing, callanalog_ output level.update_; a change of state throughneighbors(host, pos, state, NeighbourUpdate:: OutputSignal) native_orset_ block native_(neighbour updates on) tells the comparators itself, as vanilla'sset_ block_ property Level.setBlockdoes. Authoritative servers only. Version 2 supplies&mut dyn LevelRandomHost: usecontainer_for vanilla's comparator read, which may unpack unopened loot. The level's random stream remains in vanilla order. Other world edits stay forbidden.signal
animate_tick - Side
- client
- Contract
- listen
- Host / context
&mut dyn ClientHost- NeoForge
- —
- Summary
- A client's random display tick of the block
stateatpos(Block.animateTick):ClientLevel.animateTickpickedposamong the 667 random positions within 16 and the 667 within 32 blocks of the player it samples each client tick. Add particles withhost.add_and play sounds withparticle host.play_: a torch's smoke, a furnace's flames, redstone ore's dust.local_ sound levelis the client's level,randomits random (ClientLevel.random, the one vanilla lendsanimateTick), so a port keeps Java's odds:random.next_asfloat() < 0.04 random.nextFloat() < 0.04f. Only parts on the picked state's block are called, inside the pick: after the block's own vanilla effects, before its fluid's and the next pick. A block with no part answering costs the sampler one table lookup. Never called on a server, nor for a screen's scene. A resource pack's Polytonedisable_on the block stops the part's call too, as it stops the block's own.particles
beacon_color_ multiplier - Side
- both
- Contract
- collect
- Host / context
&dyn Host- NeoForge
IBlockExtension.getBeaconColorMultiplier, IBlockStateExtension.getBeaconColorMultiplier- Summary
- The colour the block
stateatposgives the beam of the beacon atbeacon_(pos IBlockExtension.getBeaconColorMultiplier), asked as the beacon builds its beam sections one block at a time.colorstarts at the block's own answer: the beacon's white and a stained glass block's or pane's dye colour, empty for the rest. SetSome(rgb)to tint the beam as stained glass does (a colour unlike the section below starts a new section mixed half and half with it), orNoneto let the beam pass untinted, or stop at an opaque block other than bedrock, as vanilla does. The beam takes the red, green and blue channels; alpha is ignored. Asked on both sides, since a client builds the beam it draws from the blocks it has, with the level read-only: register the mod on both and answer the same on each. With no part attached to the state, the game checks the hook subscription and the block key before any event conversion, so the cost is one table lookup per block above a beacon. Diverges from upstream: new hook.
block_jump_ factor - Side
- both
- Contract
- listen
- Host / context
&dyn LoopContext- NeoForge
- —
- Summary
- The jump factor of a block state this part is attached to (
Block.getJumpFactor, whichEntity.getBlockJumpFactorreads for the player, the cube, the panda, the rabbit and every other living jumper) is being read; vanilla's values are 0.5 for honey and 1.0 for the rest. A part may changefactor(event.factor). The entity reads the block at its feet and, when that gives 1.0, the block below it, so a changed factor takes part in that choice exactly as the block's own would. It runs for each read, on both sides and on the client's replayed ticks, so register the mod on both and keep the listener a pure function of its inputs. It is given the loopcontextof the side that ticks the entity, and takes noHost. NeoForge's counterpartBlock.getJumpFactor()is a method of the block, with no bus event, so this is a part method only; a mod reacting to its own blocks uses this part. Diverges from upstream: new hook.
block_path_ type - Side
- server
- Contract
- replace
- Host / context
&dyn LevelHost- NeoForge
IBlockExtension.getBlockPathType- Summary
- The optional classification of
event.stateatevent.pos(IBlockExtension.getBlockPathType). Asked before every vanilla rule, including air andis_.pathfindable Somereplaces the whole static classification;Nonedeclines to vanilla. The read-only level host is the level that ownspos, so the same state may answer differently at different positions. No mob is supplied: engine callers in NeoForge pass null. The server's 4096-slot positional cache stores the final static classification, including Open, until a matching block-updated notification or slot collision. It survives time, reload and chunk lifetime. Ordinary writes clear only on actual change with UPDATE_CLIENTS and full status at least BLOCK_TICKING; direct block-entity notifications clear even unchanged state. Neighbour and mob-specific adjustments run afterwards, outside that cache. Diverges from upstream: new hook.
block_render_ visibility - Side
- client
- Contract
- collect
- Host / context
&dyn ClientHost- NeoForge
- —
- Summary
- Hides a block state from the mesher: set
event.hiddenand the state draws nothing, as if its blocks were air. Its neighbours' faces toward it show, it no longer hides what is behind it, and its fluid layer and block entity are not drawn; light, collision and the server are untouched. The answer depends on the state alone and is resolved at mesh time, never per frame: the game asks once for every state when the client joins a world, and again for every state each time a mod callsClientHost::(a toggle, an ore scanner). Attach the part to vanilla blocks withrefresh_ render_ visibility block_. With no mod answering, the mesher pays nothing.part_ tag
block_signal - Side
- server
- Contract
- listen
- Host / context
&dyn LevelHost- NeoForge
- —
- Summary
- The redstone signal the block
stateatposgives on itsface, the side that touches the block reading it:BlockState.getDirectSignalwhendirect(what passes through a block it touches, as a lever's does), elsegetSignal.signalholds vanilla's answer: change it when the block is yours (0 to 15; anything else is clamped). Asked very often, from inside the level's update, so answer from your own state: check the block first, and don't read or change the world here. When the answer changes, and once the block is placed, calllevel.update_. Authoritative servers only.neighbors(host, pos, state, NeighbourUpdate:: Neighbours)
block_speed_ factor - Side
- both
- Contract
- listen
- Host / context
&dyn LoopContext- NeoForge
- —
- Summary
- The speed factor of a block state this part is attached to (
Block.getSpeedFactor, whichEntity.getBlockSpeedFactorreads for the player, mobs, boats and minecarts where vanilla reads it) is being read; vanilla's values are 0.4 for honey and soul sand and 1.0 for the rest. A part may changefactor(event.factor). The entity reads the block at its feet and, when that is not water or a bubble column and gives 1.0, the block below it, so a changed factor takes part in that choice exactly as the block's own would. It runs for each read, on both sides and on the client's replayed ticks, so register the mod on both and keep the listener a pure function of its inputs. It is given the loopcontextof the side that ticks the entity, and takes noHost. NeoForge's counterpartBlock.getSpeedFactor()is a method of the block, with no bus event, so this is a part method only; a mod reacting to its own blocks uses this part. Diverges from upstream: new hook.
bounce_on - Side
- server
- Contract
- collect
- Host / context
&mut dyn LevelRandomHost- NeoForge
- —
- Summary
- An entity bounced off a block state this part is attached to (
Block.bounceOn).event.fall_is the distance stored after fall handling, so a grounded boat can report zero. It fires only when the entity bounced, just before vanilla sets its movement.distance event.movementis the movement the bounce leaves it (x,y,z): change it to change what the entity keeps. It runs inside the entity's move, on the level random host: it reads blocks and draws the level's random in vanilla's order, but writes nothing. Runs on the server for players, mobs and other bodies that bounce in the base move.
bounce_restitution - Side
- both
- Contract
- collect
- Host / context
LevelSide- NeoForge
IBlockExtension.getBounceRestitution- Summary
- A simulating entity's downward block collision asks for the contacted state's restitution (
IBlockExtension.getBounceRestitution, throughIEntityExtension.getBlockBounciness).event.stateandevent.posare the pair selected byEntity.moveatgetOnPosLegacy. That position uses the supporting block's column but need not be the supporting cell.event.entityis the entity's id andevent.kindis its type.
break_progress_ positions - Side
- client
- Contract
- collect
- Host / context
&mut dyn ClientHost- NeoForge
- —
- Summary
- When a crack is set or changes stage, supply additional positions drawn at that same stage. Only parts on the cracked
stateare called, for both the local player's predicted crack and other players' cracks.positionsstarts empty; the originalposis always drawn separately. Answers are stored with the crack, not requested during rendering, and disappear when the crack clears, expires or its client level closes.
can_be_ connected_ to - Side
- server
- Contract
- replace
- Host / context
&dyn LevelHost- NeoForge
IBlockExtension.canBeConnectedTo- Summary
- On an authoritative server, whether the block
stateatposlets the fence, wall, or iron bars or paneconnectorbeside it connect to it (IBlockExtension.canBeConnectedTo): the block being connected to answers, not the connecting one.kindnames the connector's vanilla rule,directionpoints from the block toward the connector andface_is whether the block's face toward it is sturdy. Asked once the connector's vanilla rule answered, each time the connector is placed or settles its shape toward the block.solid Some(true)connects,Some(false)refuses andNonekeeps vanilla's rule. The connector's ownconnects_is asked after, starting from this answer, and has the last word. A panicking part is contained and vanilla's answer is used. The level is read-only. With no part attached to the state, the cost is one table lookup. Diverges from upstream: new hook.to
can_be_ hydrated - Side
- server
- Contract
- replace
- Host / context
&dyn LevelHost- NeoForge
IBlockExtension.canBeHydrated- Summary
- Whether
fluidatfluid_waters the farmland this part is attached to, the blockpos stateatpos(IBlockExtension.canBeHydrated): sethydratestoSome(true)orSome(false), or leave itNonefor vanilla's rule, a fluid in#minecraft:water.FarmlandBlock.randomTickscans the 9×2×9 box frompos(x and z from −4 to 4, y 0 and 1) and asks only where the fluid is not empty, in x, then y, then z order; the first position that hydrates ends the scan, and the farmland goes to moisture 7. A session water ticket waters the farmland without scanning. Asked on an authoritative server; the level is read-only. With no Part attached to the farmland, the scan is vanilla's.
can_drop_ from_ explosion - Side
- server
- Contract
- replace
- Host / context
&dyn LevelHost- NeoForge
IBlockExtension.canDropFromExplosion- Summary
- On an authoritative server, whether the block
stateatpos, destroyed byexplosion, drops (IBlockExtension.canDropFromExplosion), asked whereBlockBehaviour.onExplosionHitasksBlock.dropFromExplosion.Some(false)skips what the drop runs: the block'sspawnAfterBreak(an infested block's silverfish, an ore's experience) and its loot;Some(true)runs them, even for TNT;Nonekeeps vanilla's answer, where only TNT drops nothing. The block is removed either way, and a TNT still primes (TntBlock.wasExplodedis not part of the answer). A panicking part is contained and vanilla's answer is used. The level is read-only. With no part attached to the state, the cost is one table lookup. Diverges from upstream: new hook.
can_entity_ destroy - Side
- server
- Contract
- replace
- Host / context
&dyn Host- NeoForge
IBlockExtension.canEntityDestroy- Summary
- On an authoritative server, whether
entitymay destroy the blockstateatpos(IBlockExtension.canEntityDestroy), asked where vanilla asks its per-block rule: the wither's block break (WitherBoss.canDestroy: not#wither_), a dangerous wither skull's blast (the entity is the skull, readable during the blast; only a block it may destroy has its resistance capped at 0.8), the dragon'simmune checkWalls(a#dragon_block is skipped before the part is asked, and atransparent #dragon_block stays even on a yes), a zombie's door breaking (asked as the goal starts) and the turtle-eggimmune RemoveBlockGoal's target choice.Some(true)makes a block vanilla spares destroyable for that entity,Some(false)spares one it would break (the dragon is then in a wall), andNonekeeps vanilla's rule. The griefing gate (entity_) runs first, so with griefing off nothing breaks whatever the part says, andmob_ griefing living_can still keep a block the part allowed (the egg goal's target choice fires no such event). Ravager: griefing event only. A panicking part is contained and vanilla's rule is used. Asked every tick for each block in the dragon's head, neck and body: answer fast, from the inputs. The host is read-only. With no part attached to the state, the cost is one table lookup. Diverges from upstream: new hook.destroy_ block
can_harvest_ block - Side
- both
- Contract
- collect
- Host / context
HostSide- NeoForge
IBlockExtension.canHarvestBlock- Summary
- Whether the player
player's tool harvests the blockstateatpos(IBlockExtension.canHarvestBlock, whatPlayer.hasCorrectToolForDropsasks of the block).can_starts with vanilla's answer: false for a block that needs a tool the player's held item is not, true otherwise. Set it for your own block; false breaks the block and drops nothing, and the dig is slowed as vanilla slows a wrong tool. The part answers first and the globalharvest player_hears the result, so a mod reacting to every block still has the last word. Asked wherever the harvest rule is: the dig's progress (both sides, so a client predicts it), the break and a door's break.harvest_ check
can_place_ liquid - Side
- both
- Contract
- replace
- Host / context
LevelSide- NeoForge
- —
- Summary
LiquidBlockContainer.canPlaceLiquid: may the block atpostakefluid? The first answeringBlockPartreturnsSome(true)to accept as a container on any template, orSome(false)to refuse as a container.Noneleaves it to the next part, then to the template. A bucket may still replace a replaceable block, or try the block beside the hit.
can_stick_ to - Side
- server
- Contract
- collect
- Host / context
&dyn LevelHost- NeoForge
IBlockExtension.canStickTo- Summary
- Whether the block state this part is attached to sticks to
other, the state beside it (IBlockExtension.canStickTo): setsticksto decide.sticksstarts with vanilla's answer: false for honey beside slime (asis_tells slime), otherwise true when either state is sticky (slime_ block is_). Two blocks stick when each says it sticks to the other, assticky_ block PistonStructureResolverasks (NeoForge'scanStickToEachOther), so a part that answers false for one neighbour is enough to let go of it and a part cannot make a block stick to one that refuses. The pair is asked from both sides, and the other block's part, if it has one, answers its own side. Asked on an authoritative server while a piston resolves its structure: answer from the two states, without touching the world. With no part attached to the state, the cost is one table lookup. Diverges from upstream: new hook.
can_survive - Side
- both
- Contract
- replace
- Host / context
LevelSide- NeoForge
- —
- Summary
BlockState.canSurviveforstateatpos(BlockBehaviour.canSurvive), before the block answers it: as it is placed (BlockItem.canPlace), from a shape update of a block whose template checks it (a plant, a torch, a sign: false breaks the block with its drops), and wherever else vanilla asks.statemay not be in the world yet, so decide fromstate. Answer only for your own blocks:Some(false)refuses the spot,Some(true)allows it, and the block's own rule doesn't run. The level is read-only. Asked on every shape update of such a block: keep it short. Asked on both sides, as vanilla asks it: a client asks it from its placement prediction and its own shape updates, with its loaded copy of the level (matchLevelSide). Reads a client can't answer, tag tests among them, areNonethere, andBlockEntityPartState::gives its default: never answer from those as if they were the server's. Answerstate_ in Noneon a client where only a server can decide: the template's rule then predicts, and the server still decides. Version 2 is catalog metadata; rebuild for theLevelSidesignature. A disabled owner's subscribed rule keeps that block type where it is already present or settling after a piston move or fall, but refuses a new placement.
can_sustain_ plant - Side
- both
- Contract
- replace
- Host / context
LevelSide- NeoForge
IBlockExtension.canSustainPlant- Summary
IBlockExtension.canSustainPlantfor the soilgroundatground_and the plantpos stateabove it, asked before the plant answers its ownmayPlaceOn(may_) wherever vanilla's plant rule reads its ground: when the plant is placed, from its shape update and wherever else vanilla asks.place_ on Some(true)lets the plant stand there,Some(false)refuses it (a planted one pops off when its ground changes to this block), and leftNonethe plant's ownmay_answers, as vanilla's does. Answer only for your own soil. The level is read-only. Runs on every shape update of a plant over a part's block: keep it short. Asked on both sides, as vanilla asks it: a client asks it from its placement prediction and its own shape updates, with its loaded copy of the level (matchplace_ on LevelSide). Reads a client can't answer, tag tests among them, areNonethere, andBlockEntityPartState::gives its default: never answer from those as if they were the server's. Answerstate_ in Noneon a client where only a server can decide: the template's rule then predicts, and the server still decides. Version 2 is catalog metadata; rebuild for theLevelSidesignature. A disabled owner's subscribed soil rule supports plants of this type already above it or settling there, but does not authorize a new planting.
clone_item_ stack - Side
- server
- Contract
- replace
- Host / context
&dyn Host- NeoForge
IBlockExtension.getCloneItemStack- Summary
IBlockExtension.getCloneItemStack, asked byServerGamePacketListenerImpl.handlePickItemFromBlockon the server.playeris the requesting player, available for reads through the Host.include_is true for a creative player picking with Ctrl. The request carries no client hit face. Leavedata stackunset to keep the game's item. Creative breaking, such as a beehive'splayerWillDestroy, does not ask this query.
collision_shape - Side
- both
- Contract
- listen
- Host / context
&dyn LoopContext- NeoForge
- —
- Summary
- The collision shape of the block state
stateatposis being read for the collision queryquery(vanilla'sBlockBehaviour.getCollisionShape(state, level, pos, context)), by an entity's move, a placement check or a projectile's path.queryis vanilla'sEntityCollisionContext, captured when the query was made: the entity's id and class, descending, placement, always-fluid, the main-hand item, andis_.above shapestarts asNone, which keeps the shape the block would otherwise have (its declared one, a context-keyed one, or the one its block entity published); a part that answersSome(boxes)replaces it for this query, as block-local[min_boxes. An answer with more than 64 boxes, a box that is not finite or has a minimum above its maximum is refused. A part that is refused, panics or traps keeps the normal shape, the block'sx, min_ y, min_ z, max_ x, max_ y, max_ z] collision_parts, those of every mod that attaches one to it, are disabled for the session and the game logs it once, naming the block and its mods. It is asked only for blocks with a part that answers it, on the thread that ticks the entity, once for each distinct question (state, position, entity and the rest of the query) in a tick: a step-up retry or a second sweep reads the first answer. Fluid passage and face-support checks never ask. It is given the loopshape contextof the side that ticks the entity and takes noHost: the part answers fromqueryand the state it keeps itself, keyed by the entity's id and synced to the client, which asks the same question for its own prediction. A collision query made inside the callback gets the empty-context answer, never a nested call. Diverges from upstream: new hook.
connects_to - Side
- server
- Contract
- collect
- Host / context
&dyn LevelHost- NeoForge
- —
- Summary
- Whether a fence, wall, or iron bars or pane of yours connects a side: set
connectedto say whether the blockstateatposconnects towardneighbour, the state beside it,directionpointing from the block to that neighbour andface_whether the neighbour's face toward the block is sturdy.solid kindnames vanilla's rule, andconnectedholds its answer:ConnectionKind::isFence FenceBlock.connectsTo(a solid face, a fence of the same kind or a gate across the arm),WallisWallBlock.connectsTo(a wall, a solid face, iron bars or a pane, or a gate across the side; a connected side is still low or tall from the block above) andBarsisIronBarsBlock.attachsTofor iron bars and glass panes (a solid face, bars or a pane, or a wall; vanilla's rule ignoresdirection). Change it, to false as well as to true, when the block is your own. The neighbour's part answers first, incan_, andbe_ connected_ to connectedstarts from its answer: this hook has the last word. Asked whenever the block settles its shape toward a side or is placed, inside the level's update: answer from the arguments without touching the world. Only the block's own part is asked, so vanilla blocks cost nothing. Authoritative servers only. Contract version2: version1wasfence_, for fences alone and withoutconnects_ to kind. Diverges from upstream: new hook.
contents_changed - Side
- server
- Contract
- listen
- Host / context
&mut dyn ServerHost- NeoForge
- —
- Summary
- A server-only, non-cancellable backing-block notice at
Container.setChanged/BlockEntity.setChanged, after the write and before dirty/comparator updates. DefaultITEMSand itemSTORAGEhandlers coalesce implicit notices per backing block at root commit, for vanilla containers and engine-managed mod slots. Duringmenu_, implicit notices publish only after a committed move settles its source slot (including when the source is emptied), and never after an unhandled or refused move. If the original backing container was removed or replaced, neither its replacement nor watchers receive the deferred notice. Explicitquick_ move set_notifies immediately, even for equal contents and inside a transaction; the notice survives abort. Directchanged set_, writes to storage a mod provides itself, and rollback restores synthesize no notice. Nested writes to the backing block whose notice is active still apply, with dirty/comparator updates, but do not re-enter or queue a second notice for that block. Another block notifies normally. Double containers notify each backing component, not the other half merely refreshed for comparators. Vehicle/menu placeholder coordinates are excluded. The source level, pos and state always name the changed backing block.item_ slot observerisNonefor its own Parts, orSomefor Parts of a block entity watching that source throughwatch_. Source Parts run first, then a snapshot of observers in registration order; a stale observer is skipped. A self-watch never duplicates the source callback. Registration changes affect the next notice. Replaces the Create port positionalcontents contents_mixin for depot, package and schematic storage; there is no matching NeoForge bus event. Each Part runs in the existing storage journal. A panic discards that Part's tentative writes (including successful nested transactions), not the backing change that raised the notice or another Part's writes.changed
dispense_method - Side
- server
- Contract
- replace
- Host / context
&mut dyn ServerHost- NeoForge
- —
- Summary
DispenserBlock.getDispenseMethod, before the item'sdispense_: the block the dispenser faces chooses what the dispense does, for any item, including vanilla items, on the authoritative server (not droppers).item stateis the block atposmoved byfacing(air included), and the part is asked only for that block. An answer wins: no item part is asked and vanilla's behaviour doesn't run. The answer isdispense_'s: a remainder of None empties the slot,item Some(stack)replaces it (the hook owns consumption: no extra item is removed afterwards), andeventis the level event played with the smoke: 1000 the click, 1001 the fail sound, or 0 for no sound or smoke. Leave answer None anddispense_decides. In an open transaction in the dispenser's level, sound and smoke follow the behaviour's published effects at the outermost commit and are discarded on abort. The remainder is detached until the dispenser writes its slot. An invalid remainder is reported without writing or notifying the slot, and no other behaviour runs. A disabled owner's subscribed method skips the slot write and dispense events unless an earlier enabled Part supplies a reply the engine accepts.item
enchant_power_ bonus - Side
- both
- Contract
- collect
- Host / context
&dyn Host- NeoForge
IBlockExtension.getEnchantPowerBonus, IBlockStateExtension.getEnchantPowerBonus- Summary
- The enchanting power the supplied
stateatposgives the table attable_(pos IBlockExtension.getEnchantPowerBonus).powerstarts at 1.0 for a block in#minecraft:enchantment_, 0.0 otherwise. Explicit reads return the answer unchanged; offers and particle sampling ignore a non-finite override.power_ provider
entity_inside - Side
- server
- Contract
- collect
- Host / context
&mut dyn LevelRandomHost- NeoForge
- —
- Summary
- An entity's block sweep crossed a block state this part is attached to (
Block.entityInside), and the part is told mid-sweep, where vanilla runs the block's ownentityInside.event.preciseisEntity.checkInsideBlocks' flag: the entity moved nearly a block, or its box at the target touches the block. It runs inside the entity's move, on the level random host: it reads blocks and draws the level's random in vanilla's order, interleaved with the vanilla blocks the same walk visits; only writes are restricted to the event.event.applyqueues one of the fiveInsideBlockEffectTypes,event.run_/before event.run_queue a typed entity write around one, andafter event.requestasks for a level write that lands at the touched block once the entity's batch has ticked, if the block is still the state it touched — the same contract as a landing write, whose complete batch is checked before queuing and an invalid state refuses all writes and sibling outputs. The queued entity writes apply to the swept entity inside its own tick, inStepBasedCollectororder, and stop when it dies.EntityWrite::deals the registered type in the level without a causing or direct entity. Fires for players, mobs, items and projectiles alike, each on the shared walk inside its own tick or batch. Inside hurt writes apply to players, mobs and dropped items. Armor stands, projectiles and vehicles ignore contact hurt; experience orbs accept hurt only fromHurt { damage_ type, amount } step_.on
exp_drop - Side
- server
- Contract
- replace
- Host / context
&dyn LevelHost- NeoForge
IBlockExtension.getExpDrop- Summary
- Experience before enchantments (
IBlockExtension.getExpDrop). First answer replaces vanilla sampling; the global break_block event may override it. Negative answers are clamped to 0; positive values are awarded as given. A panic unwinds before the answer is applied.
explosion_resistance - Side
- server
- Contract
- replace
- Host / context
&dyn LevelHost- NeoForge
IBlockExtension.getExplosionResistance- Summary
- On an authoritative server, the explosion resistance of the block
stateatposagainstexplosion(IBlockExtension.getExplosionResistance), asked as a ray of the blast enters the block (ExplosionDamageCalculator.getBlockExplosionResistance). The answer replaces only the block's own value (BlockProperties.explosion_); a fluid in the cell still raises it to the fluid's 100. What vanilla applies after the block's value keeps winning: a respawn anchor's water cell, a TNT minecart's rails and the blocks under them (never asked) and a dangerous wither skull's 0.8 cap. A negative or non-finite answer is refused and the block's own value is used; a panicking part is contained and the block's own value is used. A ray asks once per block it enters, so keep the answer a pure function of the inputs. The level is read-only. With no part attached to the state, the cost is one table lookup. Diverges from upstream: new hook.resistance
fall_on - Side
- server
- Contract
- collect
- Host / context
&mut dyn LevelRandomHost- NeoForge
LivingFallEvent- Summary
- An entity landed on a block state this part is attached to (
Block.fallOn), after fallingevent.distanceblocks. Writableevent.distanceandevent.damage_feed the fall calculation before hurt and sounds. The multiplier starts at the block's vanilla value (normally 1.0). Damage ismultiplier floor((distance + 1e-6 - safe_, with safe fall distance 3 by default. Halving distance is not halving damage. Zero multiplier or a distance within the safe fall prevents damage and generic fall sounds. An entity that cannot be hurt by the fall (creative, fall immune) is told with zero multiplier and keeps its immunity, and a cancelled fall still lands. It runs inside the entity's move, on the level random host: it reads blocks and draws the level's random in vanilla's order, and cannot write. A write the override makes (farmland turning to dirt, a turtle egg breaking) is asked withfall_ distance) * damage_ multiplier * fall_ damage_ multiplier_ attribute) event.request(LandingWrite::orSetBlock(state)) LandingWrite::and lands at the block the entity landed on once the entity's batch has ticked, in the order asked, if the block is still the state it landed on. SetBlock takes an API BlockState. The complete requested batch is checked before queuing: an invalid key or ordinal refuses all writes and sibling outputs from that callback, including distance and multiplier. The original landed-state guard is checked once per batch, not between its ordered writes. Players, mobs and dropped items land here (an item as anDestroyBlock { drop } EntityRefof kindminecraft:item, with zero multiplier: items take none); projectiles and the other entities do not.
falling_tick - Side
- server
- Contract
- listen
- Host / context
&mut dyn ServerHost- NeoForge
IFallableExtension.fallingTick- Summary
- A falling block of
stateticked and is still in the air (IFallableExtension.fallingTick):entityis the falling block, andposthe block it is in (Entity.blockPosition) after its move. Heard once for each tick that ends with it still falling, not in the tick it lands, drops as an item or is removed (that isFallable.onLand's moment). The part can write to the level and, throughentity, to the falling block: its velocity, its position. The tick is recorded as it ends and delivered once the level's falling blocks, primed TNT and orbs have ticked in this pass, so a write lands on the stored falling block; a falling block gone by then is skipped. Diverges from NeoForge: server only, where NeoForge also calls it on the client. Only a state a part listens to is recorded; with no such part, one table lookup per falling block per tick. Diverges from upstream: new hook.
fence_gate_ in_ wall - Side
- both
- Contract
- replace
- Host / context
LevelSide- NeoForge
- —
- Summary
- Whether
state, the neighbour of a fence gate, counts as a wall for that gate'sin_property (wall FenceGateBlock.isWall). Asked of the neighbour's block part, on placement and horizontal shape updates on both sides.Some(true)lowers the gate,Some(false)rejects this neighbour, andNonekeeps vanilla'sminecraft:wallstag check. This does not change wall connections or pathfinding. Answer from the state alone; the host is read-only.
fire_odds - Side
- both
- Contract
- replace
- Host / context
LevelSide- NeoForge
IBlockExtension.getFlammability, IBlockExtension.getFireSpreadSpeed, IBlockExtension.isFlammable- Summary
- How fire treats the block
stateatposon either side (FireBlock.setFlammable(block, igniteOdds, burnOdds)). The client reads ignite odds for placement and shape prediction; only the server burns blocks. From the block's sideface, the one facing the fire or the air fire may take, put(ignite, burn)inoddsfor your own blocks, and vanilla's table isn't read. Ignite odds above zero let fire stand beside the block and spread into the air around it (planks 5, wool 30, leaves 30); burn odds are how fast fire destroys it (planks 20, wool 60, leaves 60).(0, 0)never burns, and a face with ignite odds of zero isn't flammable. Negative answers become zero; burn odds cap at 300 (horizontal rolls are 300, vertical rolls 250), and spread speed uses saturating arithmetic. A waterlogged state never burns and isn't asked. Answer only for your own blocks and leaveoddsempty otherwise; the level is read-only. Asked hundreds of times per fire tick: keep it short.
friction- Side
- both
- Contract
- listen
- Host / context
LevelSide- NeoForge
IBlockExtension.getFriction- Summary
- The friction of
stateatpos(IBlockExtension.getFriction), for an optional entity (its id and type). The state need not occupy that position. The read-only level host reads the side that made the query: blocks, states, light, fluids, weather, enabled features, tags and resident block entities, as the other level hosts do, without loading chunks. It has no container, shape or signal view and answersNonefor those. Block-entity handles are the side's own: a client's is not the server's, so answer from state both sides hold. Setevent.frictionto answer; it starts at the state's own coefficient. Any finite answer is used as given, as vanilla uses whatgetFrictionreturns; a non-finite one keeps that coefficient. Runs on both sides, including during client replay. Keep the answer a pure function of the event and the level reads.
has_analog_ output - Side
- server
- Contract
- collect
- Host / context
&dyn LevelHost- NeoForge
- —
- Summary
BlockState.hasAnalogOutputSignal: setoutputfor a block of yours that comparators read (how full or far along it is, as a composter's level), so they askanalog_. Asked from inside the level's update: answer fromoutput statealone. Authoritative servers only.
ignited_by_ lava - Side
- server
- Contract
- replace
- Host / context
&dyn LevelHost- NeoForge
IBlockExtension.ignitedByLava- Summary
- On an authoritative server, whether lava sets fire beside the block
stateatpos(LavaFluid.isFlammable, the only reader ofBlockStateBase.ignitedByLava), asked from its sideface, the one that faces the air the fire would take, as lava's random tick looks for something to light.Some(true)lets lava light it,Some(false)refuses it, and leftNonethe block's own flag answers, as vanilla's does (planks, wool and leaves yes; stone no). Answer only for your own blocks. The level is read-only.
is_bonemeal_ success - Side
- server
- Contract
- collect
- Host / context
&mut dyn LevelRandomHost- NeoForge
- —
- Summary
BonemealableBlock.isBonemealSuccessfor a block that answeredis_, after it did: setvalid_ bonemeal_ target successto grow it this time. Vanilla draws the level's random here (isBonemealSuccess(Level, RandomSource, BlockPos, BlockState)). Usehost.with_to draw from that live stream in vanilla's order. Authoritative servers only.random(|rng| rng.next_ int_ bound(bound))
is_fertile - Side
- server
- Contract
- collect
- Host / context
&dyn LevelHost- NeoForge
IBlockExtension.isFertile- Summary
- Whether the soil this part is attached to, the block
stateatposunder a growing crop, counts as moist (IBlockExtension.isFertile): setfertileto decide.fertilestarts with vanilla's answer,moisture > 0.CropBlock.getGrowthSpeedasks it for each of the 3×3 blocks under a crop, stem or pitcher crop on its random tick, but only for a block in#minecraft:grows_: a fertile one adds 3 to the speed, any other tagged block 1 (a quarter of that off-centre), so a block outside the tag is never asked. Asked on an authoritative server; the level is read-only. With no part attached to the state, the cost is one table lookup. Diverges from upstream: new hook.crops
is_fire_ source - Side
- server
- Contract
- replace
- Host / context
&dyn LevelHost- NeoForge
IBlockExtension.isFireSource- Summary
- On an authoritative server, whether the block
stateatpos, under a fire, keeps that fire burning (FireBlock.tick's check of the dimension'sinfiniburntag), asked on every tick of the fire above it:Some(true)makes the fire endless, as netherrack does in the overworld (rain doesn't put it out and it never burns out), andSome(false)refuses a block the tag lists. LeftNone, the dimension's tag answers. Asked only for the block under a fire, so its side is always the top. Answer only for your own blocks. The level is read-only.
is_ladder - Side
- both
- Contract
- listen
- Host / context
&dyn LoopContext- NeoForge
IBlockExtension.isLadder- Summary
- Whether a living entity climbs the block state this part is attached to (
IBlockExtension.isLadder, whichLivingEntity.onClimbableasks of the block the entity stands in).entityis the climber's id andposthe block it stands in;stateis that block's state.ladderstarts with vanilla's answer, whether the block is in#minecraft:climbable, and a part may set either value:truemakes the block climbable as a ladder is,falserefuses it though the tag lists it. A gliding entity (isFallFlying) in a#minecraft:can_block, a spectator and a player who is flying are never asked, as vanilla never climbs for them, and an open trapdoor over a ladder climbs as before. Read for the player, the mobs, and the climbing a mod reads throughglide_ through LivingRef::. It fires on both sides and on the client's replayed ticks, so register the mod on both and keep the listener a pure function of its inputs. It is given the loopis_ climbing contextof the side that ticks the entity, and takes noHost. With no part attached to the state, the owning game checks the hook subscription and prepared API block key before any event conversion, so the cost is one table lookup. Armor stands never ask it. Diverges from upstream: new hook.
is_pathfindable - Side
- server
- Contract
- collect
- Host / context
&dyn Host- NeoForge
- —
- Summary
- Changes whether a path of a
PathComputationType(Land,WaterorAir) may go through a block state.event.pathfindablestarts with the block's own answer. The answer depends on the state and the type alone: the game asks once per state and type when parts resolve, at world load and on every/, so path finding and spawning read the stored answer and a part cannot answer from a position, level or time. The state'sreload PathTypefollows theLandanswer as vanilla's does, unless the block has a type of its own (air, doors, fences, leaves, rails...):Blockedwhen it is no, elseWaterfor a water state, elseOpen.block_is asked after it.path_ type
is_possible_ to_ respawn_ in - Side
- server
- Contract
- replace
- Host / context
&dyn Host- NeoForge
- —
- Summary
- Whether a player can respawn inside
stateat a forced spawn point (Block.isPossibleToRespawnInThis). The server asks for the saved point and the block above it when no applicable bed or anchor rule handles the spawn, including when a bed or anchor cannot set spawn here.Some(true)accepts the space,Some(false)refuses it, andNonekeeps the block's vanilla predicate. The state alone determines the answer; the host is read-only. This does not choose a bed or anchor's stand-up position (seerespawn_).position
is_signal_ source - Side
- server
- Contract
- listen
- Host / context
&dyn LevelHost- NeoForge
- —
- Summary
BlockState.isSignalSource: setsourcefor a block of yours that gives a signal, so redstone wire beside it connects to it. Authoritative servers only.
is_slime_ block - Side
- server
- Contract
- collect
- Host / context
&dyn LevelHost- NeoForge
IBlockExtension.isSlimeBlock- Summary
- Whether the block state this part is attached to counts as a slime block to a piston (
IBlockExtension.isSlimeBlock, whichPistonStructureResolverasks wherever it tells slime from honey): setslimeto decide.slimestarts with vanilla's answer, true forminecraft:slime_only. The structure resolver reads it for the one pair that never sticks, slime beside honey, so a block answering true is held apart from honey as slime is; stickiness itself isblock is_'s. Asked on an authoritative server while a piston resolves its structure: answer from the state, without touching the world. With no part attached to the state, the cost is one table lookup. Diverges from upstream: new hook.sticky_ block
is_sticky_ block - Side
- server
- Contract
- collect
- Host / context
&dyn LevelHost- NeoForge
IBlockExtension.isStickyBlock- Summary
- Whether the block state this part is attached to is sticky to a piston (
IBlockExtension.isStickyBlock): setstickyto decide.stickystarts with vanilla's answer, true forminecraft:slime_andblock minecraft:honey_. A sticky block pulls along the blocks beside it thatblock can_lets it hold, so a piston moving one drags its neighbours, and a structure of them moves as one (still at most twelve blocks). A block that is not sticky still moves with a sticky neighbour that holds on to it, because sticking needs one sticky side. Asked on an authoritative server while a piston resolves its structure: answer from the state, without touching the world. With no part attached to the state, the cost is one table lookup. Diverges from upstream: new hook.stick_ to
is_valid_ bonemeal_ target - Side
- both
- Contract
- replace
- Host / context
LevelSide- NeoForge
- —
- Summary
- A block nothing in Sunrise knows a
BonemealableBlockfor is about to take bone meal: vanilla'sBonemealableBlock.isValidBonemealTarget,statethe block's own state atpos. Answervalidfor your own blocks: the meal is used up on one as vanilla uses it up (the growth particles and the sound follow, whether or not the roll below grows it), from a player'sBoneMealItem.useOn, from a dispenser and, on a crop (a villager bonemeals only aCropBlock), from a villager. Asked on both sides, as vanilla asks it on both, so a client predicts the use with your answer: say no where you can only grow on a server (matchLevelSide).Some(false)refuses the meal, even on a block whose template takes it (vanilla'sgrowCropthen keeps the meal); leftNone, the block keeps theBonemealableBlockits template gives it, or takes no bone meal. A disabled owner's subscribed Part refuses bone meal.
item_after_ vertical_ collision - Side
- both
- Contract
- cancel
- Host / context
HostSide- NeoForge
- —
- Summary
native_lends a dropped item's active stack after vertical collision response, before block effects, merging and pickup. The block is the one selected by the legacy on-position query.item_ after_ vertical_ collision clientidentifies prediction. Setdiscard(traitFlow::) or set the stack to None to consume the item without loot or pickup. A movement skipped by the normal item tick sends no notification. Bundles need "hooks": @API:item_after_vertical_collision@.Cancel
light_emission - Side
- both
- Contract
- replace
- Host / context
&dyn Host- NeoForge
IBlockExtension.getLightEmission, IBlockStateExtension.getLightEmission- Summary
- The light the block
stateemits atposindimension(IBlockExtension.getLightEmission), for a block that declaresdynamic_. The declaration is per block, not per state aslight: true hasDynamicLightEmissionis, because it lives on the block's row: every state of a declared block is asked, and parts on other blocks are never asked, at any moment (NeoForge asks on a block change and a queued check whether or not the block declares).emissionstarts empty: setSome(level)to replace the state's own light at that position, or leave it empty to keep it.LevelRef::can explicitly query a candidate state that is not the state atget_ light_ emission pos. Treatstateas the emitter and use the named dimension and position for context. Explicit reads return the raw value; only publication to the light queue clamps an answer above 15. Asked only on the thread that owns the level, both sides, with that level read-only, as a chunk holding the block comes in, as an edit sets it and atLevelRef::(check_ light LevelLightEngine.checkBlock); the light engine keeps the answer until the cell's state changes or the chunk unloads, its workers read only that answer, and it never asks on its own: an answer that reads more than the state (the block below, the depth) callscheck_when that changes. A client also asks its own parts again, at most once per cell, for the sections a server's light update changed: a Sunrise addition, as the contract asks on no light packet, for an answer that reads data the client receives later. Not asked for the block's own rendered light, ambient occlusion or the spawn rule, which take the state's light. The game may ask more often than the contract does, so keep the answer a pure function of the level,light posandstate. Diverges from upstream: new hook.
makes_open_ trapdoor_ above_ climbable - Side
- both
- Contract
- listen
- Host / context
&dyn LoopContext- NeoForge
IBlockExtension.makesOpenTrapdoorAboveClimbable- Summary
- Whether an open trapdoor above the block state this part is attached to climbs like a ladder (
IBlockExtension.makesOpenTrapdoorAboveClimbable, whichLivingEntity.onClimbableasks of the block under the open trapdoor a living entity stands in).stateis that block's state andposits position;trapdooris the open trapdoor's state above it.climbablestarts with vanilla's answer, true for aminecraft:ladderfacing the trapdoor's way, and a part may set either value. Asked only once the trapdoor itself was not a ladder (is_and theladder #minecraft:climbabletag), so it never makes a block that is a ladder stop climbing. A gliding entity in a#minecraft:can_block, a spectator and a player who is flying are never asked. Read for the player, the mobs, and the climbing a mod reads throughglide_ through LivingRef::. It fires on both sides and on the client's replayed ticks, so register the mod on both and keep the listener a pure function of its inputs. It is given the loopis_ climbing contextof the side that ticks the entity, and takes noHost. With no part attached to the state below, the owning game checks the hook subscription and prepared API block key before any event conversion, so the cost is one table lookup. Armor stands never ask it. Diverges from upstream: new hook.
may_place_ on - Side
- both
- Contract
- replace
- Host / context
LevelSide- NeoForge
IBlockExtension.canSustainPlant- Summary
VegetationBlock.mayPlaceOnfor the plantstateongroundatground_. The plant inherits vegetation rules from its template or opts into them in its block declaration. Only when the soil'spos can_leaves the decision to the plant does this method answer what it can stand on. Answer only for your own blocks. The level is read-only. Asked on both sides, as vanilla asks it: a client asks it from its placement prediction and its own shape updates, with its loaded copy of the level (matchsustain_ plant LevelSide). Reads a client can't answer, tag tests among them, areNonethere, andBlockEntityPartState::gives its default: never answer from those as if they were the server's. Answerstate_ in Noneon a client where only a server can decide: the plant's default rule then predicts, and the server still decides. Version 2 is catalog metadata; rebuild for theLevelSidesignature. A disabled owner's subscribed rule preserves a plant of this type already at the position or settling there, but does not authorize a new planting.
minecart_pass - Side
- server
- Contract
- listen
- Host / context
&mut dyn ServerHost- NeoForge
- —
- Summary
- A minecart passed over a rail block state this part is attached to (the moment
AbstractMinecartcallsactivateMinecarton an activator rail, for every rail; Forge'sIBaseRailExtension.onMinecartPass, which NeoForge 26.3 no longer has, so this hook has no counterpart).event.entityis the cart,event.posthe rail. With the old minecart physics it fires once per tick the cart is on a rail; withminecart_once per track iteration, so a fast cart can pass several times in a tick. It fires after the cart's batch has ticked, not mid-move, so a write the part makes (a velocity change through the cart handle) lands on the stored cart, and a pass whose cart is gone or whose rail changed is dropped. Only a rail state a part listens for is recorded; with no such part nothing is kept. Diverges from upstream: new hook.improvements
neighbor_changed - Side
- server
- Contract
- listen
- Host / context
&mut dyn LevelWriteHost- NeoForge
- —
- Summary
- An authoritative server is about to deliver
neighborChanged. State and block IDs are valid in this level's registries for this call. The host is the level writer vanilla'sneighborChangedgets: a part may read its inputs (signal,has_), schedule its tick, as a diode does (neighbor_ signal DiodeBlock.checkTickOnNeighbor), and set blocks, asRedstoneLampBlocklights itself at once (level.setBlock(pos, state.cycle(LIT), 2)). A write's own neighbour updates run next, before the rest of the update that delivered this call (CollectingNeighborUpdater), asLevel.setBlockfrom insideneighborChangedruns them. The block's own handling then runs with the state it was called with.
on_block_ exploded - Side
- server
- Contract
- listen
- Host / context
&mut dyn ServerHost- NeoForge
IBlockExtension.onBlockExploded- Summary
- An explosion destroys this block, before removal and while its live block entity is readable. Writes are allowed; the engine still replaces the cell with air afterwards, including a replacement written by the part.
on_block_ state_ change - Side
- both
- Contract
- listen
- Host / context
LevelSide- NeoForge
IBlockExtension.onBlockStateChange- Summary
- A write through
Level.setBlockheld and the block atposchanged fromoldtonew(IBlockExtension.onBlockStateChange), heard at the end of the write, where vanilla runsupdatePOIOnBlockStateChange: after the block-entity removal,on_, the client update, the neighbour updates and the neighbours' shape updates. The parts ofplace old's block hear it, then, when the block changed, the parts ofnew's block;stateis the state whose block's parts are asked. A write thaton_replaced with another block is not heard; the write that replaced it is. Heard on both sides: a server's writes, a client's replay of a piston's move and the blocks a client takes from the server (place LevelSidenames which). Applied local predictions are heard at once withpredicted: true; server writes, settled corrections and all server-side writes havepredicted: false. A held server update is unheard until acknowledgement; a confirmed prediction is not heard twice, and a denial hears predicted-to-server once. Equal-state writes and unapplied guesses are not heard. The level is read-only. A panicking part is contained. With no listener, one flag check builds nothing. Diverges from upstream: new hook.
on_caught_ fire - Side
- server
- Contract
- listen
- Host / context
&mut dyn LevelWriteHost- NeoForge
IBlockExtension.onCaughtFire- Summary
- On an authoritative server, a neighbour of fire passed its burn roll.
stateis still atpos;facepoints toward the fire. The spread, burn and (when replacing with fire) ignite cancel gates run first. The listener may write or schedule ticks, but the pending fire/air replacement overwrites any write atpos, then TNT is primed. Fire spread has no igniter and an empty stack, so neither is passed. Lava, lightning, spread into air, flint and steel, TNT use, burning projectiles, redstone and dispensers are outside this spread-only hook.
on_destroyed_ by_ player - Side
- server
- Contract
- replace
- Host / context
&mut dyn ServerHost- NeoForge
IBlockExtension.onDestroyedByPlayer- Summary
- A player removes the block
stateatpos(IBlockExtension.onDestroyedByPlayer, whereServerPlayerGameMode.destroyBlockrunsplayerWillDestroyand removes the block), withtool, the stack in the player's hand (Nonefor a bare hand), andwill_, whether the break will drop loot as far as the tool goes (never in creative, and false for a tool the block refuses). Asked afterharvest break_allowed the break, before anything of the break changes the world.block will_is the tool's own answer; the mods' harvest listeners (harvest can_, thenharvest_ block player_) are asked once, after the removal, of the adjusted state and the stack in the hand then, as vanilla readsharvest_ check hasCorrectToolForDrops.destroyedis whether the block was actually destroyed:Some(true)says the part removed it itself,Some(false)that it stays (a block of layers losing one layer: change it with thehostand leave it standing), and either answer replaces the game's ownplayerWillDestroy(a pot's cracking, piglin anger, a tripwire's disarming, a creative shulker box's or beehive's drop) and removal.Some(false)ends the break there: no drops, tool wear or statistic. LeftNone, vanilla's removal runs. Server-side, for every player of the world; the first part answering wins. Asked of the block's own parts only, so a block with none costs nothing.
on_destroyed_ by_ push_ reaction - Side
- server
- Contract
- listen
- Host / context
&mut dyn LevelWriteHost- NeoForge
IBlockExtension.onDestroyedByPushReaction- Summary
- On an authoritative server, a piston's move destroys the block
stateatpos(IBlockExtension.onDestroyedByPushReaction),directionthe way the blocks move andfluidthe fluid state the cell holds. It is heard inPistonBaseBlock.moveBlocksafter the block dropped its resources and while it is still in its cell, before the cell becomes air. The removal still happens: a write toposis overwritten, and so is a write to any other cell of the move (the other destroyed cells, the pushed blocks and the cells they move into, the arm), since the pushed blocks were read before the destroy loop. Writes elsewhere stay;ticksis the move's, so scheduled ticks stay too. A cancelled move (piston_) and a client's replay of the move are not heard. A panicking part is contained. With no part attached to the state, the cost is one table lookup per destroyed block. Diverges from upstream: new hook; the removal is not replaceable here.pre
on_neighbor_ change - Side
- server
- Contract
- listen
- Host / context
&dyn LevelHost- NeoForge
IBlockExtension.onNeighborChange- Summary
- A neighbouring block entity changed, was created or removed. Vanilla comparator processing runs first.
on_tree_ grow - Side
- server
- Contract
- replace
- Host / context
&dyn WorldgenHost- NeoForge
IBlockExtension.onTreeGrow- Summary
- A trunk placer is about to place the block under its trunk at
pos, where the soilstatethis part is attached to stands (IBlockExtension.onTreeGrow, asked fromTrunkPlacer.placeBelowTrunkBlock). AnswerSome(Some(state))to placestatethere through the tree's trunk setter,Some(None)to place nothing, orNoneto leave it to the tree'sbelow_(vanilla's trees place dirt unless the soil is intrunk_ provider #minecraft:cannot_). A part that answers skips the provider and its draws. Asked once per trunk, four times for the 2×2 trunks (giant, mega jungle, dark oak). Draw only fromreplace_ below_ tree_ trunk event.random, the tree's own: your draws fall between the tree's, in call order. Server-side, on the worldgen worker threads and on the server thread when a sapling grows, with the server's worldgencontext: noHost, no writes. NeoForge'sfeatureargument is left out: an inline tree feature has no key. Diverges from upstream: new hook. A disabled owner's subscribed Part keeps the soil unchanged; the rest of the tree still grows.
perform_bonemeal - Side
- server
- Contract
- listen
- Host / context
&mut dyn LevelWriteHost- NeoForge
- —
- Summary
BonemealableBlock.performBonemealfor a block that answeredis_and whosevalid_ bonemeal_ target is_said yes: grow it here,bonemeal_ success stateits state atpos. The meal is used up either way. Change the block with the level'snative_, and schedule withset_ block_ property native_(schedule_ block_ tick ticksis the hook's). Authoritative servers only.
piston_carries_ block_ entity - Side
- both
- Contract
- replace
- Host / context
LevelSide- NeoForge
- —
- Summary
- Whether a piston carries your block
stateatposwith its block entity: asked at the last step ofPistonBaseBlock.isPushable, after the block's push reaction, for a block that is otherwise pushable, whenever a piston's structure takes the block in. LeftNone, vanilla's rule holds: a block with a block entity does not move, and any other block does.Some(false)keeps the block in place at that position.Some(true)lets a piston move it even with a block entity, which travels with the block: taken out of the world as the move starts, with its saved data and its attachments and without its removal side effects (nothing drops), and put where the block lands as a new block entity of that position, with a new ticker slot; a handle to the old position no longer resolves. If the moving block is replaced before it lands, the block entity is removed there as a broken block's is (a container drops its contents). A save mid-move keeps it in the moving piston's tag. A block entity, including a chest, moves only after its reaction permits movement and this hook answers true. While the block moves it draws as its state, without its block entity's drawing. Asked on both sides, as a client replays the move on its own copy: answer the same on both, from the arguments, without touching the world. Only attached block parts are asked; blocks without a subscribed part pay only the dispatch guards. A block that only needs to move or not, or to be popped or pushed only, is the push reaction's question, asked before this one. The order is reaction first, then this shared block-entity rule for push-pull, ignore-entity and push only; a wrong-direction push-only answer refuses before this hook. Popped destroys and drops without asking it. This hook is asked only for an otherwise-pushable block. A live owned payload is required: data-only or unmaterialized vanilla entities remain refused. Diverges from vanilla: push only never discards a block entity. NeoForge has no counterpart: itsIBlockExtension.getRelocabilityis an unrelated region-copy query that pistons do not ask. Diverges from upstream: new hook.
piston_push_ reaction - Side
- both
- Contract
- replace
- Host / context
- —
- NeoForge
IBlockExtension.getPistonPushReaction- Summary
- Resolve a state's piston reaction at load and reload on both sides. None keeps the properties' reaction. Answers must depend only on state. Unbreakable blocks still refuse movement. The reaction is checked first; push-pull, ignore-entity and push only then reach the shared block-entity rule. An otherwise-pushable block with a block entity moves only when
piston_answers true, using the carry machinery to move its data and attachments without drops. No answer or false refuses the move. Popped remains destruction with ordinary drops, and never asks the carries hook. The carries hook is asked only for an otherwise-pushable block. Carrying also requires a live owned payload; raw-only or currently borrowed native payloads remain refused. Diverges from vanilla: push only never discards a block entity.carries_ block_ entity
place_liquid - Side
- server
- Contract
- replace
- Host / context
&mut dyn LevelWriteHost- NeoForge
- —
- Summary
LiquidBlockContainer.placeLiquid, before the template fillsstateatpos. A bucket supplies a sourcefluid; spreading supplies the state that would flow there. Live structure templates supply the displaced fluid or a neighbouring source, without askingcan_. The firstplace_ liquid Some(bool)replaces the template. Return true after storing the fluid and scheduling any tick it needs, or false when it was not placed.Noneleaves it to the next part, then to the template. A plain bucket still empties on false, unlike a validated fluid-container operation.
play_hit_ sound - Side
- client
- Contract
- cancel
- Host / context
&mut dyn ClientHost- NeoForge
IClientBlockExtensions.playHitSound- Summary
- Asked before a mining hit sound, including the initial hit, every fourth breaking tick, and the level-event route. Return Flow::Cancel when the part handled the sound through ClientHost and vanilla should stay silent. Otherwise vanilla plays the state's hit sound at (volume + 1) / 8 and pitch * 0.5. The position and face identify the current hit; sculk growth is outside this hook.
rail_can_ make_ slopes - Side
- server
- Contract
- collect
- Host / context
&dyn LevelHost- NeoForge
IBaseRailBlockExtension.canMakeSlopes- Summary
- Whether the rail
stateatposmay climb toward a raised rail beside it (IBaseRailBlockExtension.canMakeSlopes).canstarts true, as for every vanilla rail; set false to keep it flat as it connects to its neighbours (RailState). Asked on an authoritative server as a rail is placed or a neighbour changes it: answer from the state and the position, without touching the world. With no part attached to the state, the cost is one table lookup. Diverges from upstream: new hook.
rail_direction - Side
- both
- Contract
- collect
- Host / context
LevelSide- NeoForge
IBaseRailBlockExtension.getRailDirection- Summary
- The track the rail
stateatposlays forcart(IBaseRailBlockExtension.getRailDirection), so a switch track or a one-way rail can turn a cart differently from its stored shape.shapestarts at the rail'sshapeproperty.cartis the minecart moving on it, orNonewhen the rail asks for itself: as it connects to its neighbours (RailState) and as a minecart item is placed on it. The cart's movement asks wherever it reads the track under it. Asked on both sides, since a client predicts its own cart's motion: register the mod on both and answer the same on each, from the level host and the event alone. With no part attached to the state, the cost is one table lookup per rail read. Diverges from upstream: new hook.
rail_flexible - Side
- server
- Contract
- collect
- Host / context
&dyn LevelHost- NeoForge
IBaseRailBlockExtension.isFlexibleRail- Summary
- Whether the rail
stateatposmay make corners (IBaseRailBlockExtension.isFlexibleRail).flexiblestarts true for a plain rail and false for the straight ones (powered, detector, activator); set false to keep it straight at a junction. Asked on an authoritative server as the rail and its neighbours connect (RailState): answer from the state and the position, without touching the world. With no part attached to the state, the cost is one table lookup. Diverges from upstream: new hook.
rail_valid_ shape - Side
- server
- Contract
- collect
- Host / context
&dyn LevelHost- NeoForge
IBaseRailBlockExtension.isValidRailShape- Summary
- Whether the rail
statemay takeshape(IBaseRailBlockExtension.isValidRailShape), asked as it connects to its neighbours (RailState) before the shape is written.validstarts true when the rail'sshapeproperty has that value; set false to refuse it, and the rail keeps its current shape. A part can't make valid a shape the property lacks. Asked on an authoritative server: answer from the state and the shape, without touching the world. With no part attached to the state, the cost is one table lookup. Diverges from upstream: new hook.
random_tick - Side
- server
- Contract
- cancel
- Host / context
&mut dyn LevelWriteHost- NeoForge
- —
- Summary
- An authoritative server's
ServerLevel.tickChunkis about to random-tick the blockstateatpos(BlockState.randomTick): only blocks that tick randomly, a mod's as its vanilla template block does. Bone meal's random ticks (StemBlock.performBonemeal) don't fire it. Change the block withnative_and setset_ block_ property handledto skip the block's own random tick (a mod crop growing its own way); a block changed withouthandledtakes its own random tick as it is now, if it still ticks randomly. Lava's fluid random tick runs either way. Its disabled owner's subscribed Part keeps the block inert instead of running the template tick.
remove_block - Side
- server
- Contract
- replace
- Host / context
&dyn LevelHost- NeoForge
- —
- Summary
- Choose the state left by removing your block. Return a state in
answerto replace vanilla's fluid block (air when dry), or leave it unanswered.replacementis the state written when the listener leavesanswerunanswered: the fluid's legacy block (air when dry, water for a waterlogged block). Only the removed block's Part is asked, on the authoritative server. The replacement must be a registered block state; an invalid answer is refused with a diagnostic and vanilla's replacement is written instead. The normal setBlock effects and flags 3 (+64 when moved by a piston) apply to the written state. The level is read-only during this call.
respawn_position - Side
- server
- Contract
- collect
- Host / context
&dyn Host- NeoForge
IBlockExtension.getRespawnPosition, IBlockStateExtension.getRespawnPosition- Summary
- Where a player whose respawn point is the block
stateatposstands up when they respawn there (IBlockExtension.getRespawnPosition), or that they can't respawn there.entity_is the respawning entity's type, alwaystype minecraft:player, andorientationthe yaw saved with the respawn point.positionstarts at vanilla's answer: a bed's or a charged respawn anchor's stand-up spot facing the block, a forced point's free column, or empty where vanilla finds no spot. SetSome((position, yaw, pitch))to stand the player there, orNoneto send them to the world spawn withmissing_set. An answer with a non-finite value is ignored. An anchor still loses a charge only when the answer is a spot. Asked on the server as the respawn point is resolved, beforerespawn_ block player_, which receives the answer as its original position and may still redirect it, and as a player leaves the End, which resolves the point the same way. A same-level End exit clamps the answer's pitch torespawn_ position -90..=90when it teleports the player. The level is read-only. NeoForge asks only beds; this is asked for any block, so a mod block that is neither a bed nor an anchor can be a respawn point. With no part attached to the state, the game checks the hook subscription and the block key before any event conversion, so the cost is one table lookup per respawn. Diverges from upstream: new hook.
rotate- Side
- server
- Contract
- collect
- Host / context
&dyn WorldgenHost- NeoForge
IBlockExtension.rotate- Summary
- A structure template is about to place the block
stateatposturned byrotation(IBlockExtension.rotate, where vanilla runsstate.mirror(mirror).rotate(rotation)):stateis already mirrored, androtatedstarts at the game's own answer (vanilla's table, or a mod block's template's). Set it to another state of the same block to place that instead. A state of another block, or one the game does not have, is refused and the game's answer kept. Asked for every block a template places: world generation's structures,/, the structure block and the jigsaw pieces that join them, and the template snapshotsplace template structure_reads. Mirroring stays the game's. Server-side, on the worldgen worker threads and on the server thread, with the server's worldgentemplate context: noHost, no writes;context.state_builds states. A panicking part is contained and the game's answer kept. Diverges from upstream: new hook.with_ property
set_placed_ by - Side
- server
- Contract
- listen
- Host / context
&mut dyn ServerHost- NeoForge
- —
- Summary
- Runs on the server once for the placed block, after vanilla's
Block.setPlacedBywork and beforeItemPart::for a block-item placement.on_ block_ placed_ by stateis the placed block's state, read before the game-level steps that can remove it (such as a wither pattern).stackis the original, read-only stack before consumption, orNoneif no stack was supplied.placerisNonefor a dispenser or for code placement.LevelRef::also reaches this part, without firing the item notice. Writes through theset_ placed_ by ServerHostparticipate in the current transaction, if one is open.
should_check_ weak_ power - Side
- server
- Contract
- collect
- Host / context
&dyn LevelHost- NeoForge
IBlockExtension.shouldCheckWeakPower- Summary
IBlockExtension.shouldCheckWeakPower: setcheckto decide whether indirect power is read through this block.checkstarts with vanilla's conductor answer.directionis the input side of the block being powered, opposite the queried block's output side. Authoritative servers only.
should_display_ fluid_ overlay - Side
- client
- Contract
- collect
- Host / context
&dyn ClientHost- NeoForge
IBlockExtension.shouldDisplayFluidOverlay- Summary
- Whether a fluid's side beside a block state uses the fluid's overlay sprite (water's
water_) instead of its flowing sprite (overlay IBlockExtension.shouldDisplayFluidOverlay): setevent.overlay.overlaystarts with vanilla's test, true beside aHalfTransparentBlockorLeavesBlock(for a content block, its template's class), so a part can turn the overlay on or off.event.fluidis the fluid as it is asked: a source at amount 8, or a flowing fluid at amount 7, not falling. A fluid with no overlay sprite, such as lava, draws its flowing sprite whatever the answer. The answer depends on the state and the fluid alone and is resolved at join or explicit visibility refresh, never on a meshing worker: the client asks once for every state and fluid where it resolvesblock_(joining a world,render_ visibility ClientHost::), and the meshing workers read the table. The level and position are dropped: the meshing workers run no mod code. With no part answering, nothing is asked and meshes are unchanged. Diverges from upstream: new hook.refresh_ render_ visibility
should_hide_ adjacent_ fluid_ face - Side
- client
- Contract
- collect
- Host / context
&dyn ClientHost- NeoForge
IBlockExtension.shouldHideAdjacentFluidFace- Summary
- Whether a block state hides the face a fluid beside it draws toward it (
IBlockExtension.shouldHideAdjacentFluidFace): setevent.hiddenand the fluid's face toward the block is not drawn.event.directionpoints from the fluid to the block (Sunrise's reading, not checked), andevent.fluidis the fluid as it is asked: a source at amount 8, or a flowing fluid at amount 7, not falling.hiddenstarts false. Vanilla's tests still apply first: a fluid beside the same fluid, or behind a face that occludes it, draws no face there whatever the answer. The answer depends on the state and the fluid alone and is resolved at join or explicit visibility refresh, never on a meshing worker: the client asks once for every state and fluid where it resolvesblock_(joining a world,render_ visibility ClientHost::), and the meshing workers read the table. The level and position are not arguments. With no part answering, nothing is asked and meshes are unchanged. Diverges from upstream: new hook.refresh_ render_ visibility
should_redstone_ wire_ connect_ to - Side
- server
- Contract
- collect
- Host / context
&dyn LevelHost- NeoForge
- —
- Summary
BlockBehaviour.shouldRedstoneWireConnectTo: setconnectedto say whether redstone wire connects to the blockstateatpos.directionpoints from the wire toward the neighbouring block, or is None when the wire asks about the block above or below.connectedholds vanilla's answer: change it when the block is yours. Asked whenever wire settles its shape: answer fromstateandposwithout touching the world. When the answer changes, and once the wire is placed, update its neighbours (level.update_). Authoritative servers only.neighbors
smoke_source - Side
- both
- Contract
- replace
- Host / context
LevelSide- NeoForge
- —
- Summary
CampfireBlock.isSmokeSourceon both sides for the blockstateunder a campfire, as the campfire is placed or the block under it changes:Some(true)for your own blocks makes the campfire a signal fire whose smoke rises higher, as over a hay bale. The level is read-only. The client asks during placement prediction.Nonekeeps vanilla's hay-bale check;Some(false)overrides it.
sound_type - Side
- both
- Contract
- listen
- Host / context
&dyn LoopContext- NeoForge
IBlockExtension.getSoundType- Summary
- The sound type of a block state this part is attached to (
IBlockExtension.getSoundType) is being read, to play one of its sounds.posis the block andstateits state;entityis nullable, as NeoForge's: the id and type (minecraft:player,minecraft:creeper) of the entity stepping on it, landing on it, placing it or digging it (a sniffer), andNonefor a break and for a placement by no entity (a dispenser);causesays which sound is about to play (BlockSoundCause::,Step Fall,Place,BreakorDig). It is asked only where NeoForge asks it, not for the hit sound while a block is mined (that has its own client hook upstream) nor for sculk growth. A part may changesound(event.sound), which starts as the state's own sound type: its event names, volume and pitch. The game then applies vanilla's factors forcauseto the volume and pitch and plays that one sound. An answer whose volume or pitch is not finite and at least 0, or one of whose events is not anamespace:pathid, is dropped whole and the state's own sound type is used. An event the resources lack plays nothing, as in vanilla; a mod's own event (from its content mod'sassets/) is sent to players by name. It runs for each sound, on the side that plays it, so register the mod on both and keep the listener a pure function of its inputs: the placer's client and the server ask for the same placement and must agree. It is given the loop<id>/ sounds.json contextof the side that asks, and takes noHost. It cannot play no sound, several sounds, or a sound somewhere else (playStepSoundandplayFallSoundcan). Diverges from upstream: new hook.
state_at_ viewpoint - Side
- client
- Contract
- collect
- Host / context
&dyn ClientHost- NeoForge
IBlockExtension.getStateAtViewpoint, IBlockStateExtension.getStateAtViewpoint- Summary
- The block state the camera at
viewpointsees of the blockstateatpos(IBlockExtension.getStateAtViewpoint), so a partial fluid block, a tank or a waterlogged mod block can show underwater fog only while the eye is really inside the liquid.seenstarts atstate: set it to the state whose fluid and powder snow the camera should read. Asked as the client finds the fluid at the camera (Camera.getFluidInCamera) for the block at the eye, the block above it and the blocks at the near plane's centre and corners: the fog, the field of view in a fluid, the water vision, the sky's dark disc and conduit power's underwater vision read it. The first-person water overlay uses the player's tick-sampled eye fluid instead; change its eligibility withcamera_. The client host is read-only; answer from the event alone, as the game asks every frame. With no part on any block the subscription check skips the asks; otherwise each block read costs one table lookup. Diverges from upstream: new hook.submersion
state_for_ placement - Side
- both
- Contract
- replace
- Host / context
LevelSide- NeoForge
- —
- Summary
- Choose a block's placement candidate (
Block.getStateForPlacement(BlockPlaceContext)), withstatethe block's own default state. This is not a placement notice: code holding aServerHostcan callLevelRef::to ask for a candidate without placing anything. The Part still has only itsstate_ for_ placement LevelHostthroughLevelSide, not the caller'sServerHost. Answer only for your blocks: put the state you want inanswerasSome(Some(state)), including a registered state of another block. If this is an actual placement, survival and entity obstruction use that candidate at the placement position, but the selected block'sgetStateForPlacementis not called. A mod selecting a multi-cell block is responsible for checking its footprint:setPlacedBydoes not recheck its companion cell. Sunrise also requires creative-operator permission to select a game-master block. An unknown state falls back to ordinary placement. Refuse withSome(None): the block goes nowhere and the stack is kept, as vanilla'snull. Left empty, the block's own placement runs.contextis vanilla'sBlockPlaceContext(the clicked face, the clicked position,sourcedistinguishingPlacementSource::from a non-playerPlayer { yaw, pitch, sneaking } PlacementSource::, whether the clicked block is being replaced, and the item key in hand, not an item stack or its components). For a directional source, whether the clicked block is replaced is the game's answer from the clicked block, asDirectional { direction } DirectionalPlaceContext.replacingClickedOnBlock()is, and a block whose own rule reads the placer's vertical look (pointed dripstone) has no vanilla answer: left empty, that placement is refused (PlacementStateError::forNoVerticalLook LevelRef::), and answering replaces that rule.state_ for_ placement fluidis the fluid in the position the block would go in, which a waterlogged block reads. Build the state fromstatewithnative_, and know whetherstate_ with_ property stateis yours withnative_. It is asked for every placer that goes through vanilla's placement (a player'sstate_ block BlockItem.place, a dispenser'sDirectionalPlaceContext). The item'smust_controls the ordinary final survival check. Standing/wall candidate survival and entity obstruction are independent. A trait mod returnssurvive Some(Some(state))to choose a state,Some(None)to refuse, orNoneto leave the answer to the next mod or vanilla. Changes to the event's fluid copy are mod-provided data forwarded to later Parts, never consumed by the engine. Asked on both sides, as vanilla asks it: a client asks it from its placement prediction, with its loaded copy of the level (matchLevelSide). Reads a client can't answer, tag tests among them, areNonethere, andBlockEntityPartState::gives its default: never answer from those as if they were the server's. A client refusal keeps its stack unspent until the server answers. Answerstate_ in Noneon a client where only a server can decide: the template's rule then predicts, and the server still decides.
step_on - Side
- both
- Contract
- collect
- Host / context
LevelRandomSide- NeoForge
- —
- Summary
Block.stepOninEntity.applyEffectsFromBlocks, before inside-block effects. It runs on the block atgetOnPosLegacyfor a grounded body affected by blocks, including an item whose idle tick did not move.stateandposname that same contact; the position need not be the actual supporting cell. Each applicable effects pass gets its own callback.
tick_block - Side
- server
- Contract
- cancel
- Host / context
&mut dyn LevelWriteHost- NeoForge
- —
- Summary
- An authoritative server's
ServerLevel.tickBlockis about to run a due scheduled tick of the blockstateatpos(BlockState.tick): the block is still the one the tick was scheduled for. Change the block withnative_and setset_ block_ property handledto skip the block's own tick; a block changed withouthandledtakes its own tick as it is now, if it is still the tick's block. If the block's owner subscribes and is disabled, the occurrence is held before dispatch, including for any enabled Parts attached to the block. Once re-enabled, the held occurrence is dispatched once with its original deadline, priority and order.
tool_modified_ state - Side
- both
- Contract
- cancel
- Host / context
&dyn Host- NeoForge
IBlockExtension.getToolModifiedState- Summary
- The state the block
statebecomes under a tool action (IBlockExtension.getToolModifiedState: an axe's strip, scrape or wax-off, a shovel's flatten or douse, a hoe's till), asked of the block a tool is used on (tool.pos).final_starts with vanilla's answer,state Nonefor a block the tool does nothing to: set it toSome(new)to allow the action or replace its result (a mod log an axe strips, a path a shovel makes), andCancelit to deny the action, so the tool does nothing.tool.simulatedsays the game is only asking what the tool would do (LevelRef::, NeoForge'sblock_ transform simulate): answer the same and change nothing in the world. A part answers before the globalblock_, which still hears the result and may change or cancel it; a cancelled part skips it. Asked for the block's own parts only, so a block with none costs nothing. A disabled owner's subscribed transform suppresses the unchanged template result, not the ability's notification or a listener's replacement. The global hook still sees the candidate, and later abilities can be tried if this one has no result.tool_ modification
update_shape - Side
- server
- Contract
- replace
- Host / context
&mut dyn LevelTicksHost- NeoForge
- —
- Summary
- An authoritative server is about to compute the state the block
stateatpostakes now that its neighbour indirectionisneighbour(BlockBehaviour.updateShape).statemay not be in the world yet (a piston landing it): decide fromstate, not from the block atpos. Answer only for your own blocks: put the new state innew(statekeeps the block as it is; air breaks it, with its drops, on a neighbour update) and the block's ownupdateShapedoesn't run, nor the ticks it would schedule. The level is read-only, as vanilla'sLevelReader; ticks go throughnative_andschedule_ block_ tick native_withschedule_ fluid_ tick ticks(ScheduledTickAccess). It runs often, at least six times persetBlockthat updates shapes (more for redstone wire's diagonals and knock-on updates): keep it short. A disabled owner's subscribed update keeps the input state instead of running the template.
use_item_ on - Side
- server
- Contract
- replace
- Host / context
&mut dyn ServerHost- NeoForge
- —
- Summary
BlockBehaviour.useItemOn: the block's own behaviour, with the held item, on the server for each player. An answer replaces the template's behaviour;TryWithEmptyHandtriesuseWithoutItemon the main hand, andPassgoes on to the item'suseOn. A disabled owner's subscribed interaction passes without running the block template.
use_without_ item - Side
- server
- Contract
- replace
- Host / context
&mut dyn ServerHost- NeoForge
- —
- Summary
BlockBehaviour.useWithoutItem: the captured state's empty-hand method, after useItemOn asks for it, on the server and main hand only. A disabled owner's subscribed interaction passes without running the block template.
weak_changes - Side
- server
- Contract
- collect
- Host / context
&dyn LevelHost- NeoForge
IBlockExtension.getWeakChanges- Summary
- Whether this block receives block entity changes through an adjacent conductor. Starts false.
EntityPart
can_rider_ interact - Side
- client
- Contract
- collect
- Host / context
- —
- NeoForge
IEntityExtension.canRiderInteract- Summary
- Whether this candidate counts normally in the client's ordinary entity pick despite sharing the camera's root vehicle. Mirrors NeoForge's
IEntityExtension.canRiderInteract, false by default. Only parts attached to the candidate's type are asked, in dependency order;allowedstarts false and the last write wins.event.subjectis anEntityClientScope:with_lends a read-onlyview EntityClientViewof the candidate (handle, kind, position, rotation, UUID), andhost()borrows&mut dyn ClientHostsequentially. Asked only at the same-vehicle branch ofProjectileUtil.getEntityHitResult, after a non-inside ray intersection qualifies against the running nearest distance. True lets this candidate update that distance normally. Inside-box selection does not ask it. Both the tick and frame pick use this rule. Attack-range component rays have no same-vehicle restriction and do not ask it. No server reach or interaction checks change.
general_entity_ tick - Side
- server
- Contract
- listen
- Host / context
- —
- NeoForge
- —
- Summary
- The authoritative tick of one general entity row of type
kind(mymod:robot) in the server level's entity phase:ServerLevel.tickNonPassenger'sentity.tick()for a row the type registry owns (#792 stage 4). The row's common bookkeeping has run (its previous position is its current one); a rider is ticked after its vehicle, depth-first astickPassengerrecurses. A passenger dismounted before its join-order slot can tick as a root if it has not already ticked this pass. Rows that joined this tick first tick next pass; parked levels and rows outside entity-ticking chunks do not tick. Cancelingentity_skips the row's own tick; cancellation alone does not skip its passengers' ticks. A listener can separately change the riding graph.tick_ pre event.subjectis anEntityServerScope:with_lends a liveview EntitySubjectViewof the row (handle, kind, position, velocity, rotation, UUID and checked velocity, rotation and fall-distance writes), andhost()borrows&mut dyn ServerHostsequentially for attachments (view.handle()is their holder) and other world operations. Told only for general entity types: vanilla families tick their own paths (#6509 owns bringing them to one join-order walk), so a part attached tominecraft:zombiehears no tick from this hook. Server-side.
FluidPart
fluid_rules - Side
- server
- Contract
- listen
- Host / context
&dyn LevelHost- NeoForge
- —
- Summary
- How a mod's world fluid flows at
pos, starting from what it declared (NeoForge'sBaseFlowingFluidandFluidTypegetters:getTickDelay,getDropOff,getSlopeFindDistance,canConvertToSource).fluidis the id it was declared with. Asked for every flow step and every cell a spread looks at: answer fast. An answer outside whatWorldFluidaccepts is brought back within it. Server-side.
ItemPart
apply_enchantments - Side
- server
- Contract
- listen
- Host / context
&dyn Host- NeoForge
IItemExtension.applyEnchantments- Summary
- NeoForge's
IItemExtension.applyEnchantments: the enchanting table appliesenchantments, the list it chose for the clicked row as (id, level), tostack, the item in its input slot (EnchantmentMenu.clickMenuButton).resultarrives with vanilla's result: a book becomes an enchanted book with the same count and components, then each level is added asItemStack.enchantadds it, keeping the higher one. Replace or change it, and the input slot holds it;player_, theenchant_ item enchanted_trigger anditem enchant_then see it. The levels and lapis paid stay as without the part. The result goes through the stack boundary: an unknown item, invalid damage or an oversized count is refused, and so is a count other than the input's, since the table holds one input; a refused result keeps vanilla's. Only theitem ItemParts attached tostack's item are asked, on the server, with a read-onlyHost. Loot, trades and spawn gear (EnchantmentHelper.enchantItem) don't ask. The contract beyond the method's name and parameters is Sunrise's reading, not checked against NeoForge's.
can_equip - Side
- both
- Contract
- listen
- Host / context
&dyn Host- NeoForge
IItemExtension.canEquip- Summary
- NeoForge's
IItemExtension.canEquip: maystackgo into the equipment slotslotof the living entityentity, of typekind(minecraft:player)?slotis anEquipmentSlotname:head,chest,legs,feet,mainhandoroffhand, andbodyorsaddlefrom a dispenser.can_arrives holding the data answer, asequip LivingEntity.isEquippableInSlotandEquippable.canBeEquippedByread the stack's ownequippablecomponent (a stack's override replaces the item's): yes when it names that slot and itsallowed_is absent or lists the entity type (an empty list allows none); with no component, removed or never there, yes forentities mainhandonly. Set it either way. Asked where vanilla asks: the armour slots of a player's inventory menu (ArmorSlot.mayPlace, which a shift-click into one reaches too), a dispenser equipping what stands in front of it (EquipmentDispenseItemBehavior, one entity at a time) and a mob picking an item up off the ground (Mob.equipItemIfPossible). It decides whether the stack fits the slot, not what the slot holds, whether the entity may wear one at all (canUseSlot) or the dispenser's own rules for the entity. Only theItemParts attached tostack's item are asked, on both sides, as the client's menu predicts the slot.hostis read-only and reads live entity and world state directly, for exampleentity.entity().position(host). A missing or despawned target refuses wherever a part is asked; the no-listener data path performs no conversion or entity lookup. A client without this mod predicts vanilla here; the server corrects it.
can_fit_ inside_ container_ items - Side
- both
- Contract
- listen
- Host / context
&dyn LoopContext- NeoForge
IItemExtension.canFitInsideContainerItems- Summary
- NeoForge's
IItemExtension.canFitInsideContainerItems: maystackgo inside an item that holds items?fitsarrives with vanilla's answer (Item.canFitInsideContainerItems): every stack fits except a shulker box. Set ittrueorfalse. It is asked, on both sides, wherever that rule is: - a shulker box's slots (ShulkerBoxSlot.mayPlace), in its menu and a guest's; - a bundle (BundleContents.canItemBeInBundle): a click that puts the stack in a bundle, and the/bundle contents; - the item slots a mod gives an item (item item_) and its bundle slots.container
can_grindstone_ repair - Side
- both
- Contract
- listen
- Host / context
&dyn LoopContext- NeoForge
IItemExtension.canGrindstoneRepair- Summary
- NeoForge's
IItemExtension.canGrindstoneRepair: does the grindstone repairstackas it repairs a damageable item?can_arrives with vanilla's answer, whether the stack is damageable (repair ItemStack.isDamageableItem); set ittrueorfalse. It is asked at two places, on both sides (the server's menus and the client's own result): -GrindstoneMenu.mergeItems, for the top stack when both inputs are single stacks of the same item.truetakes the repair branch: one item, the enchantments of both merged, then all but the curses removed. Durability is merged only when the result has durability, as vanilla checks it again on the copy.falsetakes the other branch: two matching stacks of an item that stacks give two, and anything else gives nothing. - The input slots'mayPlace(damageable or enchanted): a granted stack can be placed. This site is Sunrise's reading.
can_perform_ action - Side
- both
- Contract
- listen
- Host / context
&dyn Host- NeoForge
IItemExtension.canPerformAction- Summary
- NeoForge's
IItemExtension.canPerformAction: canstackperform the item abilityability, a plain, case-sensitive name such asshield_,block shears_orharvest shears_(a mod's own abilities also use plain names, such ascarve my_)?mod_ chop can_arrives with vanilla's answer for that ability: the item kind's (shears shear) or the stack's component (perform blocks_, a shield's, blocks); set it either way and the stack grants or loses the ability. Loot conditions use the shared item defaults; action sites retain their own vanilla answers until #3330. Asked where vanilla checks the item for an action: a raised item blocking attacks (attacks shield_: a granted stack blocks as a bareblock blocks_component does, a denied one never blocks nor is raised); shearing a sheep, mooshroom, snow golem or bogged, a dispenser's shears and a bee nest's honeycombs (attacks shears_); carving a pumpkin (harvest shears_). It decides whether the stack may do the action, not what the action does to the world or the tool (carve block_is the block's side of a tool action; item wear is its own). Only thetool_ modification ItemParts attached tostack's item are asked, on both sides, so the client's prediction agrees with the server: answer from the stack andabilityalone, and fast. An item with no such part costs one table lookup. A client without this mod predicts vanilla here; the server corrects it.
contained_fluid - Side
- client
- Contract
- listen
- Host / context
&dyn ClientHost- NeoForge
- —
- Summary
- The fluid a stack of a mod's own container item holds, as its
neoforge:fluid_item model draws it (container FluidUtil.getFirstStackContained):fluidarrivesNone(holds none); set it to the fluid's key, taken once at registration withr.fluid_. Asked on the client each time a stack of an item outsidekey minecraft:is drawn through a fluid container model; vanilla's items keep their own answer and never ask. A fluid with no look in an item draws the missing texture; a key no fluid is registered under draws the stack as holding none, and the game logs it once per item. Answer from the stack alone, and fast.
crafting_remainder - Side
- server
- Contract
- listen
- Host / context
&dyn Host- NeoForge
IItemExtension.getCraftingRemainder(ItemStack)- Summary
- NeoForge's
IItemExtension.getCraftingRemainder(ItemStack): whatstackleaves when consumed by crafting, furnace fuel or brewing.remainderarrives holding the item's data remainder. Replace it, or set it toNoneto leave nothing. A part that leaves it alone preserves the data remainder. Recipe-specific book and banner copies are handled by the recipe. Asked for each consumption on the authoritative server, with a read-onlyHost. Oversized counts, unknown items and invalid damage are refused by the stack boundary, retaining the original data remainder. API stacks cannot have count zero; useNoneto leave nothing. Native panics follow the normal Part crash path, attributed to the owning mod and Part.
creator_mod_ id - Side
- both
- Contract
- collect
- Host / context
&dyn Host- NeoForge
IItemExtension.getCreatorModId- Summary
IItemExtension.getCreatorModId: the mod that madestack, which a recipe viewer or tooltip names, instead of the mod that registered its item.mod_arrives as the item id's namespace; set it to another mod (a universal bucket holding that mod's fluid, a facade of its block) orid Nonefor no mod. Asked byItemResource::, from client tooltips and viewers as well as the server: answer from the stack alone. Only thecreator_ mod_ id ItemParts attached tostack's item are asked: an item with none costs one table lookup.
damage_item - Side
- server
- Contract
- cancel
- Host / context
&mut dyn ServerHost- NeoForge
IItemExtension.damageItem- Summary
IItemExtension.damageItem: the wearstackis about to take (ItemStack.hurtAndBreak: a tool that mines or hits, armour that takes a hit, a shield, a rod, an elytra, a tool a dispenser uses, a mob's armour), after Unbreaking has had its say, as NeoForge passes it.entityis who wears or uses it: the acting player on a player's paths, the mob, armour stand or dragon wearing it,Nonefor a dispenser's tool.amountis the points about to be lost; change it (0 or less leaves the item whole) or setcanceledfor no wear at all. Setbreak_and the item breaks whatever durability it has left, through the vanilla break (the sound and particles, the stack emptied,now player_for a player): NeoForge'sdestroy_ item onBroken. It wins overcanceled. Not asked when Unbreaking already saved the item, nor for a creative player's tools (they take no wear). Only theItemParts attached tostack's item hear it: an item with none costs one table lookup, and a game with no such part none at all. On the paths of a player the player's state is swapped in, sohost.players().acting_answers them. Once for each wear, on a server.player()
dispense_item - Side
- server
- Contract
- replace
- Host / context
&mut dyn ServerHost- NeoForge
- —
- Summary
DispenserBlock.getDispenseMethod: choose a behaviour for any item, including vanilla items, on the authoritative server (not droppers). The block the dispenser faces is asked first (dispense_), and its answer keeps this part from being asked. Leave answer None for vanilla. Otherwise answermethod (remainder, event): a remainder of None empties the slot,Some(stack)replaces it (the hook owns consumption: no extra item is removed afterwards).eventis the level event the dispenser plays with its smoke: 1000 the click, 1001 the fail sound (OptionalDispenseItemBehaviorwithout success), or 0 for no sound or smoke. In an open transaction in the dispenser's level, sound and smoke follow the behaviour's published effects at the outermost commit and are discarded on abort. The remainder is detached until the dispenser writes its slot. An invalid remainder is reported without writing or notifying the slot, and no other behaviour runs. To drop one normally, answer withhost.dispense_'s remainder and 1000.default
empty_contents - Side
- server
- Contract
- replace
- Host / context
&mut dyn ServerHost- NeoForge
IDispensibleContainerItemExtension.emptyContents- Summary
IDispensibleContainerItemExtension.emptyContents:stack(a bucket of a mod fluid, a jar, a canister) is about to be emptied atpos, byplayer(the acting player) who clickedhit(the block and face), or by a dispenser (playerandhitareNone). LeaveanswerNonefor vanilla's emptying. AnswerSome(true)when the part placed the contents itself through the host: the stack becomes an emptyminecraft:bucket(a creative player keeps it), no vanilla sound plays and the use counts as a success. AnswerSome(false)for a failure: nothing is placed, a player keeps the full stack and a dispenser drops it, as vanilla's does when emptying fails. Asked for a player oncebucket_let the pour go on, and for a dispenser before its own placement; an item with this part reaches the dispenser's bucket behaviour even when it is no bucket of a mod fluid, and aempty dispense_answer still comes first. A server's client does not predict the pour of an item with this part. The part is asked in a transaction with the game's apply: a part that changes the player's hand or the dispenser's slots while answeringitem Some(true)is refused and its journaled writes are undone, as a failed use (the player keeps the stack, the dispenser fails). A player's successful pour counts for theplaced_criterion. Only theblock ItemParts attached tostack's item are asked. Server-side.
held_item_ tint - Side
- client
- Contract
- replace
- Host / context
&dyn ClientHost- NeoForge
- —
- Summary
- Tint one third-person held-item submission in the world, for a player, mob or armor stand.
entity_is the holder's current client-level entity id,id handis the logical main or off hand (independent of the dominant arm),stackis the rendered stack, andpartial_is the frame's tick fraction.tick
highlight_tip - Side
- client
- Contract
- listen
- Host / context
&dyn ClientHost- NeoForge
IItemExtension.getHighlightTip- Summary
- NeoForge's
IItemExtension.getHighlightTip: the name drawn above the hotbar whenstackis selected.namearrives with whatHud.extractSelectedItemNamedraws (the hover name in its rarity colour, italic when the stack has acustom_); the text the part leaves is drawn in its place, centred at the same height and fade, cut at the screen edge as a long custom name is. Asked once each client tick while the name shows. The display timer still restarts only when the selected item or its hover name changes, so a tip that changes every tick doesn't keep the name up. Only thename ItemParts attached tostack's item are asked. Client-side.
hurt_enemy - Side
- server
- Contract
- listen
- Host / context
&mut dyn ServerHost- NeoForge
- —
- Summary
- A player's hit landed on the mob
entityof typekind(minecraft:zombie), holdingstack: whereItem.hurtEnemyis called, before the post-attack enchantments and the weapon's wear. It only hears. Another player as the target is not told. Server-side, for every player of the world (the helpers read the acting one).
inventory_tick - Side
- server
- Contract
- listen
- Host / context
&mut dyn ServerHost- NeoForge
- —
- Summary
- A server tick of
stack, the stack a player carries inslot: whereInventory.tickcallsItem.inventoryTick, for every stack, each tick,/included (it stops the world, not the player).tick freeze slotis asInventorysaves it (0 to 35; the armour 100 feet to 103 head; -106 the off hand), andselectedsays it is the held slot.ItemPlace::reads and changes the stack, which stays in its slot: an emptied one empties the slot, and the player's client gets the change. Only thePlayerSlot { player, slot } ItemParts attached tostack's item hear it. Server-side, for every living player of the world (the helpers read the acting one).
is_combine_ repairable - Side
- both
- Contract
- listen
- Host / context
&dyn LoopContext- NeoForge
IItemExtension.isCombineRepairable- Summary
- NeoForge's
IItemExtension.isCombineRepairable: may two ofstack's item be combined in a crafting grid to repair it (RepairItemRecipe.canCombine)?repairablearrives with vanilla's answer, whether the stack has durability (minecraft:max_anddamage minecraft:damage); set ittrueorfalse. It is asked for each of the two stacks, once they are found to be single stacks of the same item, and both must answertrue. Atruefor a stack with no durability (a maximum damage of 0) is refused with a warning, and vanilla'sfalseis kept, because the result needs a positive maximum. The anvil's combining of two of the same item keeps vanilla's test and doesn't ask. It is asked on both sides, wherever the grid's result is matched: a crafting table, the inventory grid, a crafter and the client's own result. Only theItemParts attached tostack's item are asked. It is given the loopcontextof the side that runs the match and takes noHost, so answer from the stack andcontextalone, and fast: a match may ask it many times. With no part on the stack's item the cost is one table lookup, and the stack isn't converted. The contract beyond the method's name and parameters is Sunrise's reading, not checked against NeoForge's. Diverges from upstream: new hook. A client without this mod predicts vanilla here; the server corrects it.
is_not_ replaceable_ by_ pick_ action - Side
- server
- Contract
- listen
- Host / context
&dyn Host- NeoForge
IItemExtension.isNotReplaceableByPickAction- Summary
- NeoForge's
IItemExtension.isNotReplaceableByPickAction: must a pick (the pick-block key) leavestack, in hotbarslot(0 to 8), where it is?playeris the player picking.not_arrives with vanilla's answer, whether the stack is enchanted; set itreplaceable trueto keep the stack in place orfalseto let the pick swap it out. Asked inInventory.getSuitableHotbarSlot's second pass, when a pick moves an item into the hotbar and no hotbar slot is empty: from the selected slot on, for each hotbar stack, until one answersfalse, which is the slot the pick uses; when all answertrue, the selected slot is used. A pick that selects a matching hotbar stack, or finds an empty slot, doesn't ask, nor oneplayer_cancelled. Only thepick_ item ItemParts attached tostack's item are asked, on the server (the host's own player and its guests), with a read-onlyHost. The contract beyond the method's name and parameters is Sunrise's reading, not checked against NeoForge's.
is_piglin_ currency - Side
- both
- Contract
- listen
- Host / context
&dyn Host- NeoForge
IItemExtension.isPiglinCurrency- Summary
- NeoForge's
IItemExtension.isPiglinCurrency: isstackbarter currency to a piglin (PiglinAi.isBarterCurrency)?currencyarrives with vanilla's answer, whether the stack is aminecraft:gold_; set itingot trueto make the stack currency,falseto refuse it (a gold ingot included), or leave it to keep vanilla's answer. Asked where vanilla asks: whether a piglin wants a stack on the ground (currency is wanted whenever its off hand holds no#minecraft:piglin_item, with no inventory-space check); whether an adult piglin that isn't admiring takes the stack from a player's hand, on the server and in the client's prediction of that click; and when a piglin stops holding the item it admired, where an adult barters currency (loved minecraft:gameplay/, thrown toward the nearest player) after admiring it, loses it when hit, and equips or keeps anything else. A currency stack picked up from the ground is admired, and so bartered, only when it is also inpiglin_ bartering #minecraft:piglin_, as vanilla admires loved items only; otherwise the piglin equips or keeps it. Only theloved ItemParts attached tostack's item are asked, on both sides, so register the part on both for the client's prediction to agree with the server: answer from the stack alone, and fast. An item with no such part costs one table lookup. The contract beyond the method's name and parameters is Sunrise's reading, not checked against NeoForge's.
is_primary_ item_ for - Side
- server
- Contract
- listen
- Host / context
&dyn Host- NeoForge
IItemExtension.isPrimaryItemFor- Summary
- NeoForge's
IItemExtension.isPrimaryItemFor: isstack's item primary forenchantment(an id such asminecraft:sharpness), so enchantment selection may offer it? Selection chooses the enchanting table's offers and clues, lootenchant_, trades and spawn gear.with_ levels primaryarrives true for a plain book; otherwise it is the resolvedsupports_answer and membership inenchantment primary_when that set is present. Set it true to offer the pair or false to withhold it, including for a plain book.items
item_bar - Side
- client
- Contract
- listen
- Host / context
&dyn ClientHost- NeoForge
- —
- Summary
- The small bar
GuiGraphicsExtractor.itemDecorationsdraws under an item, wherever the game shows one:bararrives holding vanilla's value (the damage bar, or a bundle's fullness already applied) and may be replaced (width0..=13, colourrgb) or set toNoneto hide it. Asked each frame a stack is drawn. Client-side.
item_decorations - Side
- client
- Contract
- listen
- Host / context
&dyn ClientHost- NeoForge
IItemDecorator.render- Summary
- Append an item's custom decorations after its default bar, cooldown and count. Coordinates are the icon's top-left in GUI units, as the batch takes them; no item translation is active. Runs wherever the shared item-decoration path is used (hotbar, menus, tooltips, and the other screens that draw item icons: advancements, beacon, stats, trading). The NeoForge counterpart is
IItemDecorator.render; registration throughRegisterItemDecorationsEventis a separate moment.
item_destroyed - Side
- server
- Contract
- collect
- Host / context
&mut dyn ServerHost- NeoForge
IItemExtension.onDestroyed- Summary
IItemExtension.onDestroyed(vanillaItemStack.onDestroyed): a dropped item entity holdingstackhas reached zero health fromdamage_(fire, lava, cactus, explosion,type /, or block-contact damage) and is about to be discarded.damage
item_interact_ mob - Side
- both
- Contract
- replace
- Host / context
HostSide- NeoForge
- —
- Summary
ItemStack.interactLivingEntity: after ordinary entity interactions pass, for an alive native Mob and a nonempty stack inhand. Both logical sides answer independently. A consuming client result ends the hand loop; only Success swings there. SuccessServer and Consume consume without a client swing; Fail, Pass and TryWithEmptyHand fall through. A server-only answer leaves client off-hand prediction unchanged. ClientHost permits reads and local effects, not authoritative writes. Armor stands, other players and dragon parts are not covered. A client without this mod predicts vanilla here; the server corrects it.
item_name - Side
- both
- Contract
- collect
- Host / context
&dyn LoopContext- NeoForge
Item.getName- Summary
- Vanilla's
Item.getName(ItemStack): the name ofstackfrom its components, so one mod item has many names (a data model named after the mob in it, a filled container after its contents).namearrives asNone, which keeps the default: the stack'sminecraft:item_component, else the item's translated name. Set it toname Some(text)to name the stack; a translatableText(Text::) renders in each viewer's own language. It replaces the default rather than filling in for a missingtranslate item_, as the vanilla items that overridename getNamedo. Aminecraft:custom_, or a written book's title, still wins over it (name ItemStack.getHoverName), and the part isn't asked then.
item_stacked_ on_ other - Side
- both
- Contract
- cancel
- Host / context
HostSide- NeoForge
ItemStackedOnOtherEvent- Summary
- NeoForge's
ItemStackedOnOtherEventand vanilla'sItem.overrideStackedOnOther/Item.overrideOtherStackedOnMe, fired inside a resolved pickup click (a direct left/rightPickupwhen no drag is active, or a one-slot left/rightQuickCraftdrag release; never on multi-slot or middle-button drags, active-drag resets, or creative catalogue slots), with the cursor and both stacks frozen inevent.
makes_piglins_ neutral - Side
- server
- Contract
- listen
- Host / context
&dyn Host- NeoForge
IItemExtension.makesPiglinsNeutral- Summary
- NeoForge's
IItemExtension.makesPiglinsNeutral: doesstack, worn bywearer, keep calm piglins from targeting it, as gold armour does (PiglinAi.isWearingSafeArmor)?neutralarrives with vanilla's answer, whether the stack is in#minecraft:piglin_; set itsafe_ armor trueto make the piece count as gold,falseto make it not count though the tag lists it, or leave it to keep the tag's answer. Asked for each stack in a player's armour slots, in the order feet, legs, chest, head, until one counts. A player wearing a piece that counts is not the target a calm piglin picks (NEAREST_); an angry piglin attacks anyway. Only theTARGETABLE_ PLAYER_ NOT_ WEARING_ GOLD ItemParts attached tostack's item are asked. It is asked whenever the server builds a player's view for the mobs, several times a tick, so the answer must be a pure, fast function ofstackandwearer. An item with no such part costs one table lookup. Server-side. The contract beyond the method's name and parameters is Sunrise's reading, not checked against NeoForge's.
must_survive - Side
- both
- Contract
- replace
- Host / context
LevelSide- NeoForge
- —
- Summary
BlockItem.mustSurvive: whether placing this item must pass the block'scan_predicate in the finalsurvive BlockItem.canPlacecheck. Asked on both sides after placement state selection, with a read-only level host. Standing/wall items select candidates using unconditional survival checks and their own placement-state override; this hook does not skip them.Some(false)skips survival only, not replaceability, bounds or entity obstruction.Some(true)requires survival.Nonekeeps vanilla's requirement (false for scaffolding, true for other block items). Dispatch is byitemid; this event has no held-stack components.
on_block_ placed_ by - Side
- server
- Contract
- listen
- Host / context
&mut dyn ServerHost- NeoForge
BlockItemExtension.onBlockPlacedBy- Summary
BlockItemExtension.onBlockPlacedBy: the selected block has been placed, its final block state and the original item's block-entity data applied, andBlock.setPlacedBycompleted (including companion blocks). Runs once, at the primary position, before the item's placement sound, game event, placement trigger and stack consumption.stateis the live block state after the callback, which can have changed the block or run its own effects.stackis the pre-shrink stack;placeris the placing player, or None for a dispenser.levelis the level the block was placed in.faceandclickare the placement context's clicked face and world-space hit point. Failed, refused and canceled placements never notify, nor do successful writes that leave a different block at the primary position. Only Parts attached to the original item hear this server notice.
on_dropped_ by_ player - Side
- server
- Contract
- cancel
- Host / context
&dyn Host- NeoForge
IItemExtension.onDroppedByPlayer- Summary
IItemExtension.onDroppedByPlayer:player(the acting player's handle) pressed the drop key onstack, the whole selected stack before anything leaves it;allis true when the whole stack goes, false for one item (ServerPlayer.drop(boolean)). Setcanceledand the stack stays in the slot: nothing is taken out, no item entity is made, no drop statistic is awarded anditem_does not fire; a server's player is sent the slot back, undoing their predicted drop. Not asked for a menu's throw, nor for a spectator (who drops nothing). Only thetoss ItemParts attached tostack's item are asked: an item with none costs one table lookup. Server-side, with a read-onlyHost.
on_entity_ item_ update - Side
- server
- Contract
- cancel
- Host / context
- —
- NeoForge
IItemExtension.onEntityItemUpdate- Summary
IItemExtension.onEntityItemUpdate: each tick of a dropped item entity, before the entity's own tick (ItemEntity.tick: its fluids, movement, pickup delay, merging and lifetime), and afterentity_.tick_ pre event.subjectis anItemEntityServerScope:with_lends a liveview ItemEntitySubjectViewfor the dropped item's handle, position, velocity, stack, pickup delay, age, target, owner and checked writes, andhost()borrows&mut dyn ServerHostsequentially for attachments and world operations. ReturnFlow::to skip that tick's vanilla work, as NeoForge'sCancel truereturn does. The item skips movement and its own merge pass, but another item can still merge into it.entity_still hears it. Only thetick_ post ItemParts attached to the item ID held at dispatch entry hear it. Read the live stack viaevent.subject.with_andview view.with_; component conversion is deferred until that stack view is projected. Server-side, for every dropped item that ticks.stack
on_entity_ swing - Side
- both
- Contract
- cancel
- Host / context
HostSide- NeoForge
IItemExtension.onEntitySwing- Summary
IItemExtension.onEntitySwing: the player in place (entity, itsEntity.getIdwhen known) is about to swingstackinhand: whereLivingEntity.swingstarts, for an attack, a use or a swing the server asked for. Setcanceledand no swing starts: no animation and no swing packet. Only theItemParts attached tostack's item are asked. Both sides, as vanilla's: answer the same on both, and change the world only where thisGameruns the world, not on a server's client.
on_item_ use_ first - Side
- server
- Contract
- replace
- Host / context
&mut dyn ServerHost- NeoForge
IItemExtension.onItemUseFirst- Summary
IItemExtension.onItemUseFirst: the held item's first say on a click on a block, on the server for each player, afteruse_(item_ on_ block ItemBeforeBlock) let it through and before the block's ownuseItemOn. An answer ends the click: neither the block nor the item'suseOnruns.Passgoes on to the block.
on_left_ click_ entity - Side
- server
- Contract
- cancel
- Host / context
&mut dyn ServerHost- NeoForge
IItemExtension.onLeftClickEntity- Summary
IItemExtension.onLeftClickEntity:player(the acting player's UUID), holdingstackin the main hand, is about to attack the entityentity(Entity.getId) of typekind(minecraft:cow,minecraft:player,minecraft:item_): whereframe Player.attackstarts, once the globalattack_let the blow through and before any damage, knockback, enchantment effect,entity hurt_or the weapon's wear. Setenemy canceledand the attack ends there: the target is not hurt,hurt_does not fire and the stack takes no wear. Only theenemy ItemParts attached tostack's item are asked. Server-side, for every player of the world (the helpers read the acting one).
on_use_ tick - Side
- both
- Contract
- listen
- Host / context
HostSide- NeoForge
LivingEntityUseItemEvent.Tick- Summary
Item.onUseTickofstack, used byentitywithremainingticks left, always above 0: what a mod's own item does each tick it is used (cook, charge, drain). It comes whereItemStack.onUseTickcalls the item, onceliving_let the use go on: after a consumable's crumbs, for consumables, shields and mods' items (vanilla's other items do their own, and a kinetic weapon has none on the server). Both sides, asentity_ use_ item_ tick living_: change the world only where thisentity_ use_ item_ tick Gameruns the world, not on a server's client. Runs every tick of every use: check the item first.
placement_context - Side
- both
- Contract
- replace
- Host / context
LevelSide- NeoForge
- —
- Summary
BlockItem.updatePlacementContext: replacecontextbefore selecting the block's placement state, on both sides with a read-only level host.Some(Some(context))rewrites the target and click,Some(None)refuses placement, andNonekeeps the item's vanilla rewrite (including scaffolding's column walk). The placing item cannot be changed. The actual pre-usestacksupplies the item key and components.context.sourcedistinguishes a player placement (PlacementSource::) from a directional non-player placement (Player { yaw, pitch, sneaking } PlacementSource::): the effective placement rules, which a rewrite can change independently ofDirectional { direction } placer.placersupplies the actual player's handle and eyes on this side, or is absent for a dispenser. A player's original destination may be occupied: a part can redirect the placement even when vanilla would refuse it there. A dispenser still needs a replaceable front cell before asking the part. With no answer, vanilla checks the original destination before its own rewrite. A part's rewritten destination must be loaded, in bounds, and replaceable with the supplied context. Non-finite click or player view values are refused. A rewritten directional context'sreplace_is read from the block atclicked hit_, not from the answer, and a directional question vanilla throws on (pos PlacementStateError::orNoVerticalLook ReplacingClickedCycle) refuses the placement. Survival and obstruction still apply at the final position.
release_using - Side
- both
- Contract
- listen
- Host / context
HostSide- NeoForge
LivingEntityUseItemEvent.Stop- Summary
Item.releaseUsingofstack:entitylet it go withtime_ticks of itsleft use_left, so it was held forduration duration - time_(a bow-like item shoots by that charge). Setleft usedas vanilla's return, and the stack's use cooldown starts (ItemStack.releaseUsing). After the vanilla item's own release, onceliving_let it through. Both sides, as vanilla's: change the world only where thisentity_ use_ item_ stop Gameruns the world, not on a server's client.
should_cause_ block_ break_ reset - Side
- client
- Contract
- listen
- Host / context
&dyn ClientHost- NeoForge
IItemExtension.shouldCauseBlockBreakReset- Summary
- NeoForge's
IItemExtension.shouldCauseBlockBreakReset: does a break restart because the main hand changed?stackis the stack the break began with (vanilla'sdestroyingItem),heldthe main hand now (Nonefor an empty hand).resetarrives with vanilla's answer: notItemStack.isSameItemSameComponents(held, stack)(count left out, damage compared).falsekeeps the break and its progress going;trueaborts it and starts it again from 0. Atruefor an unchanged stack restarts the break every tick, so it never finishes. Asked on eachcontinueDestroyBlockandstartDestroyBlockof the block the break targets, on the local player's client (single player and a server's client alike). Only theItemParts attached tostack's item are asked. Client-side.
should_cause_ reequip_ animation - Side
- client
- Contract
- listen
- Host / context
&dyn ClientHost- NeoForge
IItemExtension.shouldCauseReequipAnimation- Summary
- NeoForge's
IItemExtension.shouldCauseReequipAnimation: does the first-person hand lower and raise again to showstack, the stack the hand holds now?oldis the stack the hand shows (Nonefor an empty hand),slot_whetherchanged stackcame from another slot (always false for the off hand).reequiparrives with vanilla's answer (!FirstPersonHandsAndItems.shouldInstantlyReplaceVisibleItem: the same stack changed in place, or an equal one but for its damage, is shown at once).truelowers the hand and raises it withstack;falseshowsstackat once. Asked each client tick, for each hand, while the shown stack differs from the held one by slot or by value; an unchanged hand and an empty hand aren't asked. Only theItemParts attached tostack's item are asked. Client-side.
supports_enchantment - Side
- both
- Contract
- replace
- Host / context
&dyn Host- NeoForge
IItemExtension.supportsEnchantment- Summary
- NeoForge's
IItemExtension.supportsEnchantment: may this item's stack receiveenchantment(an id such asminecraft:sharpness)? The firstSome(bool)replaces support;Nonetries the next part and then keeps the caller's vanilla rule. Anvils accept enchanted books;/and compatibility-filtered loot useenchant supported_. Creative anvil use still bypasses support, and enchantment conflicts remain separate. Both anvil calculations,items /and compatibility-filteredenchant enchant_read the answer. The default forrandomly is_reads it before testing the enchantment'sprimary_ item_ for primary_.items
tooltip- Side
- client
- Contract
- collect
- Host / context
&dyn ClientHost- NeoForge
ItemTooltipEvent- Summary
Item.appendHoverText: an item's own lines in its tooltip, after its name and before its components' (enchantments, lore, attributes). Add lines tolines, which arrives empty, each with a colour asrgbapacks it (u32::keeps the text's own);MAX Text::readslegacy §codes.contextis the sameTooltipAppendContextpassed to component appenders: player, advanced/creative/nested flags and vanillaItem.TooltipContext.tickRate()(the client level's rate, or 20 without a level). The stack has its components (stack.data()). Asked when lines are built for display orItemResource::, except during reentrant line queries, when the stack hides its tooltip or for a crossbow's loaded projectile. NeoForge'stooltip ItemTooltipEventis the corresponding line-building event; this scoped hook adds attached parts' lines before component lines are assembled. AfterwardsHooks::sees the finished list, including these parts' lines.item_ tooltip
tooltip_image - Side
- client
- Contract
- replace
- Host / context
&dyn ClientHost- NeoForge
- —
- Summary
- Optional tooltip component data for this item stack (
Item.getTooltipImage). AnswerSome(TooltipComponent::(orcustom(data)) Some(TooltipComponent::) to insert a component after the item's name line beforebundle(stack)) render_runs. Register a client factory for custom data types intooltip_ gather_ components register_. Answerclient_ tooltip_ component_ factories Noneto leave the vanilla tooltip component unchanged. A callback or retained payload destructor panic disables only this item-part registration for this hook. Client-side.
use_animation - Side
- both
- Contract
- listen
- Host / context
&dyn Host- NeoForge
- —
- Summary
Item.getUseAnimationofstack: the animation the renderer draws while the stack is in use, whichItemStack::also reads.use_ animation animationarrives with the item's vanilla answer; the item's Part may change it. ASpearoverride on an item without kinetic data is refused asNone. Asked on the client when each render consumer updates, and on either side when a mod readsItemStack::, withuse_ animation hostread-only: answer from the stack alone, the same on both sides. From inside this callback, a read ofItemStack::for any stack of the same item (a copy with another count or components included) does not ask its Part again: it gets the item's own answer. Another item's read asks that item's Parts. Contract version 3: version 2 asked no Part again for any read from inside the callback; version 1 was asked on the client only, with ause_ animation ClientHost.
use_duration - Side
- both
- Contract
- listen
- Host / context
&dyn Host- NeoForge
- —
- Summary
Item.getUseDurationofstack, in ticks:durationarrives with vanilla's (a consumable's time, 72000 for a shield, a spear, a bow, 0 for an item with no use over time). A mod's own item (outsideminecraft:) with noconsumable,blocks_or kinetic weapon that answers above 0 is used over time on a right click, as anattacks Item.usethat callsstartUsingItem, until it is let go or the time runs out (living_). A consumable's time changes too, potions and the other vanilla items keep their own. Asked when a use starts, each tick a mod's item is in use, and each frame the hand draws one in use, on both sides. It has no user, as it is asked so often: answer from the stack alone.entity_ use_ item_ finish
use_item - Side
- both
- Contract
- replace
- Host / context
HostSide- NeoForge
PlayerInteractEvent.RightClickItem- Summary
- A player uses
stack(right click) withself.hand: in the air, or on a block oncenative_let it through, whereuse_ on Item.usestarts. Runs on both logical sides after the global right-click event. Return an interaction result: Success swings on the client, SuccessServer swings on the server, Consume handles without swinging. Fail skips this item's use without swinging, then the off hand may be tried. None lets later Parts answer; if none answers, the item's own use runs. Some(Pass) skips later Parts and continues to the item's own use. TryWithEmptyHand is block-phase-only and is treated as Pass here. Cooldown items are skipped. A server-only answer does not stop the client's off-hand prediction. ClientHost permits reads and local effects, not authoritative writes.handis the interaction hand of THIS click, including an instantaneous air use. Unlike this field,living_answers only during active item use. This isused_ item_ hand PlayerInteractEvent.RightClickItem.getHand.playeris the clicking player's UUID andplayer_that player's entity id on this logical side: the acting player's on a server (a guest's own, never the host's), this client's own player on a client. They name who clicked from the event alone, unlikeentity_ id players().acting_, which only answers while the host has set the acting player. A client without this mod predicts vanilla here; the server corrects it.player()
use_on - Side
- both
- Contract
- replace
- Host / context
HostSide- NeoForge
UseItemOnBlockEvent- Summary
- A player uses
stack(right click) withself.handon the block atpos,facethe face clicked ([0, 1, 0]is the top), once the block itself let the click through (a chest still opens): whereItemStack.useOnstarts. Both logical sides answer independently: a consuming client result ends the hand loop; only Success swings there. SuccessServer and Consume consume without a client swing. Fail ends the block path; Pass and TryWithEmptyHand fall through. A server-only answer does not stop the client's off-hand prediction. ClientHost permits reads and local effects, not authoritative writes. Cooldown items are skipped.handandhitdescribe this click;playerandplayer_identify its player on this side.entity_ id
xp_repair_ ratio - Side
- server
- Contract
- listen
- Host / context
&dyn Host- NeoForge
IItemExtension.getXpRepairRatio- Summary
IItemExtension.getXpRepairRatio: the durability points Mending restores tostackper point of experience, whereExperienceOrb.repairPlayerItemsrepairs the damaged Mending item it picked, once per item it repairs.experienceis the points being spent (never 0) andplayerthe player they go to.ratioarrives holding vanilla's: the stack'sminecraft:repair_repair divided bywith_ xp experience, 2.0 for vanilla Mending. The repair becomesfloor(experience × ratio), capped at the stack's damage; a ratio left as it arrived keeps vanilla's repair exactly. A ratio that isn't finite is refused and vanilla's repair is used; a negative one counts as 0. A ratio that takes a positive repair to 0 leaves the experience unspent, for the player. Only the parts attached tostack's item are asked: to change Mending for every item, change the enchantment'sminecraft:repair_effect in a data pack. Server-side, includingwith_ xp PlayerRef::.give_ experience_ points
MenuPart
menu_button - Side
- server
- Contract
- listen
- Host / context
- —
- NeoForge
- —
- Summary
- A player pressed a mod menu's button (
clickMenuButton), on the server.subjectlends sequential access to the live resident block entity (when present) and the serverHost:subject.with_returnsview(...) Noneon a blockless menu or after the block entity is removed or replaced, whilesubject.host()andsubject.transaction(...)stay usable on both. Mods may change the live block entity in place (each write is validated at the boundary) and the clicking player's carried stack. A panicking listener is contained and disabled formenu_for the rest of the session, discarding its carried-stack edit and rolling back any open transaction. A panic in a different hook does not discard the cursor edit of a button callback that returns normally.button
menu_button_ valid - Side
- server
- Contract
- cancel
- Host / context
&dyn Host- NeoForge
- —
- Summary
- Whether this menu's owner accepts a button id before
menu_runs. The owner chooses the ids for its own menu; there is no shared numeric range. Leavebutton acceptedfalse for ids the active menu does not support.
menu_clicked - Side
- server
- Contract
- cancel
- Host / context
&mut dyn ServerHost- NeoForge
- —
- Summary
- A click in
menu, before its default action (AbstractContainerMenu.clicked). Only parts registered for that menu type are asked.slotis in menu order (container slots, then any player inventory; -999 outside),buttonandmodeare the click input, anduuididentifies the clicking player. Menu-button clicks, recipe placement and the creative set-slot packet do not call it. ReturnFlow::after applying the click yourself to skip the default: for example, copy an item into a filter slot without consuming the cursor. A display-only menu has no default moves. Other menus keep their ordinary slot rules when unhandled. The client predicts the ordinary click and the server corrects it. No player's state is swapped in. Use their currentCancel PlayerRef::or the native menu's UUID and window to reach its slots and cursor. Host writes are kept if the action succeeds. An unhandled click applies the default in the same transaction; a stale, refused or failed action rolls back the transaction. The action refuses opens.container_ menu ServerHost::andclose_ menu MenuRef::close only after commit.close_ container
menu_slot_ changed - Side
- server
- Contract
- listen
- Host / context
&mut dyn ServerHost- NeoForge
- —
- Summary
- The non-result slots of an open mod menu of type
menuchanged on the server, so its outputs can follow its inputs, as vanilla processing menus do inAbstractContainerMenu.slotsChanged. Nothing is asked when no part listens formenu.
menu_slot_ rules - Side
- both
- Contract
- listen
- Host / context
&dyn Host- NeoForge
- —
- Summary
- Slot placement, pickup and stack limits for registered vanilla and mod menus; mounts use
sunrise:mount_, while player inventory and the creative picker have no registered type.inventory slotis the backing index, including player inventory slots. The slot's own answers arrive first; the maximum is bounded to 0–99 and the item limit (matching vanillaSlot.getMaxStackSizeandContainer.getMaxStackSize). Refusal also prevents quick-move top-ups. Runs on server and client prediction with the readHost: it is a query, so it can neither write nor cancel. Each livemay_,place may_andpickup getMaxStackSizecheck during a click asks the parts directly against the current menu slots (matching vanillaAbstractContainerMenu.doClickandSlot). Permission and capacity are separate checks. During shift-click a later destination sees the source remainder and the earlier destinations' updates. A nestedMenuRef::orslot_ holds MenuRef::read uses the slot's own rules without asking menu Parts again, even for another slot or menu.slot_ gives context.slotstill reads the slots of the ongoing click. A panicking part's answers are discarded and its callback is disabled for the session, with the mod named in the log and error toast. The other parts still answer the check. Answer quickly from the question and the read-only Host. On a LAN host's own click the LAN host is not reachable through theHost(it answers as if no LAN were open).containeris the containerslotindexes (MenuContainer): a mod crafting grid's slots areGrid's and its resultResult's slot 0.contextlends the player, the menu's block position and the live slots for this ask (MenuSlotContext). Read slots on demand withcontext.slot(container, index), covering both the menu's backing containers (Main,Grid,Result) and the player's inventory (Player:0..36inventory,36..40armor feet-to-head,40offhand, matching vanillaInventory). A client without this mod predicts vanilla here; the server corrects it.
menu_slot_ take - Side
- server
- Contract
- listen
- Host / context
- —
- NeoForge
- —
- Summary
- A player took a stack out of slot
slotof the mod menu typemenu(Slot.onTake), on the server: a notice after the item left the slot, which refuses nothing (the pickup rule,menu_'slot_ rules may_, refuses). It reaches the parts registered forpickup menu, on a block-backed mod menu and on a blockless owned menu alike.subjectlends the serverHost(subject.host()) and atomic transactions (subject.transaction(...)) on both; on a block-backed menu it also lends sequential access to the live resident block entity (subject.with_), which returnsview(...) Noneon a blockless menu or once the block entity was removed or replaced during the call.playeris the player's UUID;slotis the menu's index, the menu's own slots first (linked containers and the player's inventory are never heard).takenis a copy of the stack that left the slot, components included, andleftwhat the slot holds afterwards (Nonewhen it was emptied). Vanilla handsonTakethe taken stack on a click but the stack left in the slot on a quick move, so both are carried: for a quick movetakenis the amount moved (the slot's stack before, lessleft).
menu_still_ valid - Side
- server
- Contract
- listen
- Host / context
&dyn LoopContext- NeoForge
- —
- Summary
- Whether a player's mod menu stays open (
AbstractContainerMenu.stillValid). Asked on the server each tick the menu is open and before processing a matching non-spectator container click.posis the backing block's position, orNonefor a blockless menu even if its opener supplied a position for the client's screen.opening_is present when the opener supplied a hand; itsitem stack_says whether that hand holds the same item with the same components as at open (count ignored). Neither affects the initial validity answer.matches validstarts true without a backing block; for a block menu it is whethereyeis within the player's block interaction range plus 4 of each backing block. Set it to keep the menu open or close it. Vanilla menu types are never asked, and a menu whose block entity is gone closes without asking. Answer from the event and loop context alone.
menu_transfer - Side
- server
- Contract
- replace
- Host / context
&mut dyn ServerHost- NeoForge
- —
- Summary
- A recipe viewer's "+" on a mod menu (JEI's
IRecipeTransferHandler): move one set ofrecipe's ingredients (as many as the items allow withmax) fromplayer's inventory into the open menu of a mod menu type, or withdry_only say what that would do. Asked on the server before the game's own grid transfer, only for a mod menu type whose part answers, withrun menuits type,posits block (None for a menu with no block) andrecipethe recipe's id as the viewer sent it. ReturnSome(Moves)once moved, orMissing,NoRoomorNotIntoMenu; a part that returns None lets the game try its own crafting-grid transfer. A dry run must move nothing. Withdry_a part may also push the recipe's cells nothing fills torun missing_, and the cells it lacks but could craft tocells craftable_(both empty by default), incells RecipeTransferCheck's cell order; the game keeps the ones below the recipe's cell count (its known layout: one for stonecutting, 256 for a recipe it can't inspect), each once, in ascending order, and ignores both outside a dry run.
recipe_book_ ghost - Side
- client
- Contract
- listen
- Host / context
&dyn ClientHost- NeoForge
- —
- Summary
- The server answered a recipe click in a mod menu's recipe book with missing items, and the client is about to draw the recipe's ghosts: the place vanilla calls the component's
fillGhostRecipe(ghostSlots, display, context).displayis the alternative the player clicked.ghostsarrives holding the game's own ghosts for the menu's layout (a crafting, furnace, stonecutter or smithing layout maps the display to its slots; aModlayout arrives empty); add, change or clear them. Each ghost'sdisplayresolves to stacks as the book's own displays do, and one that resolves to none, or sits in a slot the menu's screen hides or lacks, is dropped. At most 256 ghosts are kept. A listener that pushes nothing leaves what arrived. Asked for the open menu's book only, once per answer, by the part of the menu's type; a menu with none skips the hook. Client-side, with theClientHost.
recipe_book_ place - Side
- server
- Contract
- listen
- Host / context
&mut dyn ServerHost- NeoForge
- —
- Summary
- A player clicked a recipe in the recipe book of a mod menu whose
RecipeBookLayoutisMod, on the server (RecipeBookMenu.handlePlacement, the method a Java menu overrides). The part of the open menu's type moves the recipe's ingredients itself and setsghostwhen items are missing, as vanilla's answerPLACE_does: the client is then told to draw the recipe's ghosts (GHOST_ RECIPE recipe_).book_ ghost use_is the Shift click andmax_ items creativethe player's mode.playeris swapped in, sohost.players().acting_names them.player()
MobEffectPart
apply_effect_ tick - Side
- server
- Contract
- listen
- Host / context
&dyn Host- NeoForge
- —
- Summary
MobEffect.applyEffectTick: the content mod's resolvedEffectKeyeffectacts onentityindimension(minecraft:overworld). Clearkeepand the effect ends now, before it counts down.entityis a mob'sEntity.getId, None for a player (host.players().acting_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.player() holderidentifies the holder; Host reads of a mob holder are unavailable while it is ticking. Queued changes apply after the hook; clearingkeepends the effect.active_is the holder's live active-effect snapshot at this point in the pass;effects has_reads it, reflecting removals earlier in the pass. The current level's game rules remain readable througheffect(key) host.level(dimension). Called only when this Part's own cadence requests it. All Parts see the same snapshots; their queued changes apply in Part order afterward (with the declaring package's — or, for aserved_content package, its serving native host's — Parts running first). On mobs, each queued hurt finishes its damage, death or protection, andby living_before the next queued change or the effect countdown. Clearingdamage_ post keepskips later Parts. Server-side.
should_apply_ effect_ tick_ this_ tick - Side
- server
- Contract
- listen
- Host / context
&dyn Host- NeoForge
- —
- Summary
MobEffect.shouldApplyEffectTickThisTickfor this Part's effect. Each Part starts withapply = false; only that Part's answer decides whether itsapply_runs.effect_ tick tick_is the remaining duration, or the holder's tick count for an infinite effect. For an effect declared by acount served_content package, its serving native host is the owning package (admitted without an extra dependency, and its Parts run first). Server only.by
Host methods (Host, ServerHost, ClientHost)
Shared (Host)
attachment_query - Signature
fn attachment_query (&self, namespace: &str, name: &str ,) -> Result<AttachmentBatch, AttachmentError> - Summary
- Capture a SNAPSHOT of the current dimension's attachment residency and values. Later changes require a fresh query. Removed-but-unswept entities may appear; writes through stale holders fail. Values are neither cloned nor eagerly decoded. The batch is local, not a save or sync record. In a transaction it can be used only while the capturing frame is current. An undeclared id is refused with the calling package and attachment id.
attachment_read_ scope - Signature
fn attachment_read_ scope (&self) -> Result<AttachmentReadScope<'_ >, AttachmentRowError> - Summary
- Borrow this host for an attachment snapshot read in its transaction. Pass the result to
row.with_orvalue query.get; it does not open a transaction.
attachments- Signature
fn attachments (&mut self) -> &mut dyn AttachmentStore- Summary
- The server-owned holders' attachments;
TYPE.get(host, holder)reads one. On a client it is the copy of what the server synced:setandremovechange only the copy. While held during a proxy handoff, the client can already read updates or removals for entities and other players it tracks, without waiting for placement or requesting a resync.
biome_key - Signature
fn biome_key (&self, id: &str) -> Option<BiomeKey> - Summary
- before world data is installed, or for an unknown id. Reacquire after reload.
block_collision - Signature
fn block_collision (&self, pos: [i32; 3]) -> Vec<[f64; 6]> - Summary
- Collision boxes in block-local coordinates with an empty collision context.
block_entity - Signature
fn block_entity (&self, level: LevelRef, pos: [i32; 3]) -> Option<BlockEntityRef> - Summary
- Find a block entity in a loaded chunk of an open level, or on a client in the level it shows. Tick and menu callbacks keep the entity resident and readable until removal.
block_entity_ identity - Signature
fn block_entity_ identity (&self, level: LevelRef, pos: [i32; 3]) -> Option<BlockEntityRef> - Summary
- The handle
BlockEntitiesHost::gives, and also for a block entity temporarily taken out by an engine operation. Its identity and attachments stay in place, so its Part state (block_ entity BlockEntityPartState) can still check its handle even though data reads find nothing until the row is put back.
block_in_ tag - Signature
fn block_in_ tag (&self, block: BlockKey, tag: &str) -> Option<bool> - Summary
- Whether the resolved block is in the world's merged block tag, on a client the tag its server sent. Unknown tags return false; unavailable tags or owning-thread block mappings return None.
block_item - Signature
fn block_item (&self, block: BlockKey) -> Option<ItemKey> - Summary
Block.asItem: the block's item identity, including air for a block with no item; None if either resolved identity is unavailable.
block_key - Signature
fn block_key (&self, id: &str) -> Option<BlockKey> - Summary
- The key of the block named
id, for a name that only arrives at run time (data, config, a command, a network message).idis the full registry name,minecraft:stoneormymod:machine. None for a name the registry does not hold, and before the registry is complete (during registration, useRegistrar::). Does not allocate.block_ key
block_keys - Signature
fn block_keys (&self) -> Vec<BlockKey> - Summary
- Every block key in the registry's registration order: vanilla's first, then mod blocks in the order they registered. A block registry lists a name once per state; this yields it once. Empty before the block table completes.
block_state_ default - Signature
fn block_state_ default (&self, block: BlockKey) -> Option<BlockState> - Summary
- The default state of the resolved
blockkey:Block.defaultBlockState, the one a block takes when nothing else says. None for an unknown block.
block_state_ id - Signature
fn block_state_ id (&self, name: &str) -> Option<BlockState> - Summary
- The state
namenames, read as/reads a block (setblock BlockStateParser.parseForBlock):minecraft:oak_,stairs[facing=east] stoneforminecraft:stone, the properties left out at their default. Returns an owned block key and canonical local ordinal, never vanilla's numericBlock.getId. None for an unknown block, a property it doesn't have or a value it can't take, or block NBT ({...}); and, as/'s argument, for anything after the block.setblock
block_state_ string - Signature
fn block_state_ string (&self, state: BlockState) -> Option<String> - Summary
- The state
stateas/takes it back (setblock BlockStateParser.serialize): its block, then each property in name order,minecraft:oak_, or the block alone for one with no properties. None for an unknown key or local ordinal; an invalid value never falls back to air.stairs[facing=east,half=bottom,...]
built_creative_ tabs - Signature
fn built_creative_ tabs (&self ,) -> Result<Option<std:: sync:: Arc<CreativeModeTabs>>, CreativeTabReadError> - Summary
CreativeModeTab.getDisplayItemsreads it, for a reader that only has&dyn Host. It never builds and never firesbuild_.creative_ mode_ tab_ contents Ok(None)before this side has built once (a read throughcreative_, or the creative screen, builds it);tabs CreativeTabReadError::in setup or reload and without a live world. The snapshot keeps the permissions of that build and stays immutable: a later build publishes a new one.Unavailable
cauldron_content_ for_ block - Signature
fn cauldron_content_ for_ block (&self, block: BlockKey) -> Option<CauldronContent> - Summary
- Contents registered for
block, or none if absent or no table has been built. Reads the current resource generation, including after reload.
cauldron_content_ for_ fluid - Signature
fn cauldron_content_ for_ fluid (&self, fluid: FluidKey) -> Option<CauldronContent> - Summary
- Contents registered for
fluid, or none if absent or no table has been built.
cauldron_level - Signature
fn cauldron_level (&self, state: BlockState) -> Option<u32> - Summary
- Current level of
state, or none without registered contents or a built table. Always-full contents answer their maximum level.
check_payload_ token - Signature
fn check_payload_ token (&self, token: &PayloadToken) -> Result<(), PayloadSendError> - Summary
- Whether
tokenis one this load's registrar handed out: the frozen declaration at its slot has its id, protocol, direction and schema, and its owning mod is on. Anything else (forged, from another load, of another type) isStaleToken, and nothing is sent.
chunk- Signature
fn chunk (&self, level: LevelRef, pos: [i32; 2]) -> Option<ChunkRef>- Summary
- Find a loaded chunk in an open server level (
ServerChunkCache.getChunkNow). As there, a FULL chunk found becomes one of the level's recent FULL lookups, so alevel.load_of it before the end of the level's next chunk tick places no ticket.chunk
config_files - Signature
fn config_files (&self) -> &'static dyn ConfigFiles - Summary
- The calling mod's own files in the game's
config/folder, besideoptions.txt(besideserver.propertieson a dedicated server): its folderconfig/and the files beside it named<mod id>/ <mod id>.<ext>or<mod id>-<rest>, as Fabric and NeoForge mods keep theirs. The service is bound to the mod whose hook or part is running, so a mod never names its id and can't reach another mod's files; a world'sserverconfig/is read only throughconfig_.loading
creative_tabs - Signature
fn creative_tabs (&mut self, permissions: CreativeTabPermissions ,) -> Result<std:: sync:: Arc<CreativeModeTabs>, CreativeTabReadError> - Summary
- On a cache miss, build it with explicit
permissionsand dispatchbuild_. It does not require an open creative screen. A same-parameter read from a listener sees tabs already built and the previous contents of tabs not yet built. Reentering with different parameters is refused. Published snapshots stay immutable. Permission is a build parameter, not a grant. During setup, reload, or without a live world, returnscreative_ mode_ tab_ contents CreativeTabReadError::.Unavailable
data_files - Signature
fn data_files (&self) -> &'static dyn ConfigFiles - Summary
sunrise-mod-data/in the game folder, never scanned as settings or config. Paths omit the mod id;<mod id>/ ConfigPath::names its root. Sunrise allows at mostroot() DATA_bytes per file.FILE_ MAX
dimension- Signature
fn dimension (&self) -> &'static str- Summary
- The level in place (
minecraft:overworld), for a hook that isn't told which it runs in.
dist- Signature
fn dist (&self) -> Dist- Summary
- Physical process, not the logical side of this hook.
effect_key - Signature
fn effect_key (&self, id: &str) -> Option<EffectKey> - Summary
- The key of the effect named
id: the full registry name,minecraft:speedormymod:rage. None for a name the registry does not hold, and before the registry is complete (during registration, useRegistrar::). Does not allocate.effect_ key
enchantment_keys - Signature
fn enchantment_keys (&self) -> Vec<EnchantmentKey> - Summary
- Every enchantment key in global sorted loaded-registry order, including vanilla and mod data-pack entries together (
RegistryDataLoadersorts by id).
enchantments_compatible - Signature
fn enchantments_compatible (&self, a: &str, b: &str) -> bool - Summary
- Whether enchantments
aandbmay share an item (Enchantment.areCompatible), by the world's enchantment definitions. API @API:item_components@.
entity- Signature
fn entity (&self, id: u32) -> Option<EntityRef>- Summary
- The entity
id(the id events carry) as a handle for theentity_methods: None with no world open, or for no such entity in the level in place or among the server's players. On a client (API @API:client_entity_refs@), any entity the server shows this window, this window's own player included. API 373.*
entity_residency - Signature
fn entity_residency (&self, entity: EntityRef) -> EntityResidency - Summary
- Where the entity
entitynames is now, as its Part state (EntityPartState) checks it: resident in the level this host is in, out of its lists for its own tick, resident in another level, or gone (removed or its removal pending, unloaded, moved under a new id, or a handle of another world open). On a client, in place for an entity the client has in the level it shows.
entity_type_ default_ attribute - Signature
fn entity_type_ default_ attribute (&self, entity_ type: &str, attribute: &str) -> Option<f64> - Summary
- An entity type's default value of an attribute, with no entity spawned (
DefaultAttributes.getSupplier(type).getValue(attribute)): what a new entity ofentity_(type minecraft:zombie) has forattribute(minecraft:max_) before any modifier, its supplier's base inside the attribute's range, for vanilla's types and mods' (a mod type's declared row, NeoForge'shealth EntityAttributeCreationEventandEntityAttributeModificationEventincluded). Both names are read asIdentifier.parsereads them:max_andhealth :max_arehealth minecraft:'s. The Host and typed reload/setup contexts share this read on both sides; it never unwinds.Nonebefore publication, for an unregistered type or one with no supplier (such asminecraft:item), or for a missing attribute.
entity_type_ in_ tag - Signature
fn entity_type_ in_ tag (&self, entity_ type: &str, tag: &str) -> bool - Summary
EntityType.is(TagKey): whetherentity_(type minecraft:player) is in the entity type tagtag(minecraft:cannot_).be_ pushed_ onto_ boats
entity_type_ keys - Signature
fn entity_type_ keys (&self) -> Vec<EntityTypeKey> - Summary
- Every entity-type key: built-in and content types in registry order (
BuiltInRegistries.ENTITY_), then native general types ordered by declaring mod and type id.TYPE
fluid_bucket - Signature
fn fluid_bucket (&self, fluid: &str) -> Option<ItemKey> - Summary
- The bucket item that picks
fluidup (Fluid.getBucket),minecraft:water_for water and flowing water. None forbucket minecraft:empty, whose bucket is air, and for a name no fluid has.
fluid_empty_ sound - Signature
fn fluid_empty_ sound (&self, fluid: &str) -> Option<&'static str> - Summary
- The sound event a bucket plays as it empties
fluid(BucketItem.playEmptySound, theBUCKET_sound of NeoForge'sEMPTY FluidType),minecraft:item.bucket.empty_for lava and flowing lava andlava minecraft:item.bucket.emptyfor water and a mod's world fluid. None forminecraft:empty, for a tank-only fluid, which has no world form, and for a name no fluid has.
fluid_in_ tag - Signature
fn fluid_in_ tag (&self, fluid: &str, tag: &str) -> Option<bool> - Summary
- Whether
fluidis in the fluid tagtag(FluidState.is(TagKey),minecraft:waterorwater), over the merged fluid tags, on a client those its server sent. An unknown tag is false. None as fornative_.block_ in_ tag
fluid_is_ same - Signature
fn fluid_is_ same (&self, fluid: &str, other: &str) -> bool - Summary
- Whether
fluidandotherare the same fluid (Fluid.isSame): a source and its flowing form are, sominecraft:waterandminecraft:flowing_are the same, water and lava not. Names are fluid ids, with or withoutwater minecraft:; false when either names no fluid.
fluid_key - Signature
fn fluid_key (&self, id: &str) -> Option<FluidKey> - Summary
- Resolve a registered fluid identifier.
fluid_pickup_ sound - Signature
fn fluid_pickup_ sound (&self, fluid: &str) -> Option<&'static str> - Summary
- The sound event a bucket plays as it picks
fluidup (Fluid.getPickupSound),minecraft:item.bucket.fill_for lava and flowing lava. None forlava minecraft:empty, which has none, and for a name no fluid has.
game_event_ key - Signature
fn game_event_ key (&self, id: &str) -> Option<GameEventKey> - Summary
game_version - Signature
fn game_version (&self) -> &'static str - Summary
- Exact Minecraft version supported by this process.
hover_name - Signature
fn hover_name (&self, stack: &ItemStack) -> Result<Text, TextFormError> - Summary
ItemStack.getHoverName()as a component. The custom name wins, then a written book's nonblank raw title. Otherwise the item's name is used: a mod item'sItemPart::answer replaces its default;item_ name Nonekeeps it. Vanilla item overrides (such as potion contents or a profiled player head) participate in the item-name step; the base item uses the stack'sitem_patch or inherits its prototype's value. A removal in the stack's patch reads empty; if a mod item's prototype has noname item_(including when the mod removes it), the game uses its item or block translation key. Only a fallback written into a component is kept. It carries no rarity colour or italics (name getStyledHoverNameadds those). Each viewer renders a translatable in their own language; calltext_on it for a string in this side's language. An invalid stack is astring TextFormError.
instance_dir - Signature
fn instance_dir (&self) -> PathBuf - Summary
- The instance (game) folder, which its players share:
saves/,resourcepacks/,shaderpacks/andsunrise-mods/are in it, and the title's screens create worlds and read packs there. A world's owndatapacks/is in that world's folder (saves/). The folder the game runs in (<world>/ datapacks --player-dirmoves a player's options and servers only, not the instance). Nothing is created.
is_loaded - Signature
fn is_loaded (&self, id: &str) -> bool - Summary
- Whether a mod with the
sunrise-mod.tomlididis installed: a native or content-only package (Fabric'sFabricLoader.isModLoaded, NeoForge'sModList.isLoaded). The list is fixed at startup.
item_block - Signature
fn item_block (&self, item: ItemKey) -> Option<BlockKey> - Summary
- The block
itemplaces (BlockItem.getBlock, asBlock.byItemreads it):minecraft:wheat_placesseeds minecraft:wheat, and a standing/wall item places its standing block, not the wall variant. None for an item that places no block, and for an unknown item.
item_burn_ time - Signature
fn item_burn_ time (&self, item: ItemKey) -> Option<i32> - Summary
- Item
item's cooking-fuel burn time in ticks (FuelValues.burnDurationof itscooking_component, the data pack's context int provider resolved), None where it is no fuel. API @API:item_components@.fuel
item_compost_ chance - Signature
fn item_compost_ chance (&self, item: ItemKey) -> Option<f32> - Summary
- Item
item's chance to raise a composter's level (itscompostablecomponent's layers provider resolved), None where it is not compostable. API @API:item_components@.
item_cooldown_ group - Signature
fn item_cooldown_ group (&self, stack: &ItemStack) -> String - Summary
ItemCooldowns.getCooldownGroup(stack): the groupstack's cooldown is filed under, the group itsuse_component names (its own, else its item's default), else its item id.cooldown
item_crafting_ remainder - Signature
fn item_crafting_ remainder (&self, stack: &ItemStack) -> Option<ItemStack> - Summary
Item.getCraftingRemainder: Sunrise currently stores the remainder's item id, so the result is a single plain stack.
item_default_ component - Signature
fn item_default_ component (&self, item: ItemKey, component: &str) -> Option<Tag> - Summary
- Item
item's default value of componentcomponent, in its prototype (Item.components().get):minecraft:max_on an iron sword isdamage 250, data packs' and native mods' changes included. Read from the item report's JSON, so a number is anInt,LongorDoubleand a boolean aByte. None where the item hasn't the component, and for an unknown item.
item_entity - Signature
fn item_entity (&self, entity: EntityRef) -> Option<ItemEntityRef> - Summary
- Narrows an entity to a dropped item, or None for another kind, a stale handle, a client, or an item temporarily taken out for ticking.
item_from_ snbt - Signature
fn item_from_ snbt (&self, snbt: &str) -> Option<ItemStack> - Summary
- Decodes a saved-item compound from SNBT, for example
{id:"minecraft:diamond_. A missingsword",count:1,components:{"minecraft:damage":5}} countdefaults to 1, unknown fields such asCountare ignored, andstonemeansminecraft:stone. ReturnsNoneunless the input is one compound with only whitespace around it. Air, unknown items and patches naming a transient component are refused. A presentcountmust be numeric and in 1 to 99 after Java'sNumber.intValueconversion. The text parser also enforces binary NBT's 2 MiB input and 512-level nesting bounds.
item_key - Signature
fn item_key (&self, id: &Identifier) -> Option<ItemKey> - Summary
- Resolve an item once at load, including vanilla items, to its process-local identity. None if the completed registry does not contain the identifier.
item_keys - Signature
fn item_keys (&self) -> Vec<ItemKey> - Summary
- Every item key in the registry's registration order: vanilla's first, then mod items in the order they registered. Empty before the item table completes.
known_recipes - Signature
fn known_recipes (&mut self) -> Arc<[i32]> - Summary
- The
book_s of the recipes the player's recipe book holds now (the server's book on a server); empty outside a world.id
level- Signature
fn level (&self, dimension: &str) -> Option<LevelRef>- Summary
- The level
dimension(minecraft:the_) as a handle: on a client, the level it shows, whatever the server calls it, and each level the server opened for viewing (nether sunrise:levels) while that view is open. A viewed level's handle answers its block reads from its own world:block_,state block,block_,property clip,collision_,boxes has_, and the fluid reads built oncollisions block_(state fluid_,shape fluid_,height fluid_,height_ for_ camera fluid_).can_ be_ replaced_ with get_uses the viewed level as context. Its other reads, its entity reads and every write refuse it. It answers None while the server has the level closed; a close and a later open within the same client level make the old handle read again. A login, a reconfiguration or a respawn into another level replaces the client level: the old handle stays stale and the mod asksenchant_ power_ bonus host.levelagain. None with no world open, or for a dimension the server hasn't loaded. API 373.
list_resources - Signature
fn list_resources (&self, pack_ type: PackType, directory: &str, suffix: &str) -> Vec<Identifier> - Summary
- The resources of
pack_'s stack under foldertype directoryof every namespace whose path ends insuffix, one each, in identifier order, asResourceManager.listResourcesanswers it:list_givesresources(PackType:: ClientResources, "textures/ item", ".png") minecraft:textures/and the rest. An emptyitem/ apple.png directorylists a whole namespace. Metadata files (.mcmeta) are never listed, and a name that isn't a valid identifier is skipped. A side without that stack, or adirectorythat leaves its namespace, lists nothing. This read never reloads packs.
lit_block_ name - Signature
fn lit_block_ name (&self, pos: [i32; 3]) -> Option<BlockKey> - Summary
- Read a loaded, light-emitting block. No implicit chunk loading.
living- Signature
fn living (&self, entity: EntityRef) -> Option<LivingRef>- Summary
- The entity as a living entity (vanilla's
LivingEntity: a mob, a player, an armor stand or the dragon), or None for another kind or a stale handle.
math_profile - Signature
fn math_profile (&self) -> MathProfile - Summary
- The native engine's fixed selection for the seven platform-dependent Java Math operations. This read allocates nothing on the native path. It identifies behavior, not the machine. See
MathProfilefor the algorithms selected by each profile.
max_damage - Signature
fn max_damage (&self, item: ItemKey) -> Option<u32> - Summary
- Default durability of the resolved item, or none if its metadata is unavailable. Stack-specific component overrides are checked at the game's write boundary.
max_stack_ size - Signature
fn max_stack_ size (&self, item: ItemKey) -> Option<u32> - Summary
- The most of the item
itemone slot holds (Item.getDefaultMaxStackSize), orNonefor an unknown item: for a mod's container that fills or merges stacks itself.
menu_keys - Signature
fn menu_keys (&self) -> Vec<MenuKey> - Summary
- Every built-in menu-type key in registry order (
BuiltInRegistries.MENUorder): vanilla's first, then mod types in the order they registered.
mob- Signature
fn mob (&self, entity: EntityRef) -> Option<MobRef>- Summary
- The entity as a vanilla Mob: a mob or the ender dragon. Players, armor stands, stale handles and clients are rejected. Mobs taken out for ticking are unavailable.
mod_recipe_ property_ contains - Signature
fn mod_recipe_ property_ contains (&self, set: &str, item: ItemKey) -> bool - Summary
- Whether a mod-created recipe property set accepts an item ID. Unknown sets/items and vanilla keys return false. The server uses its current load, and clients use the server's last synchronized generation (local preload before the first packet). The same read on
LoopContextletsmenu_filter a slot identically for server and prediction. Membership reads allocate nothing and perform no registry scans.slot_ rules
on- Signature
fn on (&self, mod_id: &str) -> bool - Summary
- Whether the player left mod
mod_on in Options > Mods. A mod turned off does nothing (check this first in each hook) until the launcher's next build leaves it out.id
payload_drop_ counts - Signature
fn payload_drop_ counts (&self, id: &PayloadId ,) -> Result<Option<PayloadDropCounts>, LevelReadError> - Summary
- The drops of
Droppablechannelidso far, by cause, over every connection of this game (a server's clientbound drops, a client's serverbound ones, and the server's refusals of a client over its byte budget).Nonefor a channel that is notDroppableor not declared by an enabled mod.Err(Unavailable)when the host has no backend.
player- Signature
fn player (&self, uuid: u128) -> Option<PlayerRef>- Summary
- Resolve a real online player by UUID, never a fake. A fake is reached through the handle returned by its factory. During a nested player swap, outer players whose records are displaced return None.
recipe_book_ category - Signature
fn recipe_book_ category (&mut self, kind: &str) -> Option<RecipeBookCategory> - Summary
- Published asset/data read: available in Setup, Reloading and World. The validated category and icon of a custom recipe type, or None for an undeclared/invalid type, before resources load, or outside a world. Returns the first category in category-id order when a type has several. This local declaration may include placement predicates; it is not the category data sent to a remote client. Any invalid declaration refuses the complete generation. Rebuilt when the recipe table changes. Does not unlock any recipes.
recipe_ingredient - Signature
fn recipe_ingredient (&self, json: &str) -> Result<Option<Ingredient>, RecipeJsonError> - Summary
- Published asset/data read: available in Setup, Reloading and World. An ingredient from recipe-file JSON text: an item, a
#tag, or a list of them, a bare id asminecraft:(as vanilla reads it);testsays whether a stack fits. Items the game doesn't know are left out; None for missing tags, invalid ingredients or no known named items, and outside a world. An existing-empty tag returns an empty ingredient. This helper parses standalone JSON; it does not bind a mod's custom kind. To test a custom ingredient already resolved at load, useIngredient::. Invalid JSON is refused withtest RecipeJsonError::.InvalidJson
recipe_result - Signature
fn recipe_result (&self, json: &str) -> Result<Option<ItemStack>, RecipeJsonError> - Summary
- Published asset/data read: available in Setup, Reloading and World. A stack from recipe-file
resultJSON text:id(a bare one asminecraft:),count(1 by default, up to 99) andcomponents. None without anid, for an item the game doesn't know or a count outside that, and outside a world. Invalid JSON is refused withRecipeJsonError::.InvalidJson
recipes_of_ type - Signature
fn recipes_of_ type (&self, kind: &str) -> Arc<[Recipe]> - Summary
- Published asset/data read: available in Setup, Reloading and World. The recipes of registered recipe type
kind(minecraft:crafting,mymod:crusher), vanilla's types and mods' own alike, fromdata/of vanilla, the content mods (<namespace>/ recipe/ *.json .smod) and the world's data packs, in file order: each one typed (Recipe: its ingredients, results, group, cooking time and experience, or its stonecutting, smithing or special crafting rule), together with its JSON. Locally loaded recipes give the original recipe JSON; synced vanilla serializers give the server's resolved item lists, and synced mod serializers give the data written by that serializer. Bound native predicates aren't written into the JSON or sent to clients. Thetypefield names the serializer; this can differ from the reported recipe kind. Dynamic rules are not fixed outputs; useLevelRef::for engine-matchable recipe types. Registered crafting kinds match through LevelRef::recipe_for. Cache other mod-owned types once per load/reload and match those in mod memory; those return RecipeLookupError::NotMatchable. These are the recipes in force (recipe_ for RecipeManager.getAllRecipesFor): data packs merged and load conditions held, so a pack's override or removal shows. A loaded recipe the API cannot represent is left out of this listing and logged at debug level with its id and reason; the rest remain in order. This does not change recipe loading. A data pack changes them on/, so look them up again when you need them. Empty for a type nobody uses and outside a world. These are the server's table on the server thread, a dedicated server or a LAN host; a client, the single-player window included, sees vanilla's and the content mods' recipes, not the world's data packs', unless a mod had the server send it the type (reload native_).datapack_ sync
registry_entries - Signature
fn registry_entries (&self, registry: &str) -> Option<Vec<Identifier>> - Summary
- Entry identifiers in the current table, each once. None for an unavailable or unknown registry; an available empty registry returns an empty list.
registry_entry - Signature
fn registry_entry (&self, registry: &str, id: &str) -> Option<RegistryEntry> - Summary
- Resolve a canonical entry in the current side's live registry. None for an unknown registry or entry, or before that registry is available.
registry_entry_ in_ tag - Signature
fn registry_entry_ in_ tag (&self, entry: &RegistryEntry, tag: &str) -> Option<bool> - Summary
- Membership in the current side's merged tags. None for an unavailable registry or entry; an absent tag, or a tag not containing the entry, returns false.
registry_protocol_ id - Signature
fn registry_protocol_ id (&self, registry: &Identifier, name: &Identifier) -> Option<i32> - Summary
- The network id of
nameinregistry(Registry.getId): the number a packet carries for it, for a mod that builds or reads raw packets (minecraft:particle_andtype minecraft:flame). Built-in registries answer their fixed ids, mod entries included; data-driven ones (minecraft:damage_,type minecraft:biome, ...) answer the order the server synced them in; custom data component types are included. A client reads its own connection's registries, a server the ones it sends. The id holds for one connection and one data reload: do not keep it across a reconnect, a reconfiguration or/. None for an unknown registry or name, on a client before that registry was synced, and with no connection. Allocates nothing; each registry is searched in order. Usereload ItemKey::for the local prepared item number used by scatter rendering; that read is available without a connection and is not a packet lookup.registry_ id
resource- Signature
fn resource (&self, pack_type: PackType, identifier: &Identifier) -> Option<Vec<u8>> - Summary
- The winning bytes of resource
idinpack_'s stack, astype ResourceManager.getResourceanswers it: the highest selected pack that supplies the file wins. Client resources are the selected asset packs over the game's assets; server data is the world's selected data packs over the game's and mods' data, withminecraft:vanillakept unless disabled.identifieris the resource name without itsassets/or<namespace>/ data/prefix, e.g.<namespace>/ minecraft:models/orblock/ stone.json mymod:machines/. Missing, unreadable and files abovefurnace.json MAX_returnRESOURCE_ BYTES None; a client side (or one without that stack) also returnsNone. This read never reloads packs.
resource_stack - Signature
fn resource_stack (&self, pack_ type: PackType, identifier: &Identifier) -> Vec<Vec<u8>> - Summary
- Every selected pack's copy of resource
identifierinpack_'s stack, lowest first and the highest pack's last, astype ResourceManager.getResourceStackanswers it; empty where no pack supplies it. The stack and the names are those ofresource, which reads the highest pack's copy. A copy that can't be read or is aboveMAX_is left out: when that is the highest pack's copy, the last entry is a lower pack's whileRESOURCE_ BYTES resourcereturnsNone. This read never reloads packs.
server_data_ version - Signature
fn server_data_ version (&self) -> i32 - Summary
- The engine's
DataVersionwritten into level data and chunks. Constant on both sides, including before a world is open; this describes this game build, not the version of a remote server or an older save.
server_has_ time - Signature
fn server_has_ time (&self) -> bool - Summary
- Whether the server's current tick still has time before the next one is due (
MinecraftServer.haveTime, NeoForge'sServerTickEvent.hasTimeandLevelTickEvent.hasTime): a mod doing optional work inserver_ortick level_/tick_ pre level_skips it when this is false. Always true on a client, and outside a scheduled tick.tick_ post
set_setting - Signature
fn set_setting (&self, mod_ id: &str, key: &str, value: &str) - Summary
- Keeps a mod's registered setting
key. Another mod's id or an unregistered key keeps nothing. A successful write invalidates the typed read cache for this data folder and key; a failed write leaves it unchanged. This raw write does not firesetting_.changed
setting- Signature
fn setting (&self, mod_id: &str, key: &str) -> Option<String> - Summary
- A mod's setting
key(one file per key innative_). A mod reads only its own: another mod's id or a key not registered by that owner gives None.data_ dir
state_fluid_ state - Signature
fn state_fluid_ state (&self, state: BlockState) -> Option<FluidState> - Summary
- The fluid state
stateholds (BlockState.getFluidState): water for a waterlogged state, the empty fluid for most. None for an id no state has.
state_outline - Signature
fn state_outline (&self, state: BlockState) -> Option<Vec<[f64; 6]>> - Summary
- The outline of
stateasBlockState.getShapeanswers it with an empty getter at the origin (EmptyBlockGetter.INSTANCE,BlockPos.ZERO): its boxes, each[min x, y, z, max x, y, z]in the block's own space, with no random offset and none of a world's context (a state that reads its neighbours or block entity answers what its state alone gives). Empty for a state with no outline, such as air. None for an id no state has.
sunrise_version - Signature
fn sunrise_version (&self) -> &'static str - Summary
- Sunrise version printed in crash reports.
tags- Signature
fn tags (&self) -> &dyn Tags- Summary
- The merged-tag service, using load-resolved item and tag keys.
text_from_ json - Signature
fn text_from_ json (&self, json: &str) -> Result<Option<Text>, TextFormError> - Summary
- Reads a text component as
/andtellraw ComponentSerialization.CODECtake it: one JSON or SNBT value ("plain",{"text":"Hi","color":"gold"},["a",{"text":"b"}],translate,extra, click and hover events), with nothing but whitespace after it (Paper'sGsonComponentSerializer.deserialize). None when it does not parse as one component: an object needs one content key (atypebinds alone, a nulltypecounts as absent),textmust be a string,extraa non-empty list, and a style field that is present and wrong refuses the whole component. Command, URL and page click actions usecommand,urlandpage, respectively; a legacyvalue-only click for those actions is refused.open_requires a well-formed HTTP(S) URI; a malformed URI or another scheme refuses the component (url Ok(None)).show_refusesitem minecraft:air; a component removal (!id) requires an object value. An object whose only content key isindexis refused, as in vanilla's codec; Sunrise follows vanilla there.
text_from_ legacy - Signature
fn text_from_ legacy (&self, legacy: &str) -> Result<Text, TextFormError> - Summary
- Reads legacy formatting codes (
§a,§l,§r...) as the font draws them (Style.applyLegacyFormat; Bukkit'sChatColorstrings): a colour code resets the decorations,§rresets everything, an unknown code is dropped.&codes are not read; a mod that takes them replaces&with§first, asChatColor.translateAlternateColorCodesdoes.
text_from_ nbt - Signature
fn text_from_ nbt (&self, tag: &Tag) -> Result<Option<Text>, TextFormError> - Summary
- Read a component with
ComponentSerialization.CODECandNbtOps. A string is literal, including§codes. Numeric style flags are true when nonzero, and a custom click payload keeps its original NBT tag types.Ok(None)means the tag does not decode as a component; nesting beyond the 512 containers allowed by vanilla NBT returnsTextFormError::.TooDeep
text_string - Signature
fn text_string (&self, text: &Text) -> String - Summary
Component.getString(): resolve translations, arguments, keybinds and siblings to plain characters. Styles do not add characters; literal legacy formatting codes remain.
text_to_ nbt - Signature
fn text_to_ nbt (&self, text: &Text) -> Result<Tag, TextFormError> - Summary
- Encode one component with
ComponentSerialization.CODECandNbtOps. An unstyled literal with no siblings encodes as a string. Translations and styles are stored, not resolved. Refuses malformed fields and nesting beyond vanilla NBT's 512 containers.
unresolved_fluid_ id - Signature
fn unresolved_fluid_ id (&self, fluid: UnresolvedFluid) -> String - Summary
- The saved name for an engine-issued unresolved fluid.
upgrade_nbt - Signature
fn upgrade_nbt (&self, _ kind: NbtDataType, _ data_ version: i32, _ nbt: Compound ,) -> Result<Compound, NbtUpgradeError> - Summary
- Run the game's data fixers on one saved compound, from
data_to the current game data version. This needs no world, adds noversion DataVersionfield, and runs no fixes that operate on the enclosing chunk or file. UseNbtDataType::if the upgrade should include riders and passengers as well as the root entity. Like vanilla's standalone fixers, entity and block-entity roots can retain legacy keys alongside newly written ones.EntityTree
Server (ServerHost)
add_objective - Signature
fn add_objective (&mut self, name: &str, criteria: &str, display_ name: Text, render_ type: ObjectiveRenderType ,) -> Result<ObjectiveRef, ObjectiveError> - Summary
Scoreboard.addObjective: a new objective with no number format that does not update scores' display names, shown nowhere. The name is any string, as the board takes it; the/command only reads a single word. Refused withscoreboard ObjectiveError::orNameTaken ObjectiveError::.UnknownCriteria
add_team - Signature
fn add_team (&mut self, name: &str) -> Result<TeamRef, TeamError> - Summary
/: a new team with its name as display name, no color, no members and vanilla's default options. The name is any string, as the board takes it. Refused withteam add TeamError::when a team has it.NameTaken
advancement- Signature
fn advancement (&mut self, id: &Identifier) -> Option<AdvancementInfo>- Summary
ServerAdvancementManager.get(id): the loaded advancementid, from the set the last data-pack load or/built (loaded on first use). None when no advancement has that id.reload
attachment_validate_ write - Signature
fn attachment_validate_ write (&self, token: AttachmentWriteToken ,) -> Result<(), AttachmentRowError> - Summary
- Validate the capture's transaction, if any, and residency in the current dimension immediately before an ordinary journaled attachment write. The token comes from a captured row, not from disk or the network. Returns
Unavailableoutside the world phase. In the world phase,OutsideTransactionfor an expired frame takes precedence overStaleHolderfor missing or mismatched residency. This does not open a transaction.
block_entity_ sync - Signature
fn block_entity_ sync (&mut self, pos: [i32; 3]) - Summary
- Sends clients the block at
posand its block entity's update tag (block_) again, asentity_ update_ tag Level.sendBlockUpdateddoes: with the level's other block changes, to the players who see its chunk, once however often it is called before then. Changes made in a block entity's tick go out at the start of the next tick, as vanilla's do (ServerLevel.tickbroadcasts chunks before it ticks block entities). Call it when what clients show changed (a machine started), not for every tick's progress: a menu's data slots carry that. Nothing happens for an unloaded block. It also sends the one-shot fields ofBlockEntityView::.set_ client_ update_ fields
boss_bar - Signature
fn boss_bar (&self, id: &str) -> Option<BossBarRef> - Summary
- An existing custom boss bar by id (
minecraft:when no namespace), or None. Saved bars are there from the world's start, as vanilla'sCustomBossEvents. Boss bars of mobs and raids are not custom boss events.
boss_bars - Signature
fn boss_bars (&self) -> Vec<BossBarRef> - Summary
- Every custom boss bar, in the order
/shows them.bossbar list
cancel_task - Signature
fn cancel_task (&mut self, id: TaskId) -> bool - Summary
- Withdraws the waiting task identified by the opaque capability
id: returnstrueif it was still waiting. A panic while dropping an attributed task's captures is reported against the scheduling mod, disables that mod's delayed callbacks and does not unwind through the caller.
close_menu - Signature
fn close_menu (&mut self, uuid: u128) - Summary
- Closes the player's native menu (a
menu_follows). During an active menu click, the close waits for the transaction to commit; an abort leaves the window open.closed
commands- Signature
fn commands (&mut self) -> &mut dyn Commands- Summary
- The commands service.
configuration_has_ channel - Signature
fn configuration_has_ channel (&self, connection: ConfigurationConnection, channel: &PayloadId ,) -> bool - Summary
configuration_send_ payload - Signature
fn configuration_send_ payload (&mut self, connection: ConfigurationConnection, channel: &PayloadId, bytes: PayloadBytes ,) -> Result<(), ConfigurationTaskError> - Summary
- connection while its configuration epoch is active, regardless of current task state. A saved connection returns
ConfigurationTaskError::after it moves to Play. PreferDisconnected ConfigurationTaskContext::in start and tick callbacks.send_ payload
create_boss_ bar - Signature
fn create_boss_ bar (&mut self, id: &str, name: Text ,) -> Result<Option<BossBarRef>, TextFormError> - Summary
/: a new bar, visible, white,bossbar add progress, at 0 of 100, with nobody added. None if the id is taken or invalid, or outside a server. Refuses text deeper than 512 component nodes before applying any changes.
dispense_default - Signature
fn dispense_default (&mut self, dimension: &str, pos: [i32; 3], facing: Direction, stack: ItemStack ,) -> Result<Option<ItemStack>, StackWriteError> - Summary
- Drop one item as DefaultDispenseItemBehavior does. For a dispenser hook: return this remainder in its answer with
CLICK; the caller plays the answer's event and smoke once. The detached stack keeps its actual count until one item is dropped; placement limits apply only to the final slot write. An enclosing transaction defers the drop in the dispenser's level until commit. A client, another dimension or an unloaded chunk keeps the input stack unchanged.
dispense_with_ remainder - Signature
fn dispense_with_ remainder (&mut self, dimension: &str, pos: [i32; 3], facing: Direction, stack: ItemStack, remainder: ItemStack ,) -> Result<Option<ItemStack>, StackWriteError> - Summary
DefaultDispenseItemBehavior.consumeWithRemainder: one ofstackis used andremainderreplaces it, a singlestackby becoming it, else into the dispenser atpos(DispenserBlockEntity.insertItem) or, where it doesn't fit, out of its front with the click and smoke. Returns the detached active-slot remainder immediately. Inside a transaction, insertion into another slot is provisional; slot notices, overflow drops, click and smoke are published in the source level only when the enclosing transaction commits at the root. A client, another dimension or an unloaded chunk keepsstackunchanged.
display- Signature
fn display (&self, entity: EntityRef) -> Option<DisplayRef>- Summary
- Narrows an entity to a display, or None for another kind, a stale handle or a client.
display_slot_ objective - Signature
fn display_slot_ objective (&self, slot: DisplaySlot) -> Option<ObjectiveRef> - Summary
Scoreboard.getDisplayObjective: the objective shown in the slot, or None.
dragon- Signature
fn dragon (&self, entity: EntityRef) -> Option<DragonRef>- Summary
- The entity as the ender dragon, or None for another kind, a stale handle or a client.
edit_blocks - Signature
fn edit_blocks (&mut self, dimension: &str, edit: &BlockEdit) -> Result<u64, String> - Summary
- For a server mod: the runs made at once, straight into the chunks of the authoritative level
dimension(the one being ticked, as fornative_), with whatset_ block fill ... strictdoes for block entities (a block replaced by another loses its block entity, and a new block gets the onenative_would give it, a mod block's included); no neighbour is told and the replaced block entity's contents do not drop. Inside a transaction in this level, the new blocks and entities are visible at once; abort quietly restores both, with the connection group each replaced block had. The changed chunks go to the players whole, with their resulting connection groups, only after the level's outermost commit. At positions also written withset_ block LevelRef::, strict and ordinary edits commit in call order; the strict edit never spills a container or requests neighbor updates. Runs in chunks not loaded, and the parts of runs outside the column, are left out. The blocks changed, or why the edit was left out, with nothing changed: another dimension, a client of a server, a palette entry or predicate that fails typed validation, a run naming a palette entry or filter past the end, or more than 65536 filters.set_ block
experience_orbs - Signature
fn experience_orbs (&self, dimension: &str, min: [f64; 3], max: [f64; 3]) -> Vec<ExperienceOrb> - Summary
- The experience orbs of the server level
dimensionwhose box meets the boxmin..max, in the level's order: what a mod reads before it cancels an orb inentity_, to give its points withjoin_ level PlayerRef::. Empty for a level not in place, on a client of a server and for a bound that is not finite (NaN or infinite); a minimum above its maximum is the same box with the two swapped (give_ experience_ points AABB).
fake_player - Signature
fn fake_player (&mut self, level: LevelRef, uuid: u128, name: &str) -> Option<PlayerRef> - Summary
- Create or retrieve a connectionless player for the level currently in place.
fishing_hook - Signature
fn fishing_hook (&self, entity: EntityRef) -> Option<FishingHookRef> - Summary
- Narrows an entity to a cast fishing hook. None for another kind, a stale handle, a client, or a hook taken out for its tick.
fluid_interaction_ result - Signature
fn fluid_interaction_ result (&self, source: FluidState, neighbour: BlockState, below: BlockState ,) -> Option<BlockState> - Summary
- What a liquid cell of
sourcebecomes beside one cell (neighbour, a block state whose fluid is read through it, so a waterlogged block holds water) withbelowunder it: the open world's fluid interaction table (vanilla's lava rules, then every mod's entries, asLiquidBlock.shouldSpreadLiquidand NeoForge'sFluidInteractionRegistrywalk it) for that one neighbour, with the same exact-tag and family matching, a source cell's result for a source and the flowing result otherwise.Noneis no interaction, and for a fluid with no entries or one that has no world form. A pure read: it changes no world, fires nofluid_and plays no fizz. A liquid checks its five neighbours in vanilla's order, above, north, south, west, east (never below), and the first that answers wins: loop over them in that order to ask the same.place_ block
game_rule - Signature
fn game_rule (&self, id: &str) -> Result<GameRuleValue, GameRuleReadError> - Summary
- Read the server-wide rule from the first server hook onward. Returns
UnknownRulefor an unknown id; level reads use the same store.
game_rules - Signature
fn game_rules (&self) -> Vec<(String, GameRuleValue)> - Summary
- Every current rule in the one server-wide store, by namespaced id. Readable from
server_, before any level exists. Level game-rule reads use this same store once their level exists.about_ to_ start
game_tests_ enabled - Signature
fn game_tests_ enabled (&self) -> bool - Summary
- Startup opt-in for test-only content. Test registration runs regardless.
holder_team - Signature
fn holder_team (&self, holder: ScoreHolder) -> Option<TeamRef> - Summary
Scoreboard.getPlayersTeam: the team the holder is on, or None when it is on none or does not resolve. Membership is by the holder's key, so an offline player's name works.
kill_mob - Signature
fn kill_mob (&mut self, dimension: &str, id: u32) -> bool - Summary
- Kills mob
idas/does: it falls and drops its loot. False for no such living mob or another dimension.kill
levels- Signature
fn levels (&self) -> &dyn Levels- Summary
- The levels service.
menu- Signature
fn menu (&self, uuid: u128, window: i32) -> Option<MenuRef>- Summary
- The menu
open_opened that the player has open as windowmenu window(the window idopen_,menu menu_andclicked menu_give). Its slots are written asclosed ItemPlace::in a transaction, and the client is sent each changed slot with the next tick's container sync (MenuSlot AbstractContainerMenu.broadcastChanges), as for any open menu. None for another window, a menu the game opened, or a player who isn't here.
menu_set_ items - Signature
fn menu_set_ items (&mut self, uuid: u128, window: i32, items: Vec<Option<ItemStack>> ,) -> Result<(), MenuItemsRefusal> - Summary
- Replaces everything the player's open
open_menumenu windowshows withitems(by slot, padded with empty ones, extra ones dropped, asopen_takes them) and sends it at once as onemenu ClientboundContainerSetContentPacket(AbstractContainerMenu.sendAllDataToRemote), without reopening the menu: the title, the cursor and the screen stay. Writing slots throughmenusends each changed slot with the next tick's sync instead; this is the whole-contents form, for a page turned or a list rebuilt. Each refusal sends nothing and changes nothing, and is named byMenuItemsRefusal:Client,NoPlayer(no placed player of that UUID),NotOpen(windowis not their open native menu),Stack(a stack the game's item conversion refuses), orOwnedSlots(useItemPlace::for an owned window). Inside a transaction, an abort puts the display contents back without sending a packet.MenuSlot
merchant- Signature
fn merchant (&self, entity: EntityRef) -> Option<MerchantRef>- Summary
- Narrows an entity to a villager or wandering trader, or None for another kind, a stale handle, or a client.
messages- Signature
fn messages (&self) -> &dyn Messages- Summary
- The messages service.
minecart- Signature
fn minecart (&self, entity: EntityRef) -> Option<MinecartRef>- Summary
- Narrows an entity to a minecart of any kind, or None for another kind of entity, a stale handle, a client, or an entity held out of storage.
objective- Signature
fn objective (&self, name: &str) -> Option<ObjectiveRef>- Summary
Scoreboard.getObjective: the objective with that name, or None. The name is any string; saved objectives are there from the world's start.
objectives- Signature
fn objectives (&self) -> Vec<ObjectiveRef>- Summary
Scoreboard.getObjectives: every objective. Vanilla keeps them in a hash map, so no order is promised; Sunrise answers its board's own.
open_menu - Signature
fn open_menu (&mut self, uuid: u128, rows: u8, title: Text, items: Vec<Option<ItemStack>>, replace: MenuReplace ,) -> Result<Option<i32>, StackWriteError> - Summary
- Opens a chest menu of
rowsrows (1 to 6) titledtitlefor the player, showingitems(by slot, padded with empty ones), in place of the menu they had open: its window id, a new one each time (ServerPlayer.openMenu). The old menu closes as a close does, its cursor stack going back to the player's inventory;replacesays whether the client is first sent a close for it (MenuProvider.shouldTriggerClientSideContainerClosingOnOpen).MenuReplace::changes the title and rows without the client centring the mouse again. Packets for the old window are ignored. The items of an open menu change through its slots (InPlace menu), not by opening it again. An active speculative menu click refuses the open withOk(None).
place_recipe_ in_ grid - Signature
fn place_recipe_ in_ grid (&mut self, recipe: &str, grid_ width: u16, grid_ height: u16, grid_ slots: Vec<u16>, clear_ slots: Vec<u16>, use_ max_ items: bool ,) -> Result<bool, String> - Summary
- Only inside
recipe_, once per click: placesbook_ place recipe, the recipe that hook was asked about, into a grid of the open mod menu as vanilla'sServerPlaceRecipe.placeRecipedoes.grid_andwidth grid_give the grid's cells, row by row;height grid_the menu slot of each cell (a recipe never fills a cell past the last slot given);slots clear_the slots emptied first, their items going back to the player's inventory (the grid's slots are cleared too).slots use_places as many sets as the items allow (Shift), else one more than the grid holds when it already matches. Items are taken from the player's inventory and from what the menu's sources lend. Candidate IDs and client displays do not replace the server's recheck of live stacks, including custom predicates. Returns whether items were missing: the grid was cleared and the answer formax_ items ghost. Refused (and nothing changes) outside that hook, on a second call, for another recipe, a slot the menu lacks or hides, a repeated slot, an empty grid, a recipe larger than the slots given, a slot whose pickup a part refuses, or a player with no room for the cleared items outside creative mode.
place_template - Signature
fn place_template (&mut self, source: &StructureTemplateSource, at: [i32; 3], pivot: [i32; 3], rotation: StructureRotation, mirror: StructureMirror ,) -> Result<(), String> - Summary
- For a server mod: template
sourceplaced atatthe way/and a structure block's load place one, withplace template rotation,mirrorandpivot, the level position the turn and the mirroring go around (at, which/uses, turns the template about its own origin). Blocks, block-entity data and the template's own entities come through vanilla's placement, so states are mirrored then turned, block entities keep their data and get the loot seed a placement gives them, and entities are spawned as the game spawns them: no processor runs, nothing isplace template strict, and the neighbours of a replaced block are not told. A template read from structure NBT is read by the game's own loader, within vanilla's limits for a template file (astructure/read under*.nbt NbtAccounter.unlimitedHeap, gzipped or plain).Errsays why nothing was placed: an id that doesn't parse or has a.or..part, a template the game doesn't have, NBT that doesn't read or is past those limits, a template that places nothing, a client of a server, a chunk of the template's box not loaded, or the game's structure resources missing. API @API:structure_template@.
players- Signature
fn players (&self) -> &dyn Players- Summary
- The players service.
players_send_ payload - Signature
fn players_send_ payload (&mut self, players: &[PlayerRef], id: &PayloadId, bytes: PayloadBytes ,) -> u32 - Summary
- Queue the same application bytes on each of
players' connections: one crossing and one buffer for the whole group, whereplayer_repeats both per player. Each send followssend_ payload player_'s rules; a player whose send is refused (offline or stale, no channel, wrong phase, backpressure, framing) is skipped and not counted. Returns how many sends were accepted, which is 0 for an empty list; a player listed twice is sent to twice. Publication waits for root commit; abort publishes nothing.send_ payload
profiles- Signature
fn profiles (&self) -> &dyn Profiles- Summary
- The profiles service.
projectile- Signature
fn projectile (&self, entity: EntityRef) -> Option<ProjectileRef>- Summary
- Narrows an entity to a projectile: one in the projectile list, a trident a player threw or a firework rocket. None for another kind, a stale handle or a client.
read_columns - Signature
fn read_columns (&self, dimension: &str, columns: &[(i32, i32)], heightmap: Heightmap, range: (u32, u32) ,) -> Result<ColumnBlocks, String> - Summary
- For a server mod:
belowblocks under andaboveblocks from each column's height byheightmap, as a palette of completeBlockStatevalues and indexes, with each column's server-side biome JSON water colour (water_,colors 0xRRGGBB;0where not loaded; air outside the column and in columns not loaded). Colormap-derived grass and foliage tints are client-side only: read blended tints on the client withBlockAndTintGetter::in block tint callbacks orblock_ tint ClientHost::in other client hooks.biome_ tint Errsays why nothing was read: another dimension or a client of a server,below + aboveof 0 or more than the level's height, or a read of more than 1,048,576 blocks (MAX_; it runs on the server tick, so read big areas in pieces).READ
reload_resources - Signature
fn reload_resources (&self) -> &dyn ServerReloadResources - Summary
- The retained server reload listeners of the last successful reload.
runtime_levels - Signature
fn runtime_levels (&mut self) -> &mut dyn RuntimeLevels - Summary
- The runtime_levels service.
schedule_task - Signature
fn schedule_task (&mut self, delay_ ticks: u32, task: Box<dyn FnOnce (&mut dyn ServerHost)> ,) -> Result<TaskId, ScheduleError> - Summary
- Runs
taskonce afterdelay_server ticks, matching vanilla'sticks MinecraftServer.schedule(TickTask)/BlockableEventLoop.runAllTasks. Due tasks drain to exhaustion after both theserver_start hook and thetick server_end hook, sotick delay_runs in the current tick (includingticks == 0 0-delay tasks scheduled from inside a running task). A paused server does not advance the delay. Tasks due together run in the order they were scheduled.
server_is_ published - Signature
fn server_is_ published (&self) -> bool - Summary
- Whether the server is open to players other than a single-player world's owner (
MinecraftServer.isPublished): always true on a dedicated server; on a single-player world's server, true while it is open to LAN (the Open to LAN screen or/) and false again once that ends (publish /). No hook fires when it changes: read it when the answer matters.unpublish
server_max_ players - Signature
fn server_max_ players (&self) -> Option<u32> - Summary
- The most players who may be on at once (
PlayerList.getMaxPlayers,max-players), as the server list shows it. Logins at or above the limit are refused unless they bypass it. None where no server is open to players (a client, or a server nobody can join).
server_set_ max_ players - Signature
fn server_set_ max_ players (&mut self, max_ players: u32) -> Result<(), PlayerLimitRefusal> - Summary
- Sets the player limit from the next login and server list ping on (Paper's
Server.setMaxPlayers); players already on stay, even when they are more than the new limit. The existing login bypass still applies (dedicated operators flaggedbypassesPlayerLimit).server.propertiesis not changed, so a restart goes back to itsmax-players. Writes nothing and refuses withPlayerLimitRefusal::where no server is open to players, and withNotOpen TooHigh { maximum }for a limit abovei32::, as vanilla keeps the limit in anMAX int(Paper'ssetMaxPlayerstakes one). Zero is taken: it refuses all new logins that do not bypass the limit.
server_set_ simulation_ distance - Signature
fn server_set_ simulation_ distance (&mut self, distance: i32) -> bool - Summary
- Sets the server's simulation distance live, as
PlayerList.setSimulationDistancedoes: every player is sentClientboundSetSimulationDistancePacket, and the chunks around the players tick to the new distance from the next tick.server.propertiesis not written. False for a distance outside 2 to 32, and off a dedicated server.
server_set_ view_ distance - Signature
fn server_set_ view_ distance (&mut self, distance: i32) -> bool - Summary
- Sets the server's view distance live, as
PlayerList.setViewDistance(and the management protocol'sserversettings/) do: every player is sentview_ distance/ set ClientboundSetChunkCacheRadiusPacketand their chunks follow, each up to what their client asked for.server.propertiesis not written, so a restart goes back to it. False for a distance outside 2 to 32, and off a dedicated server (an integrated server follows its window's option).
server_simulation_ distance - Signature
fn server_simulation_ distance (&self) -> Option<i32> - Summary
- The server's simulation distance in chunks (
PlayerList.getSimulationDistance,simulation-distance): how far around each player chunks tick. None off a server open to players.
server_view_ distance - Signature
fn server_view_ distance (&self) -> Option<i32> - Summary
- The server's view distance in chunks (
PlayerList.getViewDistance,view-distance): how far players are sent chunks at most. None off a server open to players.
set_block_ property - Signature
fn set_block_ property (&mut self, pos: [i32; 3], key: &str, value: &str) -> bool - Summary
- Sets property
keyof the block atpostovalue, as a furnace's tick sets itslit(Level.setBlockwithUPDATE_: neighbours and clients are told); true when the block changed, false when the block has no such property or value, or the property already hasALL value(asLevel.setBlockfor an unchanged state). The block entity stays.
set_block_ property_ with - Signature
fn set_block_ property_ with (&mut self, pos: [i32; 3], key: &str, value: &str, flags: i32 ,) -> bool - Summary
native_withset_ block_ property Level.setBlock'sflags, as a brewing stand's tick sets its bottles withflags::. Players get the write whenUPDATE_ CLIENTS UPDATE_is set; false when this window isn't a server, and in each caseCLIENTS native_returns false.set_ block_ property
set_display_ slot - Signature
fn set_display_ slot (&mut self, slot: DisplaySlot, objective: Option<ObjectiveRef>) -> bool - Summary
Scoreboard.setDisplayObjective: shows the objective in the slot, or clears the slot with None. Clients are sent the change by the board's usual per-tick sync. False for a stale objective.
set_experience_ orb - Signature
fn set_experience_ orb (&mut self, dimension: &str, id: u32, value: Option<i32>, count: Option<u32>, age: Option<u32> ,) -> bool - Summary
- Writes the experience orb
id'svalue(the points a pickup gives),count(orbs merged into it, each worthvalue) andage(ticks lived; an orb despawns at 6000); aNoneis left as it is. Signed values are preserved, including zero and negative values. False, and nothing written, for an orb not in the server leveldimension, acountof 0 or abovei32::, anMAX ageabovei32::(MAX ExperienceOrb.ageis an int), avalueoutside -32768..=32767 (a save keepsValueas a short andCountas an int, so a write it accepts reloads unchanged), and on a client of a server. Inexperience_, a write toorb_ merge intois the merged orb.
set_tick_ rate - Signature
fn set_tick_ rate (&mut self, rate: f32) -> bool - Summary
- Sets the server's tick rate, as
/does (tick rate ServerTickRateManager.setTickRate): the game ticksratetimes a second from the next tick on, an autosave wait already running is shortened when the new rate asks for less, andserver_fires. The players' clients follow on the next sync. False, with nothing changed, for a rate outside 1 to 10000 (the command's range), one that isn't finite, a call from insidetick_ rate_ changed server_(which would hear itself again without end), or on a client.tick_ rate_ changed
spawn_falling_ block - Signature
fn spawn_falling_ block (&mut self, dimension: &str, state: BlockState, pos: [f64; 3], velocity: [f64; 3], falling: Falling ,) -> bool - Summary
- Throws a falling block of
statefrompos(its bottom centre) atvelocity(blocks a tick) in the level in place,dimension: it falls, lands and places itself as sand does, or drops as an item where it can't. The block atposis left as it is: take it away first withnative_to make a block fall out of the world. False, with nothing thrown, on a client's copy of the world, for another dimension, an air or unknown state, a chunk that isn't loaded, a value that isn't finite, or with 1024 falling blocks in the level already. Each axis ofset_ block velocityis cut to 3.9.
spawn_projectile_ from_ rotation - Signature
fn spawn_projectile_ from_ rotation (&mut self, owner: LivingRef, entity_ type: &Identifier, stack: &ItemStack, offset: f32, power: f32, inaccuracy: f32 ,) -> Option<ProjectileRef> - Summary
- projectile: snowball, egg, pearl, potion, experience bottle, wind charge, or a registered mod thrown type. Constructs at the owner's eyes minus 0.1F blocks (wind charges use eye height directly), sets ownership before shooting, inherits known movement (vertical only while airborne), adds to the level and fires projectile_launch. Spread draws x, y, z triangular noise from the new projectile's own random. Once it is in the level,
stack's enchantments run theirprojectile_effects on it (spawned Projectile.applyOnProjectileSpawned): in the stack's order, each effect's requirements tested with the level random just before it applies, its own draws from the projectile's random. Does not consume the stack or apply item-use cooldowns or statistics. None for an unavailable owner or one in another level, unsupported type, invalid stack or non-finite shot parameter. Also refuses a stack with aprojectile_effect the engine does not apply:spawned ignite,apply_,impulse play_andsound all_of those apply (of apply_andmob_ effect apply_do nothing to a projectile, as in vanilla); the block, damage, explosion, particle, summon, function and item-damage effects are refused rather than skipped. No random is drawn and nothing spawns on those refusals. Unsupported requirement contexts (including entity flags) and invalid clamped level-value ranges also refuse before insertion. Type predicates, random chance and their boolean combinations are supported. The original stack is unchanged; carried count is one; the effects see the stack as given.exhaustion
structure_template - Signature
fn structure_template (&mut self, id: &str, at: [i32; 3], rotation: StructureRotation, mirror: StructureMirror ,) -> Option<StructureTemplateSnapshot> - Summary
- For a server mod: structure template
id(mymod:hut, found asStructureTemplateManager.getfinds it: the world's saved structures, then the game's and the mods' own) as/would place it atplace template id atwithrotationandmirror, without placing anything. The blocks come in vanilla's placement order (full blocks, the others, then those with a block entity, each by y, x, z), from the palette/picks atplace template at; no processor runs, and the template's entities are left out. None for an id that doesn't parse or has a.or..part, a template the game doesn't have, and on a client. API @API:structure_template@.
summon- Signature
fn summon (&mut self, dimension: &str, kind: &str, pos: [f64; 3], nbt: Compound) -> Option<u32>- Summary
- Spawns an entity of
kind(minecraft:item_) atdisplay posin the level in place,dimension, fromnbt(its compound, as/takes it; passengers included): its id. None on a client's copy of the world, for another dimension, a position outsidesummon <kind> <pos> <nbt> /'s bounds, a chunk that isn't loaded, a kind Sunrise can't load, or one a mod kept out (summon entity_). Inside a transaction its join waits for the root commit, so a mod keeping it out is not known at the call: the id is returned and names nothing from the commit on.join_ level
surface_heights - Signature
fn surface_heights (&self, dimension: &str, columns: &[(i32, i32)], heightmap: Heightmap ,) -> Result<Vec<Option<i32>>, String> - Summary
- For a server mod: each column's height by
heightmapin the authoritative leveldimension(the one being ticked), none for a column not loaded.Errsays why nothing was read: another dimension or a client of a server, or more than 65,536 columns (MAX_).COLUMNS
team- Signature
fn team (&self, name: &str) -> Option<TeamRef>- Summary
Scoreboard.getPlayerTeam: the team with that name, or None.
teams- Signature
fn teams (&self) -> Vec<TeamRef>- Summary
Scoreboard.getPlayerTeams: every team, in the board's own order (vanilla's is a hash map's, so no order is promised).
terrain_surface - Signature
fn terrain_surface (&self, dimension: &str, columns: &[(i32, i32)] ,) -> Result<Vec<Option<TerrainColumn>>, String> - Summary
- Read the level generator before features, without creating, holding or loading chunks. One optional answer per input column, in order, independent of loaded chunks and previous calls. Height counts from the level top: the Nether returns its roof, not a floor. The top block omits slope rules and may differ even from an undecorated chunk. Trees, ores and other features are absent. Void columns and worlds without their own generator return None. Refuses before reading on a client, for a dimension other than the one being ticked, or for more than
MAX_inputs. One noise sample per column on the server tick; slow calls log the column count when the slow-call threshold is enabled.TERRAIN_ COLUMNS
tick_rate_ is_ frozen - Signature
fn tick_rate_ is_ frozen (&self) -> Option<bool> - Summary
- Whether the server's ticking is frozen (
TickRateManager.isFrozen,/). A frozen server still runs the tickstick freeze /asks for, sotick step server_'stick_ start world_can be true while this is true. None on a client.running
tick_stats - Signature
fn tick_stats (&self) -> (f32, f64) - Summary
- The server's tick rate (20 unless
/changed it) and the milliseconds its ticks took on average lately, astick rate /reports them. The ticks a second it keeps up is the rate, or 1000 / milliseconds when that is lower.tick query
tick_times - Signature
fn tick_times (&self) -> Vec<u64> - Summary
- The last 100 server ticks' durations in nanoseconds, as
MinecraftServer.getTickTimesNanoslays them out: the tick numberednat indexn % 100, 0 where none was recorded yet. Sort a copy for percentiles;tick_has the average.stats
transaction_lifecycle - Signature
fn transaction_lifecycle (&self) -> TransactionLifecycle - Summary
- Where the transaction system is (
Transaction.getLifecycle): none open, one open, a nested one closing, or the outermost closing while the game tells the world of a commit.
world_data_ files - Signature
fn world_data_ files (&self) -> &dyn ConfigFiles - Summary
sunrise-mod-data/, copied, backed up and deleted with that save. Paths omit the mod id. Calls refuse with<mod id>/ NoWorldbefore a save is open; this service never outlives its borrowed world host.
world_dir - Signature
fn world_dir (&self) -> Option<PathBuf> - Summary
- The open world's folder (
world/, beside itslevel.dat): a server mod keeps its data in a folder of its own there, so the world's backups carry it. None when no world is open.
Client (ClientHost)
add_particle - Signature
fn add_particle (&mut self, options: &ParticleOptions, at: [f64; 3], velocity: [f64; 3]) -> bool - Summary
- ClientLevel.addParticle: submits one local particle through the ordinary provider, camera-distance, setting and population limits. False without a loaded client world, for non-finite input or for an item crumb whose colour has a component outside 0 to 1. True means submitted, not necessarily visible. For a registered
ParticleType, passty.options(value); the matching client factory receives the value and original auxiliary inputs before the particle is queued.
add_toast - Signature
fn add_toast (&self, toast: ModToast) -> Result<(), AddToastError> - Summary
- Submit a notification to the window's toast manager. The next toast update offers it to
toast_asadd ToastKind::before inserting or replacing anything. An accepted matching kind restarts the display time in place; a veto leaves any existing toast untouched. Calls fromMod toast_itself wait for the following update. Refuses the whole request if its text or item icon cannot be represented.add
apply_screen_ blur - Signature
fn apply_screen_ blur (&self) -> bool - Summary
- Requests vanilla's menu background blur for this frame, with a per-frame guard so blur is applied at most once per frame. Returns true if blur was newly requested this frame, or false if it was already applied/requested this frame. API @API:screen_transparent_background@.
audio_device - Signature
fn audio_device (&self) -> String - Summary
- The output device the options ask for (
Options.soundDevice).
audio_devices - Signature
fn audio_devices (&self) -> Vec<String> - Summary
- The output devices sound can play on (
SoundEngine.getAvailableSoundDevices).
audio_options - Signature
fn audio_options (&self) -> ClientAudioOptions - Summary
- A snapshot of the current audio preferences.
bake_layer - Signature
fn bake_layer (&self, layer: &str) -> Option<ModelPart> - Summary
- Entity model layer
layerbaked into itsModelParttree, each part at its pose, asEntityModelSet.bakeLayerbakes it: one a native mod registered (register_), or vanilla's, by the namelayer_ definitions entity-models.jsongives it (minecraft:zombie#main,minecraft:player#main). The tree is the caller's own copy: bake it once, as a renderer does, and set its parts' poses each frame. None for a layer neither has. A vanilla layer no mob has (a player's, a chest's) is read from the resources each call, so slow. API @API:model_layers@.
biome_tint - Signature
fn biome_tint (&self, pos: [i32; 3], resolver: ColorResolver) -> Result<u32, LevelReadError> - Summary
- The resolver's blended colour at
posin the current client level, as opaque ARGB. LikeClientLevel.getBlockTint(BiomeColors.getAverageGrassColorand its counterparts), this samples a square at the block's height using the client's biome blend radius and the same biome colours as the mesher, including updates fromSelf::. Userefresh_ biome_ colors ColorResolver::orGrass ColorResolver::without looking up a block state or a model. For a specific block or fluid face, useFoliage Self::. Returnsblock_ tint_ color LevelReadError::outside the World phase or when the host has no client level to read.Unavailable
block_sprites - Signature
fn block_sprites (&self, blocks: &[BlockState]) -> Vec<Option<BlockSprites>> - Summary
- Published asset/data read: available in Setup, Reloading and World. For a client mod: what each resolved block state draws on its six sides, preserving its properties without reparsing names. Resolve states once at load. Each face's sprite (array and layer, as
WorldDrawn::cuts them) and its texture by the nameblock_ sprites cubeandquadtake, where it lies on the side, how its texture runs across it (FaceSprite::draws it on another block's box, turned as its model turns it), its tint source and index (quad_ on block_) and whether it is cut out, translucent or animated; its particle sprite; whether it is a plain cube. None for a block the game does not know. The model is the state's first random variant. API 380.tint_ color
block_sprites_ version - Signature
fn block_sprites_ version (&self) -> u64 - Summary
- Published asset/data read: available in Setup, Reloading and World. For a client mod: changes each time the resources load (a resource pack turned on or off can move every sprite): ask
native_again then. API 380.block_ sprites
block_tint_ color - Signature
fn block_tint_ color (&self, state: BlockState, tint_ index: i32, pos: [i32; 3]) -> Option<u32> - Summary
- For a client mod drawing a block's faces itself (a copycat drawing its material's, from
block_): the 0xRRGGBB colour a face ofsprites statewith tint indextint_(index FaceSprite::) is multiplied by attint_ index pos, as the chunk mesher tints it there (biome blend included). Grass, foliage and water use the client's current biome colours, including updates fromSelf::. A face's own tint source or a pack colormap can give it a different colour. Returnsrefresh_ biome_ colors Nonefor an untinted face (-1, or an index past the state's tints). For a biome colour independent of the face's tint source, useSelf::.biome_ tint
camera- Signature
fn camera (&self) -> Option<Camera>- Summary
- The most recently extracted world frame's camera, if one exists. During GUI rendering this is the current frame, including bob/spin and FOV.
camera_entity - Signature
fn camera_entity (&self) -> Option<EntityRef> - Summary
- The entity the view follows (
Minecraft.getCameraEntity): the entity a server attached the camera to, else the local player. None outside a client world.
camera_type - Signature
fn camera_type (&self) -> CameraType - Summary
- The window's camera type (
Options.getCameraType), including its latest pending request.
chat_line - Signature
fn chat_line (&mut self, line: Text) -> Result<(), TextFormError> - Summary
- Adds
lineto this client's chat HUD and history (vanilla'sChatComponent.addClientSystemMessage): it shows here only, so nothing is sent to the server. The Chat option's server-message filter doesn't hide it (GuiMessageSource.SYSTEM_), andCLIENT client_is not told: vanilla fires that event fromchat_ received ChatListenerfor lines the server sent, not for lines the client adds itself. Returns an error if the text exceeds the boundary's size or nesting limits; rejected text is not added.
chat_options - Signature
fn chat_options (&self) -> ClientChatOptions - Summary
- A snapshot of the current chat preferences.
clear_particles - Signature
fn clear_particles (&self) -> bool - Summary
ParticleEngine.clearParticles: every particle and emitter goes before the next frame is drawn or the next particle tick runs, whichever comes first. It takes&self, so a screen or render hook can ask, as withnative_. False on a server.play_ local_ sound
client_executor - Signature
fn client_executor (&self) -> Option<ClientExecutor> - Summary
- The calling mod's handle for submitting work to the client thread from any thread. Obtain it in
client_and clone it into workers that cannot borrow a host. Returnssetup Nonewhen the client loop is unavailable or closing, on restricted hosts such as the client-sideentity_callback, or after a task from the calling mod panicked in this client session.entering_ section
client_scoreboard - Signature
fn client_scoreboard (&self) -> Result<Option<ClientScoreboard>, TextFormError> - Summary
- What this client has been sent of the scoreboard: the objectives shown in a display slot, with their scores, and every team. None outside a logged-in client world. A text the API cannot hold (nested deeper than 512 component nodes) refuses the whole snapshot with
TextFormError::; nothing is flattened or skipped.TooDeep
client_session - Signature
fn client_session (&self) -> &dyn ClientSession - Summary
- The client_session service.
client_surface_ heights - Signature
fn client_surface_ heights (&self, columns: &[(i32, i32)], heightmap: Heightmap ,) -> Result<Vec<Option<i32>>, String> - Summary
- Each column's height by
heightmapin the world this window shows (LevelReader.getHeight(type, x, z)on a client level): one above the highest block that counts on that map, from the blocks the server has sent, none for a column whose chunk this client does not hold.Err, reading nothing, for no client world (the title screen) or more than 65,536 columns (MAX_).COLUMNS
clipboard_text - Signature
fn clipboard_text (&self) -> Option<String> - Summary
- The clipboard's text (
KeyboardHandler.getClipboard), empty when it holds none, while the game handles a key, mouse or typed-text event: a mod's key or screen hook pasting into its own field. None at any other moment (a tick, a frame, a packet), so no mod reads the clipboard without the player doing something, and None on a server.
clock- Signature
fn clock (&self) -> Option<Clock>- Summary
- The clock of the world this window shows, for client mods: its game time and time of day as the server last sent them (
ClientboundSetTimePacket), advanced each tick between packets; none on the title screen.
close_screen - Signature
fn close_screen (&mut self) -> bool - Summary
- Closes the open screen as its Escape key does: a container screen closes as the player's container close (
ServerboundContainerClosePacketwith the menu's id, then the client menu closed), a pause menu closes to the game, and another screen runs its own close. The sign editor sends its sign update (ServerboundSignUpdatePacket), as Escape does. A book closes with nothing sent; a lectern's book closes its menu (ServerboundContainerClosePacket). A confirmation, a server's pack prompt or a dialog open over another screen is the one that closes. Declining a required pack disconnects rather than returning to the screen underneath. The screen hooks fire as for Escape. The death screen, the code of conduct and a dialog Escape cannot close do not close this way. False when no screen is open (or, outside a world, when it cannot act).
container_click - Signature
fn container_click (&self, request: &ContainerClickRequest ,) -> Result<ServerboundPlayPacket, PacketBuildError> - Summary
- Builds a vanilla container click; it needs the host because the packet carries hashed stacks. Uses this connection's registries and component codecs, refusing components that cannot be encoded or hashed, unrepresentable IDs/slots and more than 128 changed slots. Applies no menu checks or local effects; submit the result with
send_.packet
create_dynamic_ texture - Signature
fn create_dynamic_ texture (&mut self, id: &Identifier, width: u32, height: u32, rgba: &[u8] ,) -> Result<(), DynamicTextureError> - Summary
- Vanilla's
TextureManager.registerof aDynamicTextureunderid, then itsupload: the calling mod's RGBA imageid, in its own namespace (mymod:dynamic/), made frompanel rgba,width * heightpixels of four bytes, row by row from the top left. The image takes a slot of the HUD atlas's dynamic texture pool, of the smallest class (DYNAMIC_) that holds it, andTEXTURE_ CLASSES idnames it as a GUI sprite ofwidthxheightpixels:DrawContext::(sprite srcin the image's own pixels),DrawContext::,gui_ nine_ slice DrawContext::andtiled_ sprite gui_draw and find it as they do any GUI sprite, from the next frame on. It lasts, through resource reloads, untilsprite free_or the game's end.dynamic_ texture
create_fireworks - Signature
fn create_fireworks (&mut self, request: &FireworksRequest) -> bool - Summary
ClientLevel.createFireworks: draws a firework's explosions in this client's world as a bursting rocket draws them (FireworkParticles.Starter): each explosion's shape, colours, fade colours, trail and twinkle, one every other tick. The blast, and the crackle after a twinkling explosion, play only whenrequest.audible, as for a rocket that isn't silent. Only the picture and the sound: no entity, no damage, nothing sent to the server, and other players see nothing (a mod's server half tells each client half to draw it). True means queued; false on a server, without a client player or world, for non-finite input or for more than 256 explosions. API @API:client_fireworks@.
creative_search_ items - Signature
fn creative_search_ items (&mut self) -> Vec<ItemStack> - Summary
- The creative search tab's final display order, for ranking stacks in inventory sorters. This requests the same catalog as the creative screen (using the player's permission and Operator Items Tab option). On a miss it dispatches the creative build hook. During setup, reload, a different build, or without a live catalog, this returns an empty list.
cross_passage - Signature
fn cross_passage (&mut self, passage: PassageId) -> Result<(), PassageCrossError> - Summary
- Moves the window's player through
passage(#3775), one its server told it of, as Immersive Portals' client does: its feet, where it was a tick ago (so the frames between two ticks do not jump), its velocity and its look come out at the far side, turned with the passage, and the server is told the passage and where the feet were. Nothing else of the player changes: on ground, fall distance, sprinting, what it uses. The server checks the move to there as any move, then answers with a position packet that changes nothing (all relative and zero), so the player keeps its velocity; as any position packet does, it stops mining (a passage crossed while mining aborts the dig). A refused crossing puts the player back where the server has it (Self::says why). One crossing at a time: the next waits for the server's answer. Refused, with nothing moved or sent, when not connected to a server, with no player, while riding, for a passage the window does not hold, when the feet are more than 20 blocks from the opening, and when a mod'slast_ passage_ refusal client_cancels the crossing's payload.packet_ send
crosshair_target - Signature
fn crosshair_target (&self) -> Option<CrosshairTarget> - Summary
- The committed
client_result (Minecraft.hitResult), computed at partial tick 1.0 before each tick's inputs, including while paused, and at the frame's partial tick before extraction. Each input reads its tick's result; the highlight reads the frame's result. Reads during dispatch see original. None before the first pick, without a client world or on a miss. Consumption never recasts or rechecks target liveness; a block broken earlier in a tick remains that tick's use target.pick
cursor- Signature
fn cursor (&self) -> [f32; 2]- Summary
- Where the mouse is, in GUI pixels.
debug_overlay_ visible - Signature
fn debug_overlay_ visible (&self) -> bool - Summary
- Whether the client draws its debug overlay this frame. Always-on debug entries can make it visible with F3 off. F1 hides the overlay unless a screen is open.
disconnect- Signature
fn disconnect (&mut self, reason: Option<Text>) -> Result<(), DisconnectError>- Summary
- Leaves the server or the single-player world (NeoForge's
IClientCommonPacketListenerExtension.disconnect(Component)), at the end of this frame, not inside the calling hook. With a reason, the disconnect screen shows it (a single-player world is saved first); with none, it leaves as the pause menu's Disconnect does. The request belongs to the world it was made in: one made while that world closes is dropped, never carried into the next. A second call in the same frame replaces the reason. The retained reason renders in the active language at draw and narration time; literal text stays unchanged.DisconnectError::when no server or world is joined. The reason is local to the client, not encoded into a packet.Unavailable
drop_held - Signature
fn drop_held (&mut self, hold: HoldId) -> Result<(), HoldError> - Summary
dynamic_texture_ budget - Signature
fn dynamic_texture_ budget (&self) -> Result<DynamicTextureBudget, DynamicTextureError> - Summary
- What the calling mod may still create: images and bytes of pixels left of its
DYNAMIC_andTEXTURE_ MOD_ IMAGES DYNAMIC_. These are limits of the atlas pool, which vanilla'sTEXTURE_ MOD_ BYTES TextureManagerdoes not have. A free slot of a class is not part of it: the slots are shared by every mod.Unavailablewhen the atlas has no pool,NotOwnedwhen no mod is calling.
enchantment_min_ cost - Signature
fn enchantment_min_ cost (&self, id: &str, level: u32) -> Option<i32> - Summary
Enchantment.getMinCost(level): the enchanting power needed, or None for an unknown id.
enchantment_supports - Signature
fn enchantment_supports (&self, id: &str, item: ItemKey) -> bool - Summary
- Whether
itemis in enchantmentid'ssupported_(items Enchantment.isSupportedItem). Does not consult Item Part overrides.
enchantments- Signature
fn enchantments (&self) -> Vec<EnchantmentInfo>- Summary
- Registered enchantments in registry order, including selection
weightandanvil_(the base anvil fee per enchantment level). This and the other enchantment reads use the table built from the server's synced entries when available, and the local table otherwise.cost
flame_particle - Signature
fn flame_particle (&mut self, at: [f64; 3], soul: bool) - Summary
- A small local vanilla particle; caller should rate-limit emission.
fluid_name - Signature
fn fluid_name (&self, fluid: &str) -> String - Summary
- Fluid
fluid's name as the lang names it (fluid_, vanilla's by its block), else its path in words.type.<mod>.<name>
free_dynamic_ texture - Signature
fn free_dynamic_ texture (&mut self, id: &Identifier) -> Result<(), DynamicTextureError> - Summary
- Vanilla's
TextureManager.release: frees the calling mod's imageid. The GUI spriteidis gone at once, the slot goes back to the pool for any mod, and the image and its bytes go back to the mod's budget. Refused by name, with nothing changed:Unavailable,NotOwnedfor an id outside the mod's namespace andUnknownfor one that names no image.
give_stack - Signature
fn give_stack (&mut self, stack: &ItemStack) -> Result<Option<ItemStack>, CreativeGiveError> - Summary
- Creative mode only: puts
stack, components and all, into the local player's inventory asInventory.adddoes: onto matching stacks (the selected slot, the off hand, the hotbar, then the main inventory), then into empty slots, up to the stack's effective maximum (minecraft:max_included). Every slot it changed goes to the server at once asstack_ size MultiPlayerGameMode.handleCreativeModeItemAdddoes (ServerboundSetCreativeModeSlotPacket; the off hand is slot 45), even while a container menu is open.Ok(Some(remainder))is what did not fit; nothing is dropped. ACreativeGiveErrorgives nothing (includingFeatureDisabledwhen the connected server does not enable the item's required feature flags).
graphics_options - Signature
fn graphics_options (&self) -> ClientGraphicsOptions - Summary
- A snapshot of the current graphics preferences.
gui_options - Signature
fn gui_options (&self) -> ClientGuiOptions - Summary
- A snapshot of the current GUI and accessibility preferences. Its
gui_is only the option, where 0 means automatic; readscale Self::for the scale the window applies.gui_ scale
gui_scale - Signature
fn gui_scale (&self) -> Option<u32> - Summary
- The GUI scale in effect (
Window.getGuiScale), at least 1; none on a server or when no window exists. Vanilla'sWindow.calculateScaleresolves it from the GUI Scale option and the window size: the option is a maximum (0 = automatic, not a guarantee), and with the Unicode font forced an odd result is raised by one. This read returns the scale the window applies, never a separate recomputation. DivideSelf::by this scale, rounding up, for the GUI-scaled width and height (window_ size Window.getGuiScaledWidth/).Height
gui_sprite - Signature
fn gui_sprite (&self, sprite: &Identifier) -> Option<AtlasRegion> - Summary
- Published asset/data read: available in Setup, Reloading and World. For a client mod: where GUI sprite
spritelies in the GUI atlas and its size, none for one the atlas lacks or whose entry its definition removed (a server's metrics-only atlas lacks them all). The atlas names its sprites by GUI id, the id its definition lists them under:minecraft:container/(also given asslot container/), a mod'sslot mymod:panel; a sprite a registered sprite source made ingui.jsonis found by the id it named, and a live texture (create_) by its own.dynamic_ texture
gui_ticks - Signature
fn gui_ticks (&self) -> i32 - Summary
- The HUD tick counter (
Hud.getGuiTicks): advances once per unpaused client tick, including on the title screen, independently of server tick freeze. Wraps as a Java int.
has_channel - Signature
fn has_channel (&self, id: &PayloadId) -> bool - Summary
- Whether the connected server has channel
idfor the connection's current phase (NeoForge'sICommonPacketListener.hasChannel): the testsend_makes before it queues anything, so true means that send won't returnpayload_ to_ server UnsupportedPeer(it may still refuse the bytes, for their size or under backpressure). False with no connection, for a channel declared for the other phase or direction, and for an optional channel the server did not negotiate.
has_waypoints - Signature
fn has_waypoints (&self) -> bool - Summary
- Whether the server tracks any waypoint for this client (
ClientWaypointManager.hasWaypoints), the waypoints the locator bar draws. The HUD's contextual bar reads the same fact. Which bar the HUD shows is not exposed: vanilla'sHud.nextContextualInfoStateis private.
hold_packets - Signature
fn hold_packets (&mut self) -> Result<HoldId, HoldError> - Summary
- A second hold is refused with Limit while one is active. The limits are 256 packets and 1,048,576 encoded bytes. Overflow ends and flushes the hold oldest first; its next release or drop returns Limit. Network-thread replies (keep-alives, chunk batch acknowledgements, cookies) bypass holds.
hud_mode - Signature
fn hud_mode (&self) -> HudMode - Summary
- Read effective HUD visibility independently of first-person hands.
input_options - Signature
fn input_options (&self) -> ClientInputOptions - Summary
- A snapshot of the current input preferences.
instance_group_ destroy - Signature
fn instance_group_ destroy (&self, group: InstanceGroupRef) -> Result<(), GroupError> - Summary
- Retire retained model copies; use
InstanceGroupRef::.destroy
instance_group_ set_ len - Signature
fn instance_group_ set_ len (&self, group: InstanceGroupRef, len: u32) -> Result<(), GroupError> - Summary
- Set the drawn length; use
InstanceGroupRef::.set_ len
instance_group_ set_ transform - Signature
fn instance_group_ set_ transform (&self, group: InstanceGroupRef, transform: [f32; 12] ,) -> Result<(), GroupError> - Summary
- Replace the group pose; use
InstanceGroupRef::.set_ group_ transform
instance_group_ write - Signature
fn instance_group_ write (&self, group: InstanceGroupRef, first: u32, instances: &[ModelInstance] ,) -> Result<(), GroupError> - Summary
- Atomically overwrite retained model copies; use
InstanceGroupRef::.write
instance_groups - Signature
fn instance_groups (&self) -> &dyn InstanceGroups - Summary
- Persistent model groups.
is_key_ down - Signature
fn is_key_ down (&self, key: &str) -> bool - Summary
- Whether a specific key is currently held down.
keyis the vanilla physical key or mouse button name (key.keyboard.left.shift,key.mouse.left,key.mouse.4, for example). Unknown names are not down. Modifier combinations useClientHost::.modifiers
is_paused - Signature
fn is_paused (&self) -> bool - Summary
- The applied client pause state, not whether a pause screen is open.
item_particle_ options - Signature
fn item_particle_ options (&self, stack: &ItemStack) -> Option<ParticleOptions> - Summary
- Resolve vanilla's
ItemParticleOptionfor this stack using the ground display context and seed 0, exactly like the game's eating particles. Includes every resolved model layer's particle sprite, respecting resource packs and stack component overrides. ReturnsNonefor an invalid stack or unavailable resources/provider. Available in Setup, Reloading and World. Resolve again after a resource reload; this read allocates the sprite list.
item_uses_ block_ light - Signature
fn item_uses_ block_ light (&self, stack: &ItemStack, context: ItemDisplayContext) -> bool - Summary
ItemStackRenderState.usesBlockLightofstack's model resolved forcontext(ItemModelResolver.updateForTopItem, no owner or level): whether the model is lit as a block is, from the side (gui_, vanilla's 3D item models), where a flat item is lit from the front. It is what the 1.21.3light: side BakedModel.isGui3dbecame: a mod uses it to draw a stack as a flat sprite or as a 3D model. False for an empty or invalid stack, and for a model that draws nothing. Reads the model the client resolved from its resource packs.
jumpable_vehicle - Signature
fn jumpable_vehicle (&self) -> Option<EntityRef> - Summary
- The vehicle the local player controls that can jump now (
LocalPlayer.jumpableVehicle): the player is its controlling passenger (getControlledVehicle: the first one, on its saddle) and it can jump (PlayerRideableJumping.canJump): a saddled horse, donkey, mule, nautilus or camel, the camel neither sitting nor getting up or down; a pig or a strider never jumps. The HUD's jump bar makes the same decision. None when the player controls no such vehicle (a second passenger included), or outside a client world.
last_passage_ refusal - Signature
fn last_passage_ refusal (&self) -> Option<(PassageId, PassageCrossRefusal)> - Summary
- The server's refusal of the window's last crossing (
Self::) and the passage it named, until the next crossing; None when it was not refused or no answer came yet.cross_ passage
local_item_ use - Signature
fn local_item_ use (&self) -> Option<ItemUse> - Summary
- The local player's ordinary item use as the client sees it: the hand, ticks used and ticks left (
isUsingItem,getUsedItemHand,getTicksUsingItem,getUseItemRemainingTicks). None when the player uses no item or no client world is open. Does not report input intercepted bycrate::. Sends nothing.ClientItemUseBehavior
local_player - Signature
fn local_player (&self) -> Option<PlayerRef> - Summary
- The local player in a logged-in client world.
menu_blur_ radius - Signature
fn menu_blur_ radius (&self) -> f32 - Summary
- The user's configured menu background blur radius (
menuBackgroundBlurrinessin options.txt, usually 0.0 to 10.0; default 5.0). 0.0 means blur is turned off. API @API:screen_transparent_background@.
microphone_devices - Signature
fn microphone_devices (&self) -> Result<Vec<MicDevice>, MicRefusal> - Summary
- Lists the client's available audio input devices, each with a distinct opaque selector (
MicDevice::) and a human-readable display label (id MicDevice::). Returns an empty list when no input devices exist or client audio capture is disabled. An individual inaccessible endpoint does not hide other available inputs. On macOS, listing does not request microphone permission.label
millis- Signature
fn millis (&self) -> u64- Summary
- Milliseconds on the game's own clock (
Util.getMillis), counting from the game's start: what a text field's cursor blinks by and what tells a double click from two clicks. Only differences between two readings mean anything.
mod_key_ mapping - Signature
fn mod_key_ mapping (&self, owner: &str, id: &str) -> Result<ModKeyMappingRef, ModKeyRefusal> - Summary
- Resolve
owner's registered mappingidonce after registration, usually inclient_. Keep the handle for subsequent calls; save the owner and id, not the handle. Any mod can resolve, read, rebind or reset any registered mapping. Returnssetup ModKeyRefusal::for an unknown owner or id andNotRegistered ModKeyRefusal::when there is no client backend in this host.Unavailable
mod_screen - Signature
fn mod_screen (&self) -> Option<&str> - Summary
- The mod whose own screen is currently open, if one is (Escape, or another screen replacing it, closes it). This is a live query for the screen open right now; inside
screen_orclosing screen_hooks, read*_ post event.screen.mod_to identify the screen that received the event even after a synchronous replacement or close.screen
mod_screen_ close - Signature
fn mod_screen_ close (&mut self, mod_ id: &str) - Summary
- Closes mod
mod_'s own screen, if it is open.id
mod_screen_ open - Signature
fn mod_screen_ open (&mut self, mod_ id: &str) -> bool - Summary
- Opens a screen of mod
mod_'s own through the normal screen-transition path (id Gui.setScreen):screen_andopening screen_fire for the transition andclosing screen_runs once it opens, so the mod mounts widgets ininit_ post screen_, draws ininit_ post screen_, and takes its clicks, scroll, keys, and typing there; the mouse is freed, and Escape closes it. Every mod's own screen has therender_ post ScreenView.idmodand setsScreenView.mod_to its owning mod id, so a mod's screen hooks checkscreen event.screen.mod_(or livescreen == Some("my_ mod") mod_to query the currently open screen). It doesn't pause a single-player game (as the inventory doesn't). Can replace any open vanilla screen, title screen, overlay (book, sign editor, dialog, or prompt), or another mod's screen, running the replaced screen's close cleanup once hooks allow the transition. Replacing a server-pack prompt leaves the server's request unanswered, as in vanillascreen() Gui.setScreen. Returnstruewhenmod_'s screen is open, andid falsewhen cancelled or redirected byscreen_, while a world or connection is loading, or without a client window (a headless/dedicated server, the server thread, or guest-acting contexts). A gamepad can close it (B, Start) and activate focused mounted controls. That activation does not dispatch screen mouse hooks.opening
modifiers- Signature
fn modifiers (&self) -> ClientModifiers- Summary
- The current window modifier keys in the same GLFW encoding as input hooks. Cleared when the window loses focus; available even outside a world.
move_local_ player_ by - Signature
fn move_local_ player_ by (&mut self, delta: [f64; 3] ,) -> Result<Option<[f64; 3]>, LevelWriteError> - Summary
- Moves the local player by
deltain blocks, asEntity.move(MoverType.SELF, delta). The move uses the player's usual collisions and step height, and updates its ground and fall state, including the usual effects of collisions and blocks on velocity. Available to client hooks with world access. For per-tick movement call from the local player's client-sideplayer_, before its own movement. This sends no packet and fires notick_ pre entity_hook (that hook is server-only). A section change is reported throughmove entity_at the position write, before the move updates collision flags, ground, fall distance and velocity. The normal position report carries the movement and ground flag, and the server checks the report as usual. Returns the displacement actually made, orentering_ section Ok(None)without moving if there is no local player, the player is dead, sleeping or riding, or a component is non-finite or outside ±64 blocks.Err(LevelWriteError::means the call is outside a world phase or the engine couldn't finish the move.Unavailable)
muffle_sounds - Signature
fn muffle_sounds (&mut self, amount: f32, lowpass: f32, ticks: u32, exempt: &[& str]) -> bool - Summary
- Muffles the game's sounds for a while, as ears ringing after a close blast hear them:
amount(0 to 1) of every sound's volume is taken away andlowpass(0 to 1) dulls it, from untouched to a 300 Hz low-pass. Both start in full and fade back in a straight line overticksclient ticks, held while the game is paused. The sound events inexempt(mymod:ear.ringing) play clearly through it, those already playing too, so the mod's own ringing stays sharp. Everything else is muffled, music and the interface's clicks included. A new call replaces the muffle in place;ticks0 ends it at once. Nothing changes while no mod calls it. False, with nothing changed, on a server, for an amount or strength outside 0 to 1, or for an exempt event that isn'tnamespace:pathor more than 64 of them. API @API:muffle_sounds@.
narrate- Signature
fn narrate (&mut self, text: &Text, when: Narration) -> Result<(), NarrateError>- Summary
- Has the narrator say
textas a system message, through the sameGameNarratorthe game's own narration uses:Narration::isNow saySystemNow(cuts off what is being said),Narration::isQueued saySystemQueued. The player's Narrator option, the voice volume and the narrator's log of recent lines apply as to vanilla's lines. The text is the component's plain string (Component.getString) in the current language, bounded only by the component's own form limits. Nothing reaches the server. Refused with nothing said, by name, asNarrateErrorlists: an empty line, the option Off or Chat only, or no speech. Available from client setup onward.
observed_screen_ id - Signature
fn observed_screen_ id (&self) -> Option<ScreenId> - Summary
- The same screen identifier provided to screen hooks.
open_audio_ stream - Signature
fn open_audio_ stream (&self, _ spec: &StreamSpec, _ source: Box<dyn AudioStream> ,) -> Result<AudioStreamRef, AudioRefusal> - Summary
- Gives the mixer a native source of interleaved signed 16-bit PCM, like NeoForge's
SoundInstance.getStream. The mixer takes ownership and callsAudioStream::serially on the output's shared worker as it needs frames, with noread Hostor world borrow. The device callback requests PCM but never calls or waits for the source. Returning0signals EOF so already-queued frames drain before playback stops; returnn > 0without writing to the zeroed buffer for temporary silence. An async or network producer bridges through its own nonblocking buffer insideAudioStream::.read
open_chat - Signature
fn open_chat (&mut self, text: &str) -> Result<(), String> - Summary
- Opens the chat screen with
texttyped in for the player to finish and send, as T and / open it; nothing is sent. Returns an error with no player in a world or while another screen is open.
open_inventory - Signature
fn open_inventory (&mut self) -> bool - Summary
- Opens the player's inventory as the inventory key does: locally, with no packet (the player menu is always open on the server). Riding a vehicle with its own inventory sends the open-inventory player command (
ServerboundPlayerCommandPacket), as the key does. False with a screen already open, for a spectator, in a portal transition, or with no world.
open_microphone - Signature
fn open_microphone (&self, _ spec: &MicSpec) -> Result<MicRef, MicRefusal> - Summary
- Opens live PCM capture from the system default or selected input device directly on the client. Returns a client-local
MicRefreadable from any thread off the OS audio callback:MicRef::writes only validated whole interleaved signed 16-bit PCM frames from a boundedread MIC_ms ring that drops the oldest frames on overflow, leaving any unreturned suffix untouched and returningRING_ MAX_ MS 0immediately on concurrent reader contention. CallingMicRef::or dropping the handle stops capture and waits for the stream's teardown thread to release the OS input device before returning; a backend device error also releases the OS stream promptly without waiting forclose close, drop, or a tick. The engine never records or transmits captured audio. On macOS, opening a matching input can wait for the operating system's first microphone permission decision, before probing the input configuration. A label matching only an output does not request microphone permission.
panel_items - Signature
fn panel_items (&mut self, mod_ id: &str, items: Vec<Stack>) - Summary
- Shows the panel beside container screens with these items (at most 8192), as the game's own slots in pages, with a search box; the player's clicks, searches and keys over items, and items dragged off the panel onto the screen (
PanelEvent::), come back asDropped panel_. The panel is the last mod's to show one; empty items and no recipe page take yours away.event
panel_recipes - Signature
fn panel_recipes (&mut self, mod_ id: &str, page: Option<RecipePage>) - Summary
- Shows
pagein modmod_'s item panel instead of its items, drawn by the game with its own slots (id RecipePage,RecipeView): a title and a back button, tabs, and the recipes paged to the panel's height.None, or a page without recipes, shows the items again. The renderer's limits are cut, never refused: 256 recipes and 16 tabs a page, 27 slots, 4 results and 8 fluids each way a recipe, 64 stacks a slot. The same title and tab again keep the page the player turned to. Clicks on its slots, actions, page turns, the back button and tabs come back aspanel_.event
panel_search - Signature
fn panel_search (&mut self, mod_ id: &str, text: &str) - Summary
- Sets the text in mod
mod_'s item panel search box (id panel_), called by the panel's owner itself:items mod_must be the mod whose hook or part is making the call and whose panel is showing; any other call changes nothing, so one mod can't rewrite another's search (another mod asks the owner, through the owner's published integration). The text, cut to the box's 50 characters counted in UTF-16 code units as vanilla's box counts them, goes into the box the next time the owner's panel draws its box, never during this call: the box's value is replaced, the cursor goes to its end, the panel goes back to its first page, and the owner hearsid panel_event Search(text), the event the player's typing sends. No keystrokes are simulated. A later call before that replaces an earlier one; the player editing the box first, or another mod taking the panel, drops it; text the box already holds changes nothing, its cursor and selection included. Set while no container screen is open, it waits for the panel to appear. A viewerjeiclearing its own box callshost.panel_from one of its hooks. JEI'ssearch("jei", "") IIngredientFilter.setFilterText.
panel_style - Signature
fn panel_style (&mut self, mod_ id: &str, style: PanelStyle) - Summary
- How mod
mod_'s item panel (id panel_) looks from now on:items PanelStyle::(the default: the recipe book's page arrows and a plain search box),RecipeBook PanelStyle::(square page buttons on a bar over the items and the viewer's search box, as Sunrise's Recipes panel draws them) orViewer PanelStyle::(JEI's list on Minecraft 1.12: flush right under page buttons that always show and wrap around, the search box at the foot of the screen with a settings button that opens the mod's page in Options > Mods). The viewer's look changes only the drawing; the classic one also lays the panel out. Kept for the session, whether or not the panel is showing.Classic
particle_count - Signature
fn particle_count (&self) -> u32 - Summary
- The particles alive in the client's level (
ParticleEngine.countParticles): 0 once a clear is asked, and on a server.
place_recipe - Signature
fn place_recipe (&mut self, book_ id: i32, all: bool) -> Result<(), String> - Summary
- Places a recipe in the open screen's grid as a click in the recipe book does (
ServerboundPlaceRecipePacket): the inventory's grid or a crafting table's.allplaces as many as the items allow, as with Shift. Refused while no such screen is open and for a recipe the player's book doesn't hold; one missing items shows as a ghost.
play_local_ sound - Signature
fn play_local_ sound (&self, sound: &SoundPlay, after: u32) -> Option<SoundRef> - Summary
- Plays
soundfor this player only (SoundPlay's event:minecraft:ui.button.click, or a mod's own from itsassets/): nothing is sent to the server, and other players don't hear it. It takes<id>/ sounds.json &self, so a screen, key or mouse hook can play one: the sound is queued and starts at the next audio update (once a client tick),afterticks counted from then (0 to 1200, a minute;SoundEngine.playDelayed).SoundPlay::plays it at the listener as an interface sound (ui SimpleSoundInstance.forUI);SoundPlay::at a position in the client's level, fading with distance (at volumepast 1 carries farther, 16 blocks times the volume), as thunder heard after the flash or a blast heard when its shock wave arrives. ItsSoundReffollows and controls this play:state,stopandfade. None, with nothing played, on a server or for a value out of range (SoundPlay::included, byeffects SoundEffects::); an event the resources don't have plays nothing, as vanilla's, and its handle readsvalid Stoppedonce the update has tried it. Its effects stay as given unless the sound ticks: aplay_listener can change them on each live refresh.sound
playing- Signature
fn playing (&self) -> bool- Summary
- Playing, with nothing over the world: keys and zoom apply.
potions- Signature
fn potions (&self) -> Vec<PotionInfo>- Summary
- Registered potions (
Registries.POTION), in registry order, each by its registry id: vanilla's 46, fromminecraft:watertominecraft:infested(content mods cannot declare potions yet). The game builds the list once; each call copies it. A mod builds the potion, splash, lingering or tipped-arrow stack itself with theminecraft:potion_component.contents
preset_editor_ dimensions - Signature
fn preset_editor_ dimensions (&self) -> Option<Compound> - Summary
- A copy of the open
world_screen's working dimension stems. Stays available to screen hooks whilepreset_ editor world_is open alongside the boundpreset_ editor PresetEditor.
project- Signature
fn project (&self, at: [f64; 3]) -> Option<[f32; 3]>- Summary
- World point
atprojected on this frame's screen (GameRenderer.projectPointToScreen): normalised device x and y, -1 to 1 across the screen (x to the right, y up), and depth z (reversed: nearer is larger). The view is the camera's rotation without bob or spin, as vanilla's. Unlike vanilla, None for a point behind the camera or a non-finiteat; also None outside a world, before extraction, and between render frames. Supported during GUI, screen and world drawing after camera extraction. In GUI pixels of aDrawContextof size[w, h]:((x + 1) /.2 * w, (1 - y) / 2 * h)
push_player - Signature
fn push_player (&mut self, kick: [f32; 3]) - Summary
- For a client mod: a push added to the local player's velocity, in blocks a tick, as an explosion's knockback is (the window's player moves itself, as vanilla's client does). Each component is clamped to -4..4; a spectator, or a value that is not a number, is left alone.
raycast- Signature
fn raycast (&self, distance: f32) -> Option<Hit>- Summary
- The first block along the view within
distance(at most 1024), in loaded chunks only;Noneon a miss.
recipe_book_ ids - Signature
fn recipe_book_ ids (&mut self, recipe_ id: &str) -> Arc<[i32]> - Summary
- The
book_s of the recipeid recipe_(id minecraft:stick), the idstransfer_,recipe place_andrecipe known_use: one for each way the recipe book shows it, in the book's order. For a recipe viewer, which has the recipe fromrecipes recipes_. A server numbers its recipes itself and names none of them, so an id is given only when the server sent the recipe book entry with that number and this client's own numbering of the recipe agrees with it: the entry is the same recipe (the same result, category and ingredients), so two different recipes with identical displays cannot be told apart. Empty otherwise: a recipe the server sent no entry for (the player's book does not hold it, or it was removed), one the server numbers differently, one the book doesn't show (campfire, stonecutting, smithing, a mod's own type), an unknown id, and outside a world. The answer changes when the server adds, replaces or removes entries and when recipes reload or arrive, and no hook announces a recipe book change: query it when you use it, rather than keeping an answer fromof_ type recipes_.received
refresh_biome_ colors - Signature
fn refresh_biome_ colors (&mut self) - Summary
- Asks
biome_again for every biome and, when the colours differ from those in use, rebuilds every loaded section and the far terrain with them (colors LevelRenderer.allChanged, as changing Biome Blend does). Call it when your colours change (a new season, a new day of a slow fade) and once when the player joins, not every frame: a rebuild takes the workers a few seconds.
refresh_render_ visibility - Signature
fn refresh_render_ visibility (&mut self) - Summary
- Asks
block_again for every state and, when the answers differ from those in use, remeshes every loaded section with them. While a mod listens torender_ visibility section_, rebuilds meshes in the player's current level and asks about them again, except for a first all-air compile with no section geometry contributors. Other viewed levels do not call that hook; no NeoForge counterpart has been verified. Call it when a decision changes (a toggle key, a scan finishing), not every frame. With no part answering or listener, the mesher keeps its no-mod path.visibility
release_held - Signature
fn release_held (&mut self, hold: HoldId) -> Result<usize, HoldError> - Summary
- Send reports the number published and the remaining packets are dropped. Disconnect, protocol changes and aborted travel invalidate the id.
render_assets - Signature
fn render_assets (&self) -> &dyn RenderAssets - Summary
- The render_assets service.
request_client_ quit - Signature
fn request_client_ quit (&self) -> bool - Summary
- Ask the local client to quit, even from the title screen without a world open. The client uses the normal Quit Game path after the calling hook returns, disconnecting from any server and waiting for an integrated server to save and release its world lock before exiting. This is not a server operation. Returns
trueif the request was recorded, not if shutdown succeeded; returnsfalseif there is no live client or a quit is pending or underway.
screen_exclusion - Signature
fn screen_exclusion (&self) -> Vec<[f32; 4]> - Summary
- Where the open screen draws outside its
rect, and where mods draw over it: the recipe book's panel, the creative tab rows, the active effects beside the inventory, then whateverscreen_adds. Each isexclusion_ areas [x, y, width, height]in GUI pixels; an empty or non-finite one is dropped. A mod that lays out its own panels (a recipe viewer) keeps them clear of these. Client-side; empty with no screen up.
screen_hovered_ stack - Signature
fn screen_hovered_ stack (&self) -> Option<ItemStack> - Summary
- The full stack in the slot under the pointer on the open container or creative screen (
AbstractContainerScreen.getHoveredSlot().getItem()), including creative catalog display slots;Noneover no slot, an empty slot, or with no container or creative screen open.
screen_pos - Signature
fn screen_pos (&self) -> Option<[i32; 3]> - Summary
- The position of the currently shown mod menu opening. Use
crate::while constructing its screen instead. An explicit absent position from the server staysMenuScreenOpen:: pos None.
screen_slot - Signature
fn screen_slot (&self, menu: &str, slot: usize) -> Option<[f32; 2]> - Summary
- Where the shown mod menu screen for
menuputs backing slotslotfrom the next frame (Slot.x,Slot.yin GUI pixels from the screen's top left, the item's top left corner): whereset_last put it, else where the screen declared it. None for an inactive/hidden slot, another menu type's screen, or no shown mod screen.screen_ slot
screen_title - Signature
fn screen_title (&self) -> Option<String> - Summary
- The open menu's title (the block's name, or the one it was given), as plain text.
select_hotbar_ slot - Signature
fn select_hotbar_ slot (&mut self, slot: u8) -> Result<(), HotbarSlotError> - Summary
- For a client mod: chooses the local player's hotbar slot,
slot(0 to 8), asInventory.setSelectedSlotdoes for a number key. It sends nothing itself: the game sends the carried-item packet at the next tick's start at the latest, and before the packets of an attack, a use, an interact, a release, a drop and a continued block break (not before a block break start). Refused above 8 withOutOfRange, without a client world withNoWorld, and for a spectator withRefused(its number keys open the spectator menu), leaving the selection as it was.
send_chat - Signature
fn send_chat (&mut self, message: &str) -> Result<(), String> - Summary
- A mod's chat line or command (
/first), sent assend_sends it (ClientPacketListener.sendChat / sendCommand), to any server: no chat history, and no client chat event (vanilla'schat ClientChatEventcomes only from ChatScreen). An error when the player isn't in a server's play state or the Chat option blocks the message. API 404.
send_packet - Signature
fn send_packet (&mut self, packet: ServerboundPlayPacket) -> Result<(), SendPacketError> - Summary
- Submits a vanilla play packet to any server, including unrelated plugin payloads. The body is validated once and outgoing credit is reserved before acceptance. Publication waits for the current root transaction to commit; rollback, disconnect, or a protocol incarnation change cancels it. Registered and engine-reserved channels are refused: use their payload or service API. Unrelated plugin bodies retain vanilla's discard-codec limit. No effects are applied locally. Typed packet builders validate wire fields; sequence numbers and required client state remain the mod's responsibility. Chat and commands use
send_, which owns signing. API 409.chat
send_payload_ to_ server - Signature
fn send_payload_ to_ server (&mut self, id: &PayloadId, bytes: PayloadBytes ,) -> Result<PayloadAccepted, PayloadSendError> - Summary
- Queue exact application bytes to the connected server, using the frozen declaration for its current protocol. Optional absent channels return UnsupportedPeer. Frame refusal and Backpressure write no application bytes. The root transaction owns publication and cancellation.
set_block_ extra_ models - Signature
fn set_block_ extra_ models (&mut self, pos: [i32; 3], models: &[ModelRef] ,) -> Result<(), BlockExtraModelsError> - Summary
- The standalone models (resolved with
RenderAssets::) drawn as part of the block atmodel posin this client's level, as NeoForge'sModelDatalets a block's model choose parts at run time without a block state for each choice: a cable's per-side channel counts. The chunk mesher draws them after the block's own models, unturned from the block's lower north-west corner (with its offset), in the block's own light and tints. Each quad takes its render layer as a block's would (cut out, translucent), and a face with a cull direction is culled by the neighbour there as the block's own faces are. On air they draw nothing.
set_camera_ entity - Signature
fn set_camera_ entity (&mut self, entity: EntityRef) -> bool - Summary
- Points the view at
entity(Minecraft.setCameraEntity), as a server's camera packet does; the local player's own ref puts it back. True when the view now follows it; false, with nothing changed, for a stale ref, an entity this window is not shown, or one the camera cannot follow (only the local player and mobs). While the view is off the player, the player sends no moves (LocalPlayer.isControlledCamera). When the camera entity is removed, the view returns to the local player. A mod can also release the view by calling this with the player's ref; this client-only selection does not notify the server.
set_camera_ type - Signature
fn set_camera_ type (&self, camera_ type: CameraType) - Summary
- Request the window's camera type without cycling, also from shared-host callbacks. The last request wins and
Self::reports it immediately. Requests before or duringcamera_ type camera_apply to that frame's camera, FOV and spectator post effects; later requests apply at the next frame's camera extraction. Explicit pose overrides remain unchanged when vanilla placement is refreshed. No cycle hook is emitted.pose
set_clipboard_ text - Signature
fn set_clipboard_ text (&self, text: &str) -> bool - Summary
- Puts
texton the clipboard (KeyboardHandler.setClipboard) on the same terms asnative_reads it. False, with nothing copied, at any other moment or on a server; empty text copies nothing, as vanilla's.clipboard_ text
set_collision_ exclusions - Signature
fn set_collision_ exclusions (&mut self, boxes: &[[f64; 6]] ,) -> Result<(), CollisionExclusionsError> - Summary
- For a client mod: the local player's collision exclusions, the client half of
EntityRef::, with the same boxes, rules and refusals (a client with no player of its own answersset_ collision_ exclusions Stale). The client moves its player itself, so a mod sets the same boxes on both sides: the engine sends neither set to the other.
set_hud_ mode - Signature
fn set_hud_ mode (&mut self, mode: HudMode) - Summary
- Select HUD and hand visibility, including after vanilla F1 input handling. Other first-person hand restrictions and render cancellation still apply. This does not change the player's F1 preference for mandatory mod-error diagnostics.
set_local_ player_ on_ ground - Signature
fn set_local_ player_ on_ ground (&mut self, on_ ground: bool) -> bool - Summary
- For a client mod: sets the local player's on-ground flag. Write it from
player_: this tick's jump decision reads it, and the move that follows sets it again from the collision, so the report to the server carries the flag the move left.tick_ pre false, and nothing changes, with no player of its own.
set_local_ player_ velocity - Signature
fn set_local_ player_ velocity (&mut self, velocity: [f64; 3]) -> bool - Summary
- For a client mod: sets the local player's velocity (
Entity.setDeltaMovement), in blocks per tick. Write it fromplayer_: the tick's own move then integrates it, and the position report the move produces is checked by the server as any report is, so a velocity the server's speed test or collision check refuses is corrected there. The write replaces the velocity outright, as the client's handling of a motion packet does, and nothing is sent.tick_ pre false, and nothing changes, with no player of its own and for a value that is not finite.
set_local_ rotation - Signature
fn set_local_ rotation (&mut self, yaw: f32, pitch: f32) -> Result<(), LocalRotationError> - Summary
- Turns the local player's view to
yawandpitch(degrees), assetYRotandsetXRotstore them: yaw as given (not wrapped; the server wraps it), pitch% 360then clamped to -90..90. The previous-frame angles move by the same amount, asEntity.turndoes for the mouse, so the view doesn't jump for a frame. Sends no packet: the game's own player sync of this client tick sends the look in its one move packet, only while the camera is the player (the rotation-only packet when riding); a call after that step goes out the next tick.NotFinite, changing nothing, for a NaN or infinite value;NoWorldoutside a client world.
set_overlay_ message - Signature
fn set_overlay_ message (&mut self, line: Text, animate_ color: bool) -> Result<(), TextFormError> - Summary
- Shows
lineover this window's hotbar (the action bar), asHud.setOverlayMessagedoes: it replaces the current line, empty text included, and restarts the stock overlay timer and fade (Hud.tick,Hud.extractOverlayMessage).animate_cycles the colour as a jukebox's "Now Playing" line does. One slot: a server's action-bar packet or a jukebox message replaces a mod's line, and a mod's line replaces theirs. Nothing joins chat or its history, no chat event fires, nothing is narrated and nothing is sent. Text the boundary refuses is an error and the previous line stays.color
set_preset_ editor_ dimensions - Signature
fn set_preset_ editor_ dimensions (&self, dimensions: Compound) -> bool - Summary
- Replace the open
world_screen's working dimension stems. Requires an overworld, valid dimension ids and type/generator declarations. Returns false outsidepreset_ editor world_or for malformed data; Done commits, Cancel and Escape discard the copy. Stays available to screen hooks alongsidepreset_ editor PresetEditorDraft::.set_ dimensions
set_screen_ slot - Signature
fn set_screen_ slot (&self, menu: &str, slot: usize, pos: Option<[f32; 2]> ,) -> Result<(), ScreenSlotRefusal> - Summary
- Moves container slot
slotof the open screen of mod menu typemenutopos, or deactivates/hides it with None, as a Java screen that lays its slots out again setsSlot.x/Slot.yor togglesSlot.isActive()(Tinkers' station layouts).slotindexesMenuScreenLayout::(including slots declaredslots Noneat open, which start inactive and may be activated later withSome([x, y])). From the next frame the slot is a vanilla slot at that position: the hovered slot (the 18 by 18 box around it), its highlight, its contents, its empty-slot icon and the recipe book's ghost items; a hidden one is none of these. A position outside the image is allowed. The change lasts for this opening; a replacement starts from the declared layout, even if it reuses the same window id. Any mod may read, move, activate or hide slots of the open screen formenu. This is client-only: a locally hidden slot keeps its item and a shift-click may still fill it. It takes&self, so a screen callback may call it every frame; repeating a slot's current place changes nothing and costs no layout work. EachScreenSlotRefusalleaves the layout unchanged.
setting_bool - Signature
fn setting_bool (&self, key: &str) -> Option<bool> - Summary
- The calling mod's toggle
key(Registrar::): the player's choice, else its default. None when the mod registered no toggle by that key.register_ setting
setting_choice - Signature
fn setting_choice (&self, key: &str) -> Option<u32> - Summary
- The index of the option the player picked for the calling mod's choice
key, else its default. None when the mod registered no choice by that key.
setting_color - Signature
fn setting_color (&self, key: &str) -> Option<u32> - Summary
- The calling mod's colour
key,0xRRGGBB: the player's choice, else its default. None when the mod registered no colour by that key.
setting_f64 - Signature
fn setting_f64 (&self, key: &str) -> Option<f64> - Summary
- The calling mod's range
key: the player's value, else its default; a kept value outside the range reads as the default. None when the mod registered no range by that key.
sign_editor - Signature
fn sign_editor (&self) -> Option<SignEditView> - Summary
- The sign the sign editor is on, its block position and side; None when no sign editor is open or outside a world.
sound_events - Signature
fn sound_events (&self) -> Vec<Identifier> - Summary
- Every sound event the client's resources have (
SoundManager.getAvailableSounds).
text_split - Signature
fn text_split (&self, text: &Text, width: i32) -> Vec<Text> - Summary
Font.split(FormattedText, width): wrap a component atwidthunscaled GUI pixels. Lines retain styles, resolve the current language and use the same active font as tooltip layout. Newlines force breaks; a width below one follows vanilla's one-pixel minimum, without rejecting input. Available outside drawing. In-memory text reads do not enforce the 512-node serialization depth cap orExtraCodecsprofile/property bounds.
text_visual_ order - Signature
fn text_visual_ order (&self, text: &Text) -> Vec<VisualTextCharacter> - Summary
Component.getVisualOrderText(): current-language, styled characters in visual order, including bidi shaping and mirroring. Available outside drawing, including client setup. Sink indices are UTF-16 offsets within the current directional and effective-style run, not within the input component tree. Independently set equal styles do not restart a run. Custom click IDs compare by namespace and path for grouping, without rewriting each character's returned click event. A resolved color is returned as uppercase#RRGGBB. Action keybinds resolve to their assigned keys as intext_. In-memory text reads do not enforce the 512-node serialization depth cap orstring ExtraCodecsprofile/property bounds. No NeoForge hook counterpart is documented.
text_width - Signature
fn text_width (&self, text: &Text) -> i32 - Summary
Font.width(FormattedText): the width of a component in unscaled GUI pixels, using the current language, styles and resource-pack fonts. Available outside a draw, including client setup and tooltip-component sizing. LikeClientTooltipComponent.getWidth(Font), this measures with the rendering client's active font, not a font chosen by the mod. Build aTextcomponent directly and lend it to this read. In-memory text reads do not enforce the 512-node serialization depth cap orExtraCodecsprofile/property bounds.
texture_sprites - Signature
fn texture_sprites (&self, textures: &[& str]) -> Vec<Option<SpriteRef>> - Summary
- Published asset/data read: available in Setup, Reloading and World. For a client mod: each texture's sprite by name (
minecraft:block/,stone block/) in the blocks atlas, none for one it lacks. The blocks atlas holds the sprites block models name and every sprite a mod's sprite source made in it, though no model names it; a sprite only the items atlas lists is not in it. API 380.stone
transfer_recipe - Signature
fn transfer_recipe (&mut self, book_ id: i32) - Summary
- Move available ingredients for a viewer recipe into the open crafting grid, without requiring the recipe to be learned. The screen shows any refusal.
transfer_recipe_ check - Signature
fn transfer_recipe_ check (&mut self, recipe: &str) -> Option<RecipeTransferCheck> - Summary
- What
transfer_would do now for the recipe with idrecipe_ id(recipe, false) recipe(minecraft:stick), worked out by the server without moving anything: the open mod menu'smenu_part asked first, then the grid, with the player's inventory, the grid and every container a mod lends the grid's recipes (a crafting station's chests, which the client can't see) counted. Any recipe the server knows, whether or not the player's recipe book holds it. For a viewer's "+", to mark the inputs it lacks (transfer missing_) and, for a mod menu whose part names them, the ones it could craft (cells craftable_). The first call for a recipe asks and returns None; the answer comes a moment later and is kept for that recipe while the menu, the inventory and the grid stay as they were. On a remote server, while the answer is wanted, the client asks again once the cached answer is one second old. None outside a screen that takescells transfer_and on a server that doesn't answer it.recipe_ id
transfer_recipe_ id - Signature
fn transfer_recipe_ id (&mut self, recipe: &str, max: bool) - Summary
- A viewer's "+" for a recipe by its id, into the open menu: a machine's mod menu as well as a crafting grid. The server asks the
menu_part of the open mod menu's type first, then makes the game's own grid transfer; the screen shows the result as fortransfer transfer_.recipe maxmoves as many sets as the items allow (Shift). Shown asNotIntoMenuwith no container screen open, in spectator mode, and on a server that doesn't take viewer transfers. In a solo world or on a LAN host the game is the server: its own player's transfer takes the same path, part first, then the grid.
translate- Signature
fn translate (&self, key: &str) -> Option<String>- Summary
- The selected language's text for a translation key (
Component.translatable's lookup),Nonewhen no language layer defines it.
update_dynamic_ texture - Signature
fn update_dynamic_ texture (&mut self, id: &Identifier, width: u32, height: u32, rgba: &[u8] ,) -> Result<(), DynamicTextureError> - Summary
- Vanilla's
DynamicTexture.uploadof new pixels: the calling mod's imageidtakesrgba,width * heightpixels of four bytes, written into the atlas slot it already holds from the next frame on. The size may change within the image's class; the spriteidtakes the new size. Each update is one copy into the kept pixels and one upload of the image, so send one when the image changed, not every frame.
vanilla_key_ mapping - Signature
fn vanilla_key_ mapping (&self, name: &str) -> Result<VanillaKeyMappingRef, MappingError> - Summary
- Resolve a vanilla mapping name such as
key.jump, not a binding name such askey.keyboard.space. Keep the handle for subsequent reads and writes. An unknown name returnsMappingError::; a host or phase without client input returnsUnknown MappingError::.Unavailable
view_hit - Signature
fn view_hit (&self) -> Option<(f32, Hit)> - Summary
- The first block along the view within 1024 blocks, in loaded chunks only, and its distance;
Noneon a miss.
window_focused - Signature
fn window_focused (&self) -> bool - Summary
- The last window focus state reported by the window system.
window_size - Signature
fn window_size (&self) -> Option<[u32; 2]> - Summary
- The window's width and height in framebuffer pixels (
Window.getWidthandWindow.getHeight), whatever the GUI scale; none on a server or when no window exists. Readable at any time:window_reports this same size, so the two always agree.resize
Edit this page on GitHub · Spotted something wrong? Open an issue or ask on Discord.



