When you mixin into a non-static inner class, the inner class has a hidden field that stores the instance of the outer class. It is a bit tricky to get it but it can be done.
Step one, go to the Forge jar and find the class in question. Open it in Intellij
https://i.imgur.com/Dnrv3Kv.png
https://i.imgur.com/F1bPHRG.png
Next, locate the srg name of the field that holds the outer class. Here, for Wandering Goal in bee Entity, the field is field_226508_a_
https://i.imgur.com/Yy3Ynfa.png
Now use Intellij's bytecode viewer on the inner class in your development environment and find the in-dev name of the field that holds the outer class instance. Here, it is called this$0
.
https://i.imgur.com/pmBoDyZ.png
Now make your mixin shadow that field using the aliases to the srg name. The name of the field should be the bytecode viewer in-dev name.
@Final
@Shadow(aliases = "field_226508_a_")
private BeeEntity this$0;
This should now work to grab the field in both dev and prod environments and you can use it for whatever you need it for.
Step one, use Intellij's bytecode viewer on the inner class and find the intermediary name of the field that holds the outer class instance. Here, for Bee Wander Around Goal in bee Entity, the field is field_20380
https://i.imgur.com/lvjjOMU.png
Now make your mixin shadow that field using the aliases to the intermediary name. The name of the field should be called the same name. You need the aliases to get the compilier to stop complaining about the field not existing when it does.
@Final
@Shadow(aliases = "field_20380")
private BeeEntity field_20380;
https://gist.github.com/TelepathicGrunt/3784f8a8b317bac11039474012de5fb4