Skip to content

Mixin targets

Generated from client/clight/idl/mixins.idl by tools/clight_gen/mixins_gen.py. Do not edit.

Target Returns Args Points, values, calls Context Side Since Flags Vanilla
entity.living.hurt bool source: damage_source, amount!: f32 point after_blocking<br>value invulnerability_ticks<br>value knockback_strength<br>point before_knockback<br>point before_death TICK server 1.5 cancellable, invokable LivingEntity#hurtServer
entity.living.actually_hurt void source: damage_source, amount!: f32 value after_armor<br>value after_magic TICK server 1.5 cancellable LivingEntity#actuallyHurt
entity.living.damage_after_armor f32 source: damage_source, amount: f32 TICK server 1.5 LivingEntity#getDamageAfterArmorAbsorb
entity.living.damage_after_magic f32 source: damage_source, amount: f32 TICK server 1.5 LivingEntity#getDamageAfterMagicAbsorb
entity.living.heal void amount!: f32 TICK server 1.5 cancellable, invokable LivingEntity#heal
entity.living.check_totem bool source: damage_source TICK server 1.5 cancellable LivingEntity#checkTotemDeathProtection
entity.living.die void source: damage_source TICK server 1.5 cancellable LivingEntity#die
entity.living.knockback void strength!: f64, dx!: f64, dz!: f64 TICK server 1.5 cancellable, invokable LivingEntity#knockback
entity.living.cause_fall_damage bool distance!: f64, multiplier!: f64 value safe_distance TICK server 1.5 cancellable LivingEntity#causeFallDamage
entity.living.add_effect bool effect: ident, amplifier!: i32, duration!: i32, ambient: bool, visible: bool TICK server 1.5 cancellable LivingEntity#addEffect
entity.living.tick_effects void TICK server 1.5 cancellable LivingEntity#tickEffects
entity.living.tick void TICK server 1.5 LivingEntity#tick
entity.mob.ai_step void TICK server 1.5 cancellable Mob#aiStep
entity.living.travel void strafe!: f32, vertical!: f32, forward!: f32 TICK both 1.5 cancellable, predicted LivingEntity#travel
entity.living.jump_power f32 TICK both 1.5 predicted LivingEntity#getJumpPower
entity.living.jump void TICK both 1.5 cancellable, predicted LivingEntity#jumpFromGround
entity.mob.check_despawn void value far_distance<br>value random_chance TICK server 1.5 cancellable, rng Mob#checkDespawn
entity.mob.finalize_spawn void difficulty: f32, natural: bool TICK server 1.5 cancellable, rng Mob#finalizeSpawn
entity.mob.do_hurt_target bool target: entity TICK server 1.5 cancellable Mob#doHurtTarget
entity.mob.xp_reward i32 TICK server 1.5 Mob#getBaseExperienceReward
entity.mob.pick_up_items void TICK server 1.5 cancellable Mob#aiStep
spawn.check_rules bool type: ident, reason: i32, pos: block_pos TICK server 1.5 cancellable, rng SpawnPlacements#checkSpawnRules
player.attack void target: entity value crit_multiplier<br>point before_sweep TICK server 1.5 cancellable Player#attack
player.attack_damage f32 TICK server 1.5 Player#attack
player.interact_entity void target: entity, hand: i32 TICK server 1.5 cancellable Player#interactOn
player.food_tick void value exhaustion_threshold TICK server 1.5 cancellable FoodData#tick
player.exhaust void amount!: f32 TICK server 1.5 cancellable, invokable Player#causeFoodExhaustion
player.give_xp void points!: i32 TICK server 1.5 cancellable, invokable Player#giveExperiencePoints
player.respawn void point before_place TICK server 1.5 PlayerList#respawn
player.teleport void level: level, x!: f64, y!: f64, z!: f64, yaw!: f32, pitch!: f32 TICK server 1.5 cancellable ServerPlayer#teleportTo
player.destroy_block bool pos: block_pos TICK server 1.5 cancellable ServerPlayerGameMode#destroyBlock
block.player_destroy void player: entity, pos: block_pos, state: block_state, tool: ident TICK server 1.5 cancellable Block#playerDestroy
block.place_item void player: entity, pos: block_pos, face: i32, hand: i32, item: ident value placement_state TICK server 1.5 cancellable BlockItem#place
block.use_without_item bool player: entity, pos: block_pos, state: block_state, face: i32, hit: vec3 TICK server 1.5 cancellable BlockBehaviour#useWithoutItem
block.use_with_item i32 player: entity, pos: block_pos, state: block_state, hand: i32, item: ident TICK server 1.5 cancellable BlockBehaviour#useItemOn
block.random_tick void pos: block_pos, state: block_state TICK server 1.5 cancellable, rng, hot BlockBehaviour#randomTick
level.set_block bool pos: block_pos, state!: block_state, flags!: i32 TICK server 1.5 cancellable, hot Level#setBlock
level.explode i32 source: entity, x!: f64, y!: f64, z!: f64, radius!: f32, fire!: bool, kind: i32 TICK server 1.5 cancellable, rng ServerExplosion#explode
item.use bool hand: i32, item: ident, count: i32 TICK server 1.5 cancellable Item#use
item.use_on bool player: entity, pos: block_pos, face: i32, hand: i32, item: ident TICK server 1.5 cancellable Item#useOn
item.finish_using void item: ident, count: i32 TICK server 1.5 cancellable LivingEntity#completeUsingItem
player.move void x!: f64, y!: f64, z!: f64, yaw!: f32, pitch!: f32, on_ground!: bool, has_pos: bool, has_rot: bool value moved_wrongly_threshold TICK both 1.14 cancellable, predicted ServerGamePacketListenerImpl#handleMovePlayer
player.destroy_progress f32 state: block_state, pos: block_pos TICK both 1.14 predicted BlockBehaviour#getDestroyProgress
item.hurt void item: ident, amount!: i32, slot: i32 TICK server 1.14 cancellable ItemStack#hurtAndBreak
item.entity_pickup void player: entity, item: ident, count: i32 TICK server 1.14 cancellable ItemEntity#playerTouch
item.entity_tick void item: ident, count: i32 value despawn_age TICK server 1.14 cancellable ItemEntity#tick
inventory.add_item bool item: ident, count: i32 TICK server 1.14 cancellable Inventory#add
menu.click void container_id: i32, menu_type: ident, slot!: i32, button!: i32, input!: i32 TICK server 1.14 cancellable AbstractContainerMenu#clicked
menu.quick_move void menu_type: ident, index: i32, item: ident TICK server 1.14 cancellable AbstractContainerMenu#quickMoveStack
menu.may_place bool menu_type: ident, index: i32, item: ident, count: i32 TICK server 1.14 Slot#mayPlace
menu.open void menu_type: ident, container_id: i32 TICK server 1.14 cancellable ServerPlayer#openMenu
container.hopper_transfer bool pos: block_pos TICK server 1.14 cancellable HopperBlockEntity#tryMoveItems
projectile.shoot void dx!: f64, dy!: f64, dz!: f64, power!: f32, inaccuracy!: f32 TICK server 1.14 cancellable, rng Projectile#shoot
projectile.hit void kind: i32, target: entity, pos: block_pos, at: vec3 TICK server 1.14 cancellable Projectile#onHit
loot.block_drops void pos: block_pos, state: block_state, player: entity, explosion_radius: f32 point each_drop TICK server 1.14 cancellable, rng Block#getDrops
loot.entity_drops void by_player: bool, killer: entity point each_drop TICK server 1.14 cancellable, rng LivingEntity#dropFromLootTable
client.tick void game_time: i64 TICK client 1.16 Minecraft#tick
client.render.world void partial: f32 point before_entities RENDER client 1.16 cancellable LevelRenderer#renderLevel
client.render.sky void skybox: i32 RENDER client 1.16 cancellable LevelRenderer#addSkyPass
client.render.fog void fog_type: i32, partial: f32 point computed RENDER client 1.16 advantage FogRenderer#setupFog
client.camera.setup void third_person: i32, partial: f32 point computed RENDER client 1.16 advantage Camera#setup
client.render.hud void partial: f32 point camera_overlays<br>point crosshair<br>point hotbar<br>point player_health<br>point vehicle_health<br>point contextual_bar<br>point selected_item_name<br>point overlay_message<br>point title<br>point chat<br>point effects<br>point boss_bars<br>point scoreboard<br>point tab_list<br>point subtitles RENDER client 1.16 cancellable Gui#render
client.render.entity void partial: f32 RENDER client 1.16 cancellable, advantage, hot EntityRenderDispatcher#submit
client.screen.init void screen: ident, width: i32, height: i32 RENDER client 1.16 Screen#init
client.screen.render void screen: ident, mouse_x: i32, mouse_y: i32, partial: f32 RENDER client 1.16 cancellable Screen#renderWithTooltip
client.screen.key bool screen: ident, key!: i32, modifiers!: i32 RENDER client 1.16 cancellable Screen#keyPressed
client.input.key void key: i32, scancode: i32, action: i32, modifiers: i32, screen_open: bool RENDER client 1.16 cancellable, advantage KeyboardHandler#keyPress
client.input.mouse_move void dx!: f64, dy!: f64 RENDER client 1.16 cancellable, advantage MouseHandler#turnPlayer
client.chat.receive void message!: text, source: i32 RENDER client 1.16 cancellable ChatComponent#addMessage
client.chat.send void message!: text TICK client 1.16 cancellable ChatScreen#handleChatInput
client.sound.play void sound: ident, category: i32, x: f64, y: f64, z: f64, volume!: f32, pitch!: f32 RENDER client 1.16 cancellable, hot SoundManager#play
client.particle.add void type: ident, x!: f64, y!: f64, z!: f64, dx!: f64, dy!: f64, dz!: f64 TICK client 1.16 cancellable, hot ParticleEngine#createParticle
client.player.attack_cooldown f32 partial: f32 TICK client 1.16 predicted, advantage Player#getAttackStrengthScale
net.packet.receive void state: i32, id: i32, body!: buf TICK client 1.16 cancellable, hot Connection#channelRead0
net.packet.send void state: i32, id: i32, body!: buf TICK client 1.16 cancellable, hot Connection#send
chunk.generate.stage void dimension: ident, x: i32, z: i32, status: i32 PARALLEL server 1.17 cancellable, rng ChunkStatusTasks#generateStructureStarts
worldgen.structure.start bool structure: ident, x: i32, z: i32 PARALLEL server 1.17 cancellable, rng ChunkGenerator#tryGenerateStructure
worldgen.biome.fill void dimension: ident, x: i32, z: i32 point each_cell PARALLEL server 1.17 ChunkAccess#fillBiomesFromNoise
worldgen.terrain.build void dimension: ident, x: i32, z: i32 point before_fill<br>point before_surface<br>point before_carvers PARALLEL server 1.17 rng NoiseBasedChunkGenerator#fillFromNoise
worldgen.feature.place void feature: ident, step: i32, x: i32, z: i32 PARALLEL server 1.17 cancellable, rng ChunkGenerator#applyBiomeDecoration
worldgen.structure.place void structure: ident, step: i32, x: i32, z: i32, start_x: i32, start_z: i32 PARALLEL server 1.17 cancellable, rng StructureStart#placeInChunk
chunk.load void x: i32, z: i32, generated: bool TICK server 1.17 ChunkMap#protoChunkToFullChunk
chunk.unload void x: i32, z: i32 TICK server 1.17 ChunkMap#scheduleUnload
chunk.save void x: i32, z: i32, unloading: bool TICK server 1.17 cancellable ChunkMap#save
command.execute i32 command!: text, permission: i32 TICK server 1.17 cancellable Commands#performCommand
command.register void name: ident TICK server 1.17 cancellable Commands#<init>
command.suggest void command: text point each_suggestion TICK server 1.17 cancellable Commands#getCompletionSuggestions
recipe.match void kind: ident, width: i32 point matched TICK server 1.17 cancellable RecipeManager#getRecipeFor
recipe.assemble void recipe: ident, item!: ident, count!: i32 TICK server 1.17 cancellable CraftingRecipe#assemble
loot.table.roll void table: ident point each_drop TICK server 1.17 cancellable, rng LootTable#getRandomItems
tag.contains bool registry: ident, tag: ident, element: ident TICK server 1.17 hot Holder#is
data.reload void source: entity TICK server 1.17 cancellable MinecraftServer#reloadResources
data.registry_freeze void client: bool MAIN both 1.17 BuiltInRegistries#freeze

