Skip to content

fix #2

@sebashackLLC

Description

@sebashackLLC

Client crashes on launch: Invalid @overwrite visibility in MixinTextVisitFactory

Environment

  • Minecraft: 1.21.1
  • Fabric Loader: 0.16.9
  • Fabric API: 0.115.4+1.21.1
  • PollosHook: 1.0.0
  • Java: 23-valhalla (OpenJDK 64-Bit Server VM)
  • OS: Windows 10 (amd64)
  • Only mods loaded: Fabric API + PollosHook

Crash Summary

Game crashes during initialization with:

PRIVATE overwrite method visitFormatted in polloshook.mixins.json:render.MixinTextVisitFactory from mod polloshook cannot reduce visibility of PUBLIC target method

Root Cause

  • net.minecraft.text.TextVisitFactory.visitFormatted is public static in 1.21.1
  • Mixin uses @Overwrite with a private static method → violates Mixin visibility rules

Full Error Log

[01:29:32] [Render thread/ERROR] (FabricLoader/Mixin) Mixin apply for mod polloshook failed polloshook.mixins.json:render.MixinTextVisitFactory from mod polloshook -> net.minecraft.text.TextVisitFactory: org.spongepowered.asm.mixin.transformer.throwables.InvalidMixinException PRIVATE overwrite method visitFormatted in polloshook.mixins.json:render.MixinTextVisitFactory from mod polloshook cannot reduce visibiliy of PUBLIC target method

Reproduction

  1. Clone repo: git clone https://github.com/[USER]/polloshook-buildable-main
  2. Run: ./gradlew runClient
  3. Crashes before title screen

Offending Code (MixinTextVisitFactory.java)

@Mixin(TextVisitFactory.class)
public class MixinTextVisitFactory {
    @Overwrite
    private static boolean visitFormatted(...) { ... } // ← PRIVATE = INVALID
}

Fix (One-Line)

@Overwrite
public static boolean visitFormatted(...) { ... } // ← Change to PUBLIC

Alternative (Recommended)

Replace @Overwrite with @Inject:

@Inject(method = "visitFormatted", at = @At("HEAD"), cancellable = true)
private static void modifyVisitFormatted(..., CallbackInfoReturnable<Boolean> cir) { ... }

Full Crash Report

---- Minecraft Crash Report ----
// My bad.
Time: 2025-11-04 01:29:32
Description: Initializing game

java.lang.RuntimeException: Mixin transformation of net.minecraft.text.TextVisitFactory failed
...
Caused by: org.spongepowered.asm.mixin.transformer.throwables.InvalidMixinException: PRIVATE overwrite method visitFormatted in polloshook.mixins.json:render.MixinTextVisitFactory from mod polloshook cannot reduce visibility of PUBLIC target method

Full log attached as crash-2025-11-04_01.29.32-client.txt
Additional Warning (Non-Fatal)

[01:29:29] [Render thread/WARN] @Final field fov:Lnet/minecraft/client/option/SimpleOption; in polloshook.mixins.json:option.MixinGameOptions from mod polloshook should be final

Please update MixinTextVisitFactory.java to use public visibility on the @Overwrite method.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions