Accessing a nested class (Sponge Mixin)

I’m trying to access a class defined in another class:

public class ThreadedAnvilChunkStorage {
...
class EntityTracker {
private final Entity entity;
...
public void updateCameraPosition(ServerPlayerEntity player) {...}
}}

The problem is that I can’t use mixin’s normally to try and access it (“ThreadedAnvilChunkStorage.EntityTracker” is not public and cannot be accessed outside of the package). I’ve seen that the targets argument for mixin’s can be used like so, but I haven’t been able to get it working thus far:

@Mixin(targets = "ThreadedAnvilChunkStorage.EntityTracker.class")
public abstract class ThreadedAnvilChunkStorageMixin {
...
}
-> Mixin target ThreadedAnvilChunkStorage.EntityTracker.class could not be found.

What exactly am I missing?
Thanks in advance.

When using targets you should qualify the full classpath like this: the.package.TheClass$TheSubclass. There is net.minecraft.entity.monster.EntityGhast$AILookAround as an example on the top of the issue you linked.

1 Like