Mod conflicts

OptiFabric Crash: Cannot Invoke class_5944.setSampler Because shaderinstance Is Null

What it looks like in the log

java.lang.NullPointerException: Cannot invoke "net.minecraft.class_5944.setSampler(int, Object)" because "shaderinstance" is null

How to fix it

  1. Remove both OptiFabric and the OptiFine JAR from your mods folder, and use native Fabric alternatives like Sodium and Iris Shaders (along with Entity Model Features and Entity Texture Features if you use OptiFine resource packs).
  2. If you want to keep OptiFabric, check the '-- Last reload --' section near the bottom of your crash report for 'Recovery: Yes' and disable any custom resource packs listed under 'Packs'.
  3. Remove Fabric HUD, inventory, or rendering mods that conflict with OptiFabric's resource loader—such as ChestTracker, Horse Stats Vanilla, or mods bundling LibGui—and test loading a world to isolate the conflicting mod.
  4. Ensure your OptiFabric, OptiFine, and Fabric API versions match your exact Minecraft version, or downgrade Fabric API if a newer update broke compatibility with your OptiFabric release.
LoadersFabric
SeverityStops the game
CategoryMod conflicts

Check your own log

Related errors