How to make compatible with CommandPack plugin?

Hi there!

I’m developing my plugin (here’s the link: GitHub - TonisfelTr/LoreWriter at master). When I start the server separately from CommandPack (Semenkovsky_Ivan / CommandPack), both plugins work fine individually. But if I run the server with both plugins installed simultaneously, it crashes immediately with the following error:

[Server thread/FATAL]: Mixin apply failed commandpack.mixins.forge.json:game.MixinPortalShapeImpl → net.minecraft.world.level.portal.PortalShape: org.spongepowered.asm.mixin.transformer.throwables.InvalidMixinException @Shadow method createPortalBlocks in commandpack.mixins.forge.json:game.MixinPortalShapeImpl was not located in the target class net.minecraft.world.level.portal.PortalShape. No refMap loaded.

Full error excerpt:

org.spongepowered.asm.mixin.transformer.throwables.InvalidMixinException: @Shadow method createPortalBlocks in commandpack.mixins.forge.json:game.MixinPortalShapeImpl was not located in the target class net.minecraft.world.level.portal.PortalShape. No refMap loaded.
at org.spongepowered.asm.mixin.transformer.MixinPreProcessorStandard.attachSpecialMethod(MixinPreProcessorStandard.java:442)
at org.spongepowered.asm.mixin.transformer.MixinPreProcessorStandard.attachShadowMethod(MixinPreProcessorStandard.java:415)
at org.spongepowered.asm.mixin.transformer.MixinPreProcessorStandard.attachMethods(MixinPreProcessorStandard.java:343)
at org.spongepowered.asm.mixin.transformer.MixinPreProcessorStandard.attach(MixinPreProcessorStandard.java:302)
at org.spongepowered.asm.mixin.transformer.MixinPreProcessorStandard.createContextFor(MixinPreProcessorStandard.java:280)
at org.spongepowered.asm.mixin.transformer.MixinInfo.createContextFor(MixinInfo.java:1288)
at org.spongepowered.asm.mixin.transformer.MixinApplicatorStandard.apply(MixinApplicatorStandard.java:201)
at org.spongepowered.asm.mixin.transformer.TargetClassContext.apply(TargetClassContext.java:398)
at org.spongepowered.asm.mixin.transformer.TargetClassContext.applyMixins(TargetClassContext.java:380)
at org.spongepowered.asm.mixin.transformer.MixinProcessor.applyMixins(MixinProcessor.java:363)
at org.spongepowered.asm.mixin.transformer.MixinTransformer.transformClass(MixinTransformer.java:250)

Versions used:

  • Minecraft: 1.21.4
  • Forge: 54.1.0
  • SpongeForge: 1.21.4-54.0.12-14.0.0-RC2168

What could cause this conflict? Am I doing something incorrectly with my plugin or is there an incompatibility between the two plugins?

May want to report it to the commandpack github as im not seeing anything that should block command packs mixins from applying in your code

Hello!
This is a Mixin conflict where CommandPack’s Mixin (MixinPortalShapeImpl) can’t find the createPortalBlocks method in PortalShape because a RefMap isn’t loaded when both LoreWriter and CommandPack are running. While each works individually, running them together causes a crash. Ensure both plugins target the same Minecraft version and report this conflict to both plugin developers. As a temporary and risky measure, you could explore Mixin exclusions in your LoreWriter config, but this might break your plugin’s functionality. The developers are best suited to provide a proper fix.