Skip to content

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.

Both are needed (Fabric: Class Tweakers):

build.gradle
loom {
accessWidenerPath = file("src/main/resources/example-mod.classtweaker")
}
fabric.mod.json
"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).

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.
  • accessible works on classes, methods and fields; extendable on classes and methods; mutable on 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).

An entry that points at something that doesn’t exist is ignored without an error. To check every entry:

Terminal window
./gradlew validateAccessWidener

The errors point to the bad entry, though not always to the bad part of it (Fabric: Class Tweakers).

Refresh the Gradle project and regenerate sources, then reopen the class you changed (Fabric: Access Widening, Generating Sources).

  • 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.