"Fail Silently" Mixins

I have a mixin that often conflicts with other mods. Since my mixin isn’t very important for the functionality of my mod, I want it to simply be skipped if it throws an InvalidInjectionException or anything. Is there a way to do this?

Hello!
You can’t directly catch InvalidInjectionException in Mixin, but you can make your mixin optional by using require = 0 in your @Inject annotations so failed injections are skipped silently. For more control, you can use a Mixin plugin’s shouldApplyMixin method or @Pseudo to conditionally apply mixins only when safe, ensuring conflicts don’t crash your mod.