tutorial:mixin_introduction
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revision | |||
| tutorial:mixin_introduction [2025/10/20 00:15] – Clarify wording for redirectors "notes" section in table gauntrecluse | tutorial:mixin_introduction [2025/11/21 00:24] (current) – Rephrase and abbreviate some parts 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, inaccurate, inactive 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 or incomplete. It is strongly recommended to use the Fabric wiki and linked resources to get a rudimentary Mixin understanding, |
| - | //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 (WIP) ====== | ====== Introduction to Mixins (WIP) ====== | ||
| Mixins are a powerful and important tool used in the Fabric ecosystem and other modding frameworks for Minecraft. Their primary use case is modifying existing code in the base game, | Mixins are a powerful and important tool used in the Fabric ecosystem and other modding frameworks for Minecraft. Their primary use case is modifying existing code in the base game, | ||
| - | whether it be through injecting custom logic, removing mechanics, or modifying values. Note that **only Mixins written in Java are directly supported**, | + | whether it be through injecting custom logic, removing mechanics, or modifying values. Note that **only Mixins written in Java are directly supported**, |
| - | Mixin is a complex subsystem which merges | + | Mixin is a complex subsystem which uses a mod's Mixin classes |
| - | ((Mixin classes are not classes in the same way as " | + | ((Mixin classes are not classes in the same way as " |
| - | into the targeted classes' | + | to transform |
| - | It is not recommended to try and learn how Mixin works or how to use it without | + | It is not recommended to try and learn how Mixin works or how to use it without |
| - | Similarly, Mixin and this documentation expects the user to already be familiar with [[tutorial: | + | Similarly, Mixin and this documentation expects the user to already be familiar with [[tutorial: |
| - | It is recommended to leverage the [[https://plugins.jetbrains.com/plugin/ | + | It is recommended to leverage the [[https://mcdev.io/|Minecraft Development plugin by demonwav on IntelliJ]] (AKA MCDev) for Mixin development to benefit from its autocompletion, error highlighting, |
| - | 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' | + | Mixin can do its work throughout the game's lifecycle, however, a Mixin' |
| There are different tools Mixin and MixinExtras | 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:// | ((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. Most of these tools are provided to the users in the form of Java annotations, | + | provide for modifying source code. Most of these tools are provided to the users in the form of Java annotations, |
| - | Here is a cursory | + | As to make reading more precise documentation easier, here is a basic 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.// | 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 ^ | ^ Feature ^ Overview ^ Notes ^ | ||
| - | | '' | + | | '' |
| - | | Merging | Mixin merges a Mixin class' | + | | Merging | Mixin merges a Mixin class' |
| - | | Injectors | Methods and a decorating | + | | Injectors | An injector typically refers to an annotation |
| - | | Redirectors(rarely called Redirect Injectors) | Similar to injectors as described above, with the important difference that redirectors replace the target instructions with the callback, rather than only injecting new instructions. This makes it impossible | + | | Redirectors(rarely called Redirect Injectors) | Similar to injectors as described above, with the important difference that redirectors replace the target instructions with the callback, rather than only injecting new instructions. This makes it impossible |
| - | | Overwrites | + | | Overwriting |
| - | //For more complete | + | //For more complete information on Mixin functionality |
| The Fabric Wiki offers several articles that provide practical examples and explanations of some areas of Mixin and MixinExtras: | The Fabric Wiki offers several articles that provide practical examples and explanations of some areas of Mixin and MixinExtras: | ||
| Line 40: | Line 39: | ||
| * [[tutorial: | * [[tutorial: | ||
| * [[tutorial: | * [[tutorial: | ||
| - | * [[tutorial: | + | * [[tutorial: |
| * [[tutorial: | * [[tutorial: | ||
| * [[tutorial: | * [[tutorial: | ||
| - | * [[tutorial: | + | * [[tutorial: |
| * [[tutorial: | * [[tutorial: | ||
| * [[tutorial: | * [[tutorial: | ||
| * [[tutorial: | * [[tutorial: | ||
tutorial/mixin_introduction.txt · Last modified: 2025/11/21 00:24 by gauntrecluse