Hi, hopefully someone can help me out with this.
Situation:
I'm trying to spawn a modified version of an existing Entity (in this case a Rabbit) with simple server-only modifications like Pathfinder etc.
First, I have managed to register it successfully on a SpongeVanilla server (this question has nothing todo with Sponge) via mcp at the EntityList class, the rabbit is visible at the client and everything is working.
Second, now I also want it to spawn on a SpongeForge server, however the field where entities are registered is gone and I cannot register it the same way. (Probably patched somewhere else by Forge)
Question:
How can I register my entity, the CustomRabbit.class, on a Forge server, so that the client sees a ordinary rabbit? It's currently not rendered.
What I have tried:
1. Manually registering the entity
final RegistryNamespaced<ResourceLocation, Class<? extends Entity>> registry = EntityList.REGISTRY;
Results in a NoSuchFieldException.
2. Using the forge EntityRegistry on startup
EntityRegistry.registerModEntity(new ResourceLocation("mymodid", "CustomRabbit"), CustomRabbit.class, "CustomRabbit",1, myModInstance, 50, 20, true);
Results in an error message when the client tries to connect to the server? "Fatally missing registry entries."