Skip to content

🔌 Mixin Reference & Injection Hooks ​

Better Bats uses Bytecode Mixins to modify vanilla entity and world spawning behavior while keeping world saves 100% vanilla-safe.


📋 Comprehensive Mixin Injection Table ​

Mixin ClassTarget Vanilla ClassTarget Method@At Injection PointCancellation / Behavior
BatMixinnet.minecraft.world.entity.ambient.Bat<init>@At("TAIL")Registers custom AI goals (Panic, Sleep, HuntLight, DiveBomb) into goalSelector.
BatMixinnet.minecraft.world.entity.ambient.BatcustomServerAiStep@At("HEAD")cancellable = true. Completely replaces vanilla flight calculation with BatFlightHelper forces and resting logic.
BatMixinnet.minecraft.world.entity.ambient.BatcheckBatSpawnRules@At("HEAD")cancellable = true. Validates surface nighttime spawning rules.
BatMixinnet.minecraft.world.entity.ambient.BataddAdditionalSaveData@At("TAIL")Writes betterbats:guano_ticks integer tag to ValueOutput.
BatMixinnet.minecraft.world.entity.ambient.BatreadAdditionalSaveData@At("TAIL")Reads betterbats:guano_ticks integer tag from ValueInput.
BatMixinnet.minecraft.world.entity.ambient.Battick@At("TAIL")Ticks guano production, farmland fertilization, and gravity state (setNoGravity(!isResting())).
GameEventDispatcherMixinnet.minecraft.world.level.gameevent.GameEventDispatcherpost@At("HEAD")Listens for EXPLODE, BLOCK_DESTROY, or sprinting STEP within 16 blocks to wake up resting bats and trigger 100-tick panic.
NaturalSpawnerMixinnet.minecraft.world.level.NaturalSpawnermobsAt@At("RETURN")cancellable = true. Dynamically replaces bat ambient spawn weight with better-bats:bat_spawn_weight GameRule.
MobAccessornet.minecraft.world.entity.MobgetGoalSelector@AccessorExposes Mob.goalSelector field to BatMixin.

Official documentation & web portal for Dasik Igaijinn mods.