Access widener or class tweaker not working
Checked against Fabric’s documentation on 2 November 2026.
An access widener makes a private or final part of Minecraft’s code usable from your mod. Fabric now calls the file a class tweaker, because it can do more than widen access (Fabric: Class Tweakers). If your code still can’t see the member, or the game won’t start, check these.
1. The file is named in two places
Section titled “1. The file is named in two places”Both are needed (Fabric: Class Tweakers):
loom { accessWidenerPath = file("src/main/resources/example-mod.classtweaker")}"accessWidener": "example-mod.classtweaker"The keys keep the old “access widener” name, for backwards compatibility.
2. The first line is right for your version
Section titled “2. The first line is right for your version”| Your setup | First line |
|---|---|
| Minecraft 26.1 and newer | classTweaker v1 official |
| Class tweaker before 26.1 (Linen’s Fabric templates) | classTweaker v1 named |
| Older access widener (Linen’s Quilt and Legacy Fabric templates) | accessWidener v2 named |
When you port to 26.1, change named to official in the first line
(Fabric: Porting to 26.1). Class tweakers need Fabric Loader 0.18.0
and Loom 1.12 or newer (Fabric: Class Tweakers).
3. The targets are written the right way
Section titled “3. The targets are written the right way”From Fabric: Access Widening:
- Classes use internal names: slashes, not dots (
net/minecraft/...), and$before an inner class. - Fields and methods need the class name, the member’s name and its bytecode descriptor.
accessibleworks on classes, methods and fields;extendableon classes and methods;mutableon fields.- It only works on Minecraft’s own classes, not on other mods. For another mod’s private members, use an accessor mixin.
- The names must be the ones for your version. After moving from Yarn to Mojang names, migrate this file too with
migrateClassTweakerMappings(Loom’s migrateMappings task).
4. Validate the file
Section titled “4. Validate the file”An entry that points at something that doesn’t exist is ignored without an error. To check every entry:
./gradlew validateAccessWidenerThe errors point to the bad entry, though not always to the bad part of it (Fabric: Class Tweakers).
5. Refresh after a change
Section titled “5. Refresh after a change”Refresh the Gradle project and regenerate sources, then reopen the class you changed (Fabric: Access Widening, Generating Sources).
In Linen
Section titled “In Linen”- Every Fabric project from New mod has a class tweaker already named in both places, with the right first line for its version.
- Minecraft’s code browses the decompiled game for your project’s version, on your machine, so you can find the exact class, member and descriptor.
- Hovers show names in Mojang, Yarn, intermediary and Parchment, where the version has them.