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/22 21:35] – Indicate mixin_tips as WIP next to its link 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: | ||
- | ====== Introduction to Mixins ====== | + | FIXME //The Mixin related pages of the Fabric Wiki are undergoing |
- | Mixins | + | //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// |
- | 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 | + | |
- | Since Fabric | + | ====== Introduction to Mixins (WIP) ====== |
- | Since Fabric Loader 0.17.0, MixinExtras 0.5.0 has become bundled | + | Mixins are a powerful and important tool used in the Fabric |
+ | whether it be through injecting custom logic, removing mechanics, or modifying values. Note that **only Mixins written | ||
- | //For a more accurate complete walkthrough on Mixin functionality, | + | Mixin is a complex subsystem which merges a mod' |
+ | ((Mixin classes are not classes in the same way as " | ||
+ | into the targeted classes' | ||
- | The Fabric Wiki also offers several articles that provide practical examples and explanations: | + | 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 and misunderstandings. It is also recommended to know how to read bytecode for your IDE of choice, as reading portions of the Bytecode may sometimes be necessary to use Mixin properly, notably when targeting anonymous classes, lambdas or code with a lot of '' |
+ | Similarly, Mixin and this documentation expects the user to already be familiar with [[tutorial: | ||
+ | It is recommended to leverage the [[https:// | ||
+ | |||
+ | 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.1758576924.txt.gz · Last modified: 2025/09/22 21:35 by gauntrecluse