-
Notifications
You must be signed in to change notification settings - Fork 0
Home
OmniMixin is a Fabric library mod for Minecraft 1.21. It doesn't add any blocks, items, or gameplay by itself — instead, it wraps a big pile of vanilla mixin hooks (movement, combat, blocks, items, entities, rendering, and a small data-sync layer) behind clean, documented, Fabric-style events, so you don't have to write and maintain those mixins yourself.
If you've ever wanted to know "how much fall damage is this player about to
take, and can I change it?" or "can I stop this specific mob from being
knocked back?" without hand-writing a mixin into LivingEntity, that's what
this mod is for.
Fabric API already gives you events for the big, common things — block break, item use, entity join world, and so on. But a lot of everyday gameplay logic lives inside vanilla methods that Fabric API doesn't expose an event for: how knockback strength is calculated, whether a specific block's redstone power gets modified, whether an entity is allowed to jump right now. Getting at those normally means writing your own mixin, picking the right injection point, and hoping you got the target method signature right.
OmniMixin does that work once, centrally, and exposes the result as a
regular Event<T> (the same net.fabricmc.fabric.api.event.Event type you
already use for Fabric API's own events). You add OmniMixin as a dependency,
register a listener, and you're working with plain Java objects — no
@Inject, no @At, no bytecode descriptors.
| Subsystem | Package | Covers |
|---|---|---|
| Movement | dev.goshi.omnimixin.api.event.movement | walking/ground speed, jumping, sprinting, flight speed, entity pushing |
| Combat | dev.goshi.omnimixin.api.event.combat | damage, knockback, armor, status effects, healing, death, absorption |
| World and Blocks | dev.goshi.omnimixin.api.event.world | block interaction, placement, breaking, mining speed, redstone power |
| Items and Inventory | dev.goshi.omnimixin.api.event.item | item use, equipment changes, inventory slot clicks, block loot |
| Entity Lifecycle and AI | dev.goshi.omnimixin.api.event.entity | ticking, despawning, spawn rules, mob AI goals and targeting |
| Rendering | dev.goshi.omnimixin.api.event.render (client-only) | HUD drawing, screens, camera FOV, per-entity rendering |
| Networking and Data Sync | dev.goshi.omnimixin.api.sync | declare a field on an entity that auto-syncs to nearby clients and saves to NBT |
Every event follows the same shape, described in Architecture — a
Cancellable you can call to veto something, and/or a Mutable* wrapper you
can write a new value into. Once you've used one OmniMixin event, you
already know how to use all of them.
public class MyMod implements ModInitializer {
@Override
public void onInitialize() {
// Double all fall damage.
PlayDamage.MODIFY_AMOUNT.register(ctx -> {
if (ctx.source().isOf(DamageTypes.FALL)) {
ctx.finalDamage().multiply(2.0f);
}
});
// Stop players from sprinting while they're holding a shield up.
PlaySprint.CAN_SPRINT.register(ctx ->
!ctx.entity().isUsingItem()
);
}
}
That's the whole shape of the API. No mixin, no injection annotation, no Yarn method descriptor to get wrong.
- New to the mod? Read Getting Started first.
- Want to understand the
Cancellable/Mutable*pattern before diving into a specific subsystem? Read Architecture. - Otherwise, jump straight to the subsystem page you need from the table above.
- Curious what's not implemented yet, and why? See Known Limitations.
This project deliberately implements pieces incrementally rather than stubbing everything out at once, and each page here says plainly which parts of a subsystem are covered and which are still open. If a method or event doesn't exist yet, it's listed in Known Limitations along with the actual reason it was held back — usually "the real vanilla signature couldn't be verified with enough confidence to ship it," not "we forgot." If you find something here that's wrong, please open an issue — this mod has never been run through a live game instance yet (see the note at the bottom of Getting Started), so bug reports from real testing are genuinely valuable.