! marks an argument or local a mixin may change. Variants name the engine code paths of one target (ci.variant).

Targets

entity.living.hurt

A living entity is asked to take damage (players: the game rule, PvP and difficulty checks of Player#hurtServer are part of the body). Cancel: no damage, returns the CI return value (default false).

  • Signature: (self: entity, source: damage_source, amount!: f32) -> bool
  • Filter key entity_type; variants mob, player; a cancel returns false unless the mixin sets a value.
  • point:after_blocking {amount!: f32, blocked: f32}: after a shield took its part off (blocked = the blocked damage); amount is what is left
  • value:invulnerability_ticks i32: the invulnerability ticks after a full hit (vanilla 20)
  • value:knockback_strength f64: the default knockback strength (vanilla 0.4)
  • point:before_knockback {strength!: f64, dx: f64, dz: f64} cancel: skip: before the default knockback; cancelling skips the knockback only
  • point:before_death: the health is 0 or less: before the totem check and death

entity.living.actually_hurt

Damage is applied after the invulnerability check: armor, then magic (resistance, protection), then absorption, then the health drops. Cancel: nothing is applied.

  • Signature: (self: entity, source: damage_source, amount!: f32) -> void
  • Filter key entity_type.
  • value:after_armor f32: the damage after armor
  • value:after_magic f32: the damage after resistance and protection enchantments

entity.living.damage_after_armor

The damage left after armor and armor toughness (armor items take their wear here).

  • Signature: (self: entity, source: damage_source, amount: f32) -> f32
  • Filter key entity_type.

entity.living.damage_after_magic

The damage left after the resistance effect and protection enchantments.

  • Signature: (self: entity, source: damage_source, amount: f32) -> f32
  • Filter key entity_type.

entity.living.heal

Health is restored (nothing happens to a dead entity). Cancel: no healing.

  • Signature: (self: entity, amount!: f32) -> void
  • Filter key entity_type.

entity.living.check_totem

A totem of undying (any death_protection item in a hand) saves the entity: true = saved. Cancel: returns the CI return value (default false: no totem is used).

  • Signature: (self: entity, source: damage_source) -> bool
  • Filter key entity_type; a cancel returns false unless the mixin sets a value.

entity.living.die

The entity dies (death sound, loot, experience, statistics; players: the death screen). Cancel: it doesn’t die; a health of 0 or less is set to 1, as a totem does.

  • Signature: (self: entity, source: damage_source) -> void
  • Filter key entity_type; variants mob, player.

entity.living.knockback

Knockback: strength against the knockback resistance along (dx, dz) (players get it as a motion packet). Cancel: no knockback.

  • Signature: (self: entity, strength!: f64, dx!: f64, dz!: f64) -> void
  • Filter key entity_type; variants mob, player.

entity.living.cause_fall_damage

Landing after a fall: ceil((distance - safe distance) * multiplier) damage (multiplier: the block landed on for players, the fall_damage_multiplier attribute for mobs). True = damage was dealt. Cancel: no fall damage.

  • Signature: (self: entity, distance!: f64, multiplier!: f64) -> bool
  • Filter key entity_type; variants mob, player; a cancel returns false unless the mixin sets a value.
  • value:safe_distance f64: the safe fall distance (the safe_fall_distance attribute; players 3)

entity.living.add_effect

An effect is added or upgraded (the amplifier / duration rules of MobEffectInstance#update). True = it changed. Cancel: the effect isn’t added (returns the CI return value, default false).

  • Signature: (self: entity, effect: ident, amplifier!: i32, duration!: i32, ambient: bool, visible: bool) -> bool
  • Filter key entity_type; a cancel returns false unless the mixin sets a value.

entity.living.tick_effects

The effects tick once (durations count down, poison / regeneration apply, expired effects are removed). Cancel: the effects don’t tick this tick.

  • Signature: (self: entity) -> void
  • Filter key entity_type.

entity.living.tick

One tick of a living entity (mobs: base tick, AI and movement; players: the server side of the player tick). Not cancellable (a player’s networking runs in it); wrap and return work.

  • Signature: (self: entity) -> void
  • Filter key entity_type; variants mob, player.

entity.mob.ai_step

The AI and movement step of a mob (goals, navigation, jumping, travel, item pickup, the despawn check). Cancel: the mob does nothing this tick.

  • Signature: (self: entity) -> void
  • Filter key entity_type.

entity.living.travel

A mob moves by its input (strafe = xxa, vertical = yya, forward = zza): in water, lava or air, with friction and gravity. Cancel: the mob doesn’t move this tick. Variant local_player (API 1.16): the client’s own player’s movement (only active on a server running the same mod).

  • Signature: (self: entity, strafe!: f32, vertical!: f32, forward!: f32) -> void
  • Filter key entity_type; variants mob, local_player.

entity.living.jump_power

The jump velocity (the jump_strength attribute times the block jump factor: honey 0.5). Variant local_player (API 1.16): the client’s own player (only active on a server running the same mod).

  • Signature: (self: entity) -> f32
  • Filter key entity_type; variants mob, local_player.

entity.living.jump

A mob jumps from the ground. Cancel: no jump. Variant local_player (API 1.16): the client’s own player (only active on a server running the same mod).

  • Signature: (self: entity) -> void
  • Filter key entity_type; variants mob, local_player.

entity.mob.check_despawn

The despawn check of a mob (peaceful monsters, far from every player, the random despawn of idle mobs). Cancel: the mob stays this tick.

  • Signature: (self: entity) -> void
  • Filter key entity_type.
  • value:far_distance f64: the despawn distance (128 blocks, water ambient 64)
  • value:random_chance i32: 1 in this many ticks for the random despawn of an idle mob (800)

entity.mob.finalize_spawn

A freshly spawned mob is set up (follow range bonus, left-handedness, equipment, variants, babies, jockeys). difficulty = the local effective difficulty; natural = natural spawning or chunk generation. Cancel: no setup.

  • Signature: (self: entity, difficulty: f32, natural: bool) -> void
  • Filter key entity_type.

entity.mob.do_hurt_target

A mob’s melee attack (attack damage plus weapon enchantments, extra knockback, post-attack effects). True = the target was hurt. Cancel: no attack (returns the CI return value, default false).

  • Signature: (self: entity, target: entity) -> bool
  • Filter key entity_type; a cancel returns false unless the mixin sets a value.

entity.mob.xp_reward

The experience a mob drops when a player kills it (before the experience enchantment effects).

  • Signature: (self: entity) -> i32
  • Filter key entity_type.

entity.mob.pick_up_items

A mob that can pick up loot picks up the item entities within reach that it wants. Cancel: no pickup this tick.

  • Signature: (self: entity) -> void
  • Filter key entity_type.

spawn.check_rules

The spawn placement rules of an entity type at a position (light, the block below, the biome rules); reason is the SpawnReason ordinal (0 natural, 1 chunk generation, 2 spawner, …). Cancel: returns the CI return value (default false: no spawn).

  • Signature: (self: level, type: ident, reason: i32, pos: block_pos) -> bool
  • Filter key entity_type; a cancel returns false unless the mixin sets a value.

player.attack

A player attacks an entity (the attack strength, critical hits, sweeping, knockback, weapon wear). Cancel: no attack.

  • Signature: (self: entity, target: entity) -> void
  • value:crit_multiplier f32: the critical hit damage multiplier (1.5)
  • point:before_sweep cancel: skip: before the sweep attack hits the entities around the target; cancelling skips the sweep

player.attack_damage

The player’s attack damage scaled by the attack strength (0.2 + strength^2 * 0.8); resets the attack strength.

  • Signature: (self: entity) -> f32

player.interact_entity

A player uses (right-clicks) an entity with a hand (0 main hand, 1 off hand). Cancel: no interaction.

  • Signature: (self: entity, target: entity, hand: i32) -> void

player.food_tick

The hunger tick (FoodData#tick): exhaustion uses up saturation, then food; healing from a full food bar; starving. Cancel: no hunger tick.

  • Signature: (self: entity) -> void
  • value:exhaustion_threshold f32: the exhaustion that uses up one saturation or food point (4.0)

player.exhaust

Food exhaustion is added (not in creative or spectator mode). Cancel: no exhaustion.

  • Signature: (self: entity, amount!: f32) -> void

player.give_xp

Experience points are added (negative values remove them); levels follow. Cancel: no experience.

  • Signature: (self: entity, points!: i32) -> void

player.respawn

A dead player (or one back from the end credits) respawns: the bed / anchor or the world spawn, fresh health.

  • Signature: (self: entity) -> void
  • point:before_place {x!: f64, y!: f64, z!: f64, yaw!: f32, pitch!: f32}: the respawn position and rotation are chosen; the player is placed there next

player.teleport

A player is teleported (in the same level, or to another dimension with the respawn packet and resent state). Cancel: no teleport.

  • Signature: (self: entity, level: level, x!: f64, y!: f64, z!: f64, yaw!: f32, pitch!: f32) -> void

player.destroy_block

A player breaks a block (game mode checks, block.break, the block is removed, tool wear, drops and experience). True = broken. Cancel: the block stays (returns the CI return value, default false; the client is resynced).

  • Signature: (self: entity, pos: block_pos) -> bool
  • A cancel returns false unless the mixin sets a value.

block.player_destroy

After a player broke a block that can drop: the mined statistic, exhaustion, then the drops of its loot table. tool = the held item. Cancel: no drops, statistic or exhaustion.

  • Signature: (self: level, player: entity, pos: block_pos, state: block_state, tool: ident) -> void
  • Filter key block.

block.place_item

A player places a block item at the clicked face (replaceable blocks, the placement state, survival and collision checks, block.place, sounds, the item is used up). face: 0 down, 1 up, 2 north, 3 south, 4 west, 5 east. Cancel: nothing is placed.

  • Signature: (self: level, player: entity, pos: block_pos, face: i32, hand: i32, item: ident) -> void
  • Filter key item.
  • value:placement_state block_state: the block state the item places (BlockItem#getPlacementState)

block.use_without_item

A player uses a block without an item effect (doors, levers, buttons, containers, beds …). True = used. Cancel: returns the CI return value (default false: nothing happens).

  • Signature: (self: level, player: entity, pos: block_pos, state: block_state, face: i32, hit: vec3) -> bool
  • Filter key block; a cancel returns false unless the mixin sets a value.

block.use_with_item

A player uses a block with the item in a hand (cauldrons, composters, cakes, vaults …). Returns 0 success, 1 try the empty-hand use, 2 pass (the item is used next). Cancel: returns the CI return value (default 2).

  • Signature: (self: level, player: entity, pos: block_pos, state: block_state, hand: i32, item: ident) -> i32
  • Filter key block; a cancel returns 2 unless the mixin sets a value.

block.random_tick

The random tick of a block (crops grow, leaves decay, fire spreads, ice melts …). Hot: always filter. Cancel: the block doesn’t tick.

  • Signature: (self: level, pos: block_pos, state: block_state) -> void
  • Filter key block.

level.set_block

A block state is set (flags: the Level#setBlock flags, 3 = notify neighbours and clients). True = changed. Filtered on the new state’s block. Hot: always filter. Cancel: the block isn’t changed (returns false).

  • Signature: (self: level, pos: block_pos, state!: block_state, flags!: i32) -> bool
  • Filter key block; a cancel returns false unless the mixin sets a value.

level.explode

An explosion (blocks, entity damage and knockback, fire, particles and sound). kind: 0 none, 1 block, 2 mob, 3 tnt, 4 trigger (the explosion interaction). Returns the number of blocks destroyed. Cancel: no explosion.

  • Signature: (self: level, source: entity, x!: f64, y!: f64, z!: f64, radius!: f32, fire!: bool, kind: i32) -> i32
  • A cancel returns 0 unless the mixin sets a value.

item.use

A player uses the item in a hand in the air (eating starts, bows draw, buckets, ender pearls …). True = used. Cancel: returns the CI return value (default false: nothing happens).

  • Signature: (self: entity, hand: i32, item: ident, count: i32) -> bool
  • Filter key item; a cancel returns false unless the mixin sets a value.

item.use_on

An item is used on a block (hoes, bone meal, flint and steel, buckets, spawn eggs …); player = 0 for a dispenser. True = used. Cancel: returns the CI return value (default false).

  • Signature: (self: level, player: entity, pos: block_pos, face: i32, hand: i32, item: ident) -> bool
  • Filter key item; a cancel returns false unless the mixin sets a value.

item.finish_using

A player finishes using an item (eating, drinking: food, effects, the use remainder). Cancel: nothing is consumed.

  • Signature: (self: entity, item: ident, count: i32) -> void
  • Filter key item.

player.move

A player’s movement packet is accepted or rejected (speed check, collision, “moved wrongly”, fall damage, step effects). has_pos / has_rot: the packet carries a position / a rotation. Cancel: the movement is rejected; a packet with a position puts the player back where the server has it (the correction teleport). Variant local_player (API 1.16, the client): the movement packet the client is about to send (the fields are what it sends, the player itself stays where it is; cancel: no movement packet this tick); only active on a server running the same mod.

  • Signature: (self: entity, x!: f64, y!: f64, z!: f64, yaw!: f32, pitch!: f32, on_ground!: bool, has_pos: bool, has_rot: bool) -> void
  • Variants server, local_player.
  • value:moved_wrongly_threshold f64: the squared distance between the sent and the collided position above which a survival player “moved wrongly” and is put back (0.0625)

player.destroy_progress

The part of a block a player breaks per tick with the held item (hardness, the correct tool, efficiency, haste, mining fatigue, water, off ground); 1 or more breaks it in one tick. Variants: server (what the server mines with) and local_player (API 1.16: the client’s own prediction of its mining; only active on a server running the same mod). Filtered on the block.

  • Signature: (self: entity, state: block_state, pos: block_pos) -> f32
  • Filter key block; variants server, local_player.

item.hurt

An item a player holds or wears takes wear (unbreaking is applied inside; creative players and unbreakable items skip it); slot: 0 main hand, 1 off hand, 2 feet, 3 legs, 4 chest, 5 head, 6 body, 7 saddle. Cancel: no wear.

  • Signature: (self: entity, item: ident, amount!: i32, slot: i32) -> void
  • Filter key item.

item.entity_pickup

A player touches an item entity (self) and picks up what fits (the pickup delay and the owner rules are part of the body). Cancel: nothing is picked up.

  • Signature: (self: entity, player: entity, item: ident, count: i32) -> void
  • Filter key item.

item.entity_tick

The tick of an item entity (self): gravity, motion, merging with others, the age and the despawn. Cancel: it does not tick (it stays where it is and does not age).

  • Signature: (self: entity, item: ident, count: i32) -> void
  • Filter key item.
  • value:despawn_age i32: the age at which the item despawns (6000 ticks)

inventory.add_item

A stack is added to a player’s inventory (matching stacks first, then empty slots; what does not fit stays in the stack). True = something was added. Cancel: nothing is added (returns the CI return value, default false).

  • Signature: (self: entity, item: ident, count: i32) -> bool
  • Filter key item; a cancel returns false unless the mixin sets a value.

A player clicks in the open menu (the container click packet): slot (-999 outside), button, input (0 pickup, 1 quick move, 2 swap, 3 clone, 4 throw, 5 quick craft, 6 pickup all). Cancel: nothing happens and the client is resynced.

  • Signature: (self: entity, container_id: i32, menu_type: ident, slot!: i32, button!: i32, input!: i32) -> void
  • Filter key menu_type.

Shift-click: the stack in slot index moves to the other part of the menu (the menu’s own rules). Runs again while it keeps moving the same item. item = the stack in the slot. Cancel: nothing moves.

  • Signature: (self: entity, menu_type: ident, index: i32, item: ident) -> void
  • Filter key menu_type.

Whether a stack may be put into the menu slot index (furnace fuel, armor slots, result slots …).

  • Signature: (self: entity, menu_type: ident, index: i32, item: ident, count: i32) -> bool
  • Filter key menu_type.

A menu opens for a player (an open menu closes first; the open screen packet and the contents are sent). Cancel: the menu is not opened.

  • Signature: (self: entity, menu_type: ident, container_id: i32) -> void
  • Filter key menu_type.

container.hopper_transfer

A hopper at pos tries to move items (push into the container it faces, then pull from above or pick up item entities); true = something moved (the hopper cools down for 8 ticks). Cancel: nothing moves (returns the CI return value, default false).

  • Signature: (self: level, pos: block_pos) -> bool
  • A cancel returns false unless the mixin sets a value.

projectile.shoot

A projectile (self) is shot along (dx, dy, dz) with a power and an inaccuracy (the random spread is drawn inside). Cancel: its motion is not set.

  • Signature: (self: entity, dx!: f64, dy!: f64, dz!: f64, power!: f32, inaccuracy!: f32) -> void
  • Filter key entity_type.

projectile.hit

A projectile (self) hits something: kind 1 a block (pos), 2 an entity (target); at = the hit location. Deflections (breeze, wind charges) are part of the body. Cancel: the hit is ignored.

  • Signature: (self: entity, kind: i32, target: entity, pos: block_pos, at: vec3) -> void
  • Filter key entity_type.

loot.block_drops

The drops of a block (its loot table; player breaking, explosions, /loot): the tool and enchantments of player (0 = none), explosion_radius > 0 for explosion decay. Cancel: no drops.

  • Signature: (self: level, pos: block_pos, state: block_state, player: entity, explosion_radius: f32) -> void
  • Filter key block.
  • point:each_drop {item!: ident, count!: i32}: once per dropped stack, in order: change the item, or set count to 0 to remove the stack

loot.entity_drops

The loot table drops of a dying mob (self); killer = the player responsible (0 = none). Equipment drops and experience are separate. Cancel: no loot table drops.

  • Signature: (self: entity, by_player: bool, killer: entity) -> void
  • Filter key entity_type.
  • point:each_drop {item!: ident, count!: i32}: once per dropped stack, in order: change the item, or set count to 0 to remove the stack

client.tick

One client tick (Minecraft#tick: the game mode, picking, the keybinds, the player’s movement and packets, the level and its entities, particles). game_time = the level’s game time before the tick. Not cancellable (the connection must keep ticking).

  • Signature: (game_time: i64) -> void

client.render.world

The world part of a frame (LevelRenderer#renderLevel): the sky, the terrain, entities, block entities, particles, clouds and weather are prepared and drawn. Cancel: no world this frame (the fog colour shows behind the HUD).

  • Signature: (partial: f32) -> void
  • point:before_entities cancel: skip: before the entities, block entities and particles are extracted; cancelling skips them this frame

client.render.sky

The sky is drawn this frame (SkyRenderer: sky colour, sun, moon, stars, the end sky). skybox: 0 none, 1 overworld, 2 end. Not fired where vanilla draws no sky (lava, powder snow). Cancel: no sky (the fog colour shows).

  • Signature: (skybox: i32) -> void

client.render.fog

The fog of this frame is computed (FogRenderer#setupFog: water, lava, powder snow, blindness, darkness, the render distance and the dimension’s fog). fog_type: 0 none, 1 water, 2 lava, 3 powder snow, 4 atmospheric. Only what is drawn changes, never what is loaded or culled.

  • Signature: (fog_type: i32, partial: f32) -> void
  • point:computed {environmental_start!: f32, environmental_end!: f32, render_distance_start!: f32, render_distance_end!: f32, sky_end!: f32, cloud_end!: f32, red!: f32, green!: f32, blue!: f32}: the fog is computed (distances in blocks, colour 0…1); change it here

client.camera.setup

The camera of this frame is placed (Camera#setup: the view entity, third person and its zoom, the FOV with its effects). third_person: 0 first person, 1 behind, 2 in front. The values in computed are what is drawn.

  • Signature: (third_person: i32, partial: f32) -> void
  • point:computed {x!: f64, y!: f64, z!: f64, yaw!: f32, pitch!: f32, fov!: f32}: the camera is placed; changing it moves or turns the view (culling and the sound listener follow it)

client.render.hud

The HUD (Gui#render) under any open screen: camera overlays, the crosshair, the hotbar, hearts, food, armor and air, the vehicle health, the experience or jump bar, the item name, the action bar, titles, chat, effects, boss bars, the scoreboard, the player list, subtitles. Mod HUD layers draw inside it. Not fired with the HUD hidden (F1). Cancel: no vanilla HUD and no mod layers this frame. Each layer has a point that skips it.

  • Signature: (partial: f32) -> void
  • point:camera_overlays cancel: skip
  • point:crosshair cancel: skip
  • point:hotbar cancel: skip
  • point:player_health cancel: skip
  • point:vehicle_health cancel: skip
  • point:contextual_bar cancel: skip
  • point:selected_item_name cancel: skip
  • point:overlay_message cancel: skip
  • point:title cancel: skip
  • point:chat cancel: skip
  • point:effects cancel: skip
  • point:boss_bars cancel: skip
  • point:scoreboard cancel: skip
  • point:tab_list cancel: skip
  • point:subtitles cancel: skip

client.render.entity

An entity (self) is drawn this frame: it passed the distance, frustum and occlusion tests (the local player in third person and item pickup animations too). Cancel: it is not drawn (no model, name tag or outline).

  • Signature: (self: entity, partial: f32) -> void
  • Filter key entity_type.

client.screen.init

A screen is initialised (Screen#init: opened, or rebuilt after a resize); screen = its id (“minecraft:inventory”, “minecraft:title”, “minecraft:pause” …: the screen class name in snake case, as client.screen_open reports it), width / height in GUI pixels.

  • Signature: (screen: ident, width: i32, height: i32) -> void
  • Filter key screen.

client.screen.render

The open screen is drawn (Screen#renderWithTooltip: its background, widgets, labels and tooltips); the mouse in GUI pixels. Cancel: the screen isn’t drawn this frame (it still takes input).

  • Signature: (screen: ident, mouse_x: i32, mouse_y: i32, partial: f32) -> void
  • Filter key screen.

client.screen.key

A key is pressed while a screen is open (Screen#keyPressed: Escape, the screen’s shortcuts, the focused widget); key = the GLFW key code, modifiers = GLFW bits (shift 1, control 2, alt 4). True = the screen used it. Cancel: the screen ignores the key (returns the CI return value, default false).

  • Signature: (screen: ident, key!: i32, modifiers!: i32) -> bool
  • Filter key screen; a cancel returns false unless the mixin sets a value.

client.input.key

A keyboard key changes state (KeyboardHandler#keyPress: keybinds, F-keys, the chat key; also with a screen open). key = the GLFW key code (-1 unknown), scancode = the SDL scancode, action 0 release, 1 press, 2 repeat, modifiers = GLFW bits. Cancel: the game ignores the key event.

  • Signature: (key: i32, scancode: i32, action: i32, modifiers: i32, screen_open: bool) -> void

client.input.mouse_move

The mouse turns the player (MouseHandler#turnPlayer -> LocalPlayer#turn) by dx / dy in vanilla’s turn units (sensitivity and smoothing applied; 0.15 degrees each). Cancel: no turn this frame.

  • Signature: (self: entity, dx!: f64, dy!: f64) -> void

client.chat.receive

A line is added to the chat (ChatComponent#addMessage: system, game and player messages); message = the line as text (set it to another text to change what is shown and logged); source 0 client, 1 server, 2 player. Cancel: the line isn’t shown or logged.

  • Signature: (message!: text, source: i32) -> void

client.chat.send

The player sends a chat line or a command (ChatScreen#handleChatInput, trimmed; commands start with “/”); set message to another text to change what is sent. Cancel: nothing is sent.

  • Signature: (self: entity, message!: text) -> void

client.sound.play

A positioned sound starts in the world (SoundManager#play: block, entity, step and server sounds; music and UI sounds are not positioned and don’t fire). category = the SoundSource order (0 master, 1 music, 2 records, 3 weather, 4 blocks, 5 hostile, 6 neutral, 7 players, 8 ambient, 9 voice, 10 ui). Cancel: it doesn’t play.

  • Signature: (sound: ident, category: i32, x: f64, y: f64, z: f64, volume!: f32, pitch!: f32) -> void
  • Filter key sound.

client.particle.add

A particle is added (ParticleEngine#createParticle: from packets, block breaking, entities and the level). Cancel: the particle isn’t created.

  • Signature: (type: ident, x!: f64, y!: f64, z!: f64, dx!: f64, dy!: f64, dz!: f64) -> void
  • Filter key particle.

client.player.attack_cooldown

The local player’s attack strength (Player#getAttackStrengthScale: 0 right after an attack … 1 recharged), as the attack, the swing and the attack indicator read it (damage and sweeping are decided by the server).

  • Signature: (self: entity, partial: f32) -> f32

net.packet.receive

A clientbound packet arrives (configuration and play, on the client’s main thread in stream order, before it is handled). state 3 configuration, 4 play; id = the packet id in that state; body = a copy of the bytes after the id (read it with cl_buf_read_*; set body to another buffer to replace the packet, which the vanilla codec then decodes). Keep-alives and chunk batch markers are answered on the network thread first. Filter: the packet name (“minecraft:set_time”). Cancel: the packet is dropped (bundle delimiters can’t be dropped).

  • Signature: (state: i32, id: i32, body!: buf) -> void
  • Filter key packet.

net.packet.send

A serverbound packet the game encoded is sent (the main thread’s packets; the network thread’s own answers are not included). The same fields as net.packet.receive. Cancel: the packet isn’t sent.

  • Signature: (state: i32, id: i32, body!: buf) -> void
  • Filter key packet.

chunk.generate.stage

One generation status of one chunk (ChunkStatusTasks): status 1 structure starts, 2 structure references, 3 biomes, 4 terrain (noise, surface, carvers), 5 features (structures and placed features), 8 initial mobs. Cancel: the status’ work is skipped (the chunk still moves on to the next status: a cancelled 4 leaves it air).

  • Signature: (dimension: ident, x: i32, z: i32, status: i32) -> void
  • Filter key dimension.

worldgen.structure.start

A structure tries to start in a chunk (ChunkGenerator#tryGenerateStructure: the placement already chose the chunk; the body runs the biome check and finds the generation point and the pieces); true = a valid start was made. In a structure set with several structures a false return lets the next weighted option try. Cancel: no start (returns the CI return value, default false). /locate and /place still find the vanilla answer.

  • Signature: (structure: ident, x: i32, z: i32) -> bool
  • Filter key structure; a cancel returns false unless the mixin sets a value.

worldgen.biome.fill

The biomes of a chunk are filled from the biome source (ChunkAccess#fillBiomesFromNoise), one cell per 4 x 4 x 4 blocks. each_cell runs for every cell (quart coordinates, bottom-up): changing biome changes what the chunk stores, so the surface, the features of the FEATURES status, the client’s colours and the mob spawns follow it. Structure starts and carvers ask the biome source itself, as in vanilla. A biome that the dimension never generates gets no features.

  • Signature: (dimension: ident, x: i32, z: i32) -> void
  • Filter key dimension.
  • point:each_cell {qx: i32, qy: i32, qz: i32, biome!: ident}

worldgen.terrain.build

The terrain of a chunk is built (NoiseBasedChunkGenerator#fillFromNoise, #buildSurface, #applyCarvers): the noise fill with aquifers and ore veins, then the surface rules, then the carvers. Each part has a point that skips it.

  • Signature: (dimension: ident, x: i32, z: i32) -> void
  • Filter key dimension.
  • point:before_fill cancel: skip: before the noise fill; cancelling leaves the chunk air (no terrain, no aquifers, no ore veins)
  • point:before_surface cancel: skip: before the surface rules (grass, sand, bedrock …); cancelling leaves the raw stone / netherrack / end stone
  • point:before_carvers cancel: skip: before the carvers (caves, canyons); cancelling leaves the chunk uncarved

worldgen.feature.place

A placed feature is placed for a chunk in the FEATURES status (PlacedFeature#placeWithBiomeCheck: its placement modifiers and the feature itself; ores, trees, flowers, lakes, geodes …). step = the decoration step (GenerationStep.Decoration order), x / z = the chunk. Every feature gets its own seeded random, so cancelling one doesn’t move the others. Cancel: the feature isn’t placed in this chunk.

  • Signature: (feature: ident, step: i32, x: i32, z: i32) -> void
  • Filter key feature.

worldgen.structure.place

A structure start places its pieces into a chunk in the FEATURES status (StructureStart#placeInChunk); x / z = the chunk being decorated, start_x / start_z = the chunk the structure started in. Cancel: nothing of it in this chunk (the rest of the structure is still placed in its other chunks).

  • Signature: (structure: ident, step: i32, x: i32, z: i32, start_x: i32, start_z: i32) -> void
  • Filter key structure.

chunk.load

A chunk of the level (self) becomes ready: it is FULL, lit and in the map (LevelChunk#setLoaded and the chunk load event); generated = it was generated now (false: read from disk). A return injection sees the chunk loaded.

  • Signature: (self: level, x: i32, z: i32, generated: bool) -> void

chunk.unload

A ready chunk of the level (self) is about to be unloaded (ChunkMap#scheduleUnload): its entities and block entities leave the level next; its save follows (chunk.save, unloading true).

  • Signature: (self: level, x: i32, z: i32) -> void

chunk.save

A chunk of the level (self) with changes is saved (ChunkMap#save: autosave, /save-all, unloading, shutdown; the snapshot is taken here, encoding and the disk write run in the background). Cancel: it is not written this time; it stays marked as changed (a later save writes it), but an unloading chunk’s changes are lost.

  • Signature: (self: level, x: i32, z: i32, unloading: bool) -> void

command.execute

A command line runs (Commands#performCommand: players, the console, command blocks, rcon; variant function: every line of a function, a /schedule and /execute … run function). self = the source entity (0 for the console and command blocks); command = the line without the slash: set it to another text to run that instead (it is parsed again). Filtered on the first word (“tp” = “minecraft:tp”). Mod commands (cl.cmd) are not included. The return value is the command’s result (0 = failed). Cancel: it doesn’t run (returns the CI return value, default 0).

  • Signature: (self: entity, command!: text, permission: i32) -> i32
  • Filter key command; variants top, function; a cancel returns 0 unless the mixin sets a value.

command.register

A vanilla command is added to the server’s command tree when the server starts (Commands#<init>); name = its literal (“minecraft:tp”). Cancel: it is not registered (it can’t run, and clients don’t get it for completion).

  • Signature: (name: ident) -> void
  • Filter key command.

command.suggest

A player asks for completions of a command line (ServerboundCommandSuggestionPacket); self = the player, command = the line without the slash. each_suggestion runs once per suggestion in order: change it, or cancel to drop it. Cancel: no suggestions are sent back.

  • Signature: (self: entity, command: text) -> void
  • Filter key command.
  • point:each_suggestion {suggestion!: text} cancel: skip

recipe.match

A recipe is looked up for an input (RecipeManager#getRecipeFor): variant crafting (kind “minecraft:crafting”: the crafting table, the inventory grid, the crafter; width = the grid width) or cooking (kind = the recipe type, “minecraft:smelting”, “minecraft:blasting”, “minecraft:smoking”, “minecraft:campfire_cooking”; width 0). Cancel: no recipe matches.

  • Signature: (kind: ident, width: i32) -> void
  • Variants crafting, cooking.
  • point:matched {recipe: ident} cancel: skip: a recipe matched (its id); cancelling refuses it: no recipe matches

recipe.assemble

The result of a matched crafting recipe is made (CraftingRecipe#assemble, also the special recipes): item / count are the result; a changed item replaces it (the components are dropped), a changed count keeps them. Cancel: no result.

  • Signature: (recipe: ident, item!: ident, count!: i32) -> void
  • Filter key recipe.

loot.table.roll

A loot table is rolled (LootTable#getRandomItems): chests, barrels and other containers, fishing, archaeology, vaults, bartering, gifts, /loot, and the block and mob drop tables (inside loot.block_drops / loot.entity_drops). each_drop runs once per rolled stack. Cancel: nothing.

  • Signature: (table: ident) -> void
  • Filter key loot_table.
  • point:each_drop {item!: ident, count!: i32}: once per rolled stack, in order: change the item, or set count to 0 to remove the stack

tag.contains

A tag membership is asked through the server’s data registries (Holder#is(TagKey): item tags of recipes, advancements, enchantments, beacons, entity / damage / biome tags of the data-driven checks); element = the element’s id. Block tags that block behaviour has built into its tables are not asked here. The return value is the answer.

  • Signature: (registry: ident, tag: ident, element: ident) -> bool
  • Filter key tag.

data.reload

/reload re-reads the data packs’ functions and fires lifecycle.data_reloaded (MinecraftServer#reloadResources); source = the entity that ran it (0 = the console). Cancel: nothing is reloaded.

  • Signature: (source: entity) -> void

data.registry_freeze

The content registries freeze (BuiltInRegistries#freeze: mod blocks, items and entities are final after it); client = it happens in the game client (false: the dedicated server). It runs once, after the register phase: a head injection sees the final list of mod content before ids are assigned, a return injection the frozen registries.

  • Signature: (client: bool) -> void