tutorial:mixin_introduction
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
tutorial:mixin_introduction [2025/09/23 15:13] – Removed unnecessary quote gauntrecluse | tutorial:mixin_introduction [2025/10/06 03:03] (current) – misc. rephrasings, replaced itemized list with table, add mention of MCDev gauntrecluse | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | FIXME //The Mixin related pages of the Fabric Wiki are undergoing a more thorough review, and are subject to change, rewrites or being replaced. Many pages may be outdated or incomplete. It is strongly recommended to use the Fabric wiki and linked resources to get a rudimentary Mixin understanding, | + | FIXME //The Mixin related pages of the Fabric Wiki are undergoing a more thorough review, and are subject to change, rewrites or being replaced. Many pages may be outdated, inaccurate, inactive |
+ | //This page specifically is under heavy revisions, and may change in large ways almost overnight as a result. Always prioritize learning from the dedicated external Wikis and asking questions in support channels when in doubt// | ||
- | ====== Introduction to Mixins ====== | + | ====== Introduction to Mixins |
- | Mixins are a powerful and important tool used in the Fabric ecosystem. Their primary use case is modifying existing code in the base game, | + | Mixins are a powerful and important tool used in the Fabric ecosystem |
- | whether it be through injecting custom logic, removing mechanics, or modifying values. Note that **mixins must be written in Java**, even if you use Kotlin or another language. | + | whether it be through injecting custom logic, removing mechanics, or modifying values. Note that **only Mixins |
- | Since Fabric Loader 0.15, MixinExtras has become bundled | + | Mixin is a complex subsystem which merges a mod's Mixin " |
- | Since Fabric Loader 0.17.0, MixinExtras 0.5.0 has become bundled in. It mainly adds the ability | + | ((Mixin classes are not classes in the same way as " |
+ | into the targeted classes' | ||
- | //For a more accurate complete walkthrough on Mixin functionality, | + | It is not recommended to try and learn how Mixin works or how to use it without having some notion of what Java bytecode is, as that may lead to unexpected behavior |
+ | Similarly, Mixin and this documentation expects the user to already be familiar with [[tutorial:reading_mc_code|reading Minecraft and external source code]], and be able to set up an initial development environment, | ||
+ | It is recommended to leverage | ||
- | The Fabric Wiki also offers several articles that provide practical examples and explanations: | + | Mixin can do its work throughout the game's lifecycle, however, a mixin must be applied before the targeted class has loaded. For the majority of mixins, this is very early in the overall Fabric launching process, but do mind that the game launching without Mixin crashing or logging warns doesn' |
+ | |||
+ | There are different tools Mixin and MixinExtras | ||
+ | ((Since Fabric Loader 0.15, MixinExtras is bundled with Fabric. Since Loader version 0.17.0, MixinExtras major version 0.5.0 is included, and allows access to [[https:// | ||
+ | provide for modifying source code. Those tools are usable by the users in the form of Java annotations, | ||
+ | |||
+ | Here is a cursory overview of some of Mixin' | ||
+ | FIXME //There ought to be dedicated pages going more in depth about the different tools annotations later on. This segment as it is edited should be kept to a cursory overview of Mixin(Extras) features.// | ||
+ | |||
+ | ^ Feature ^ Overview ^ Notes ^ | ||
+ | | '' | ||
+ | | Merging | Mixin merges a Mixin class' | ||
+ | | Injectors | Methods and a decorating annotation which creates a set of instructions that call back (called a " | ||
+ | | Redirectors/ | ||
+ | | Overwrites | Done via '' | ||
+ | |||
+ | //For more complete and thorough information on Mixin functionality, | ||
+ | |||
+ | The Fabric Wiki offers several articles that provide practical examples and explanations | ||
* [[tutorial: | * [[tutorial: | ||
* [[tutorial: | * [[tutorial: |
tutorial/mixin_introduction.1758640405.txt.gz · Last modified: 2025/09/23 15:13 by gauntrecluse