Jump to content

Entity Throwable Rendering problems


Recommended Posts

I currently have 2 throwable entities made, but for some reason I cannot render both at once.  For some reason, the one RenderSnowball I have renders for all entity throwable. Although, when I spawn multiple of the entities at once, it is half correct, half incorrect textures.  Here is how I register them



RenderingRegistry.registerEntityRenderingHandler(EntityGrenade.class, new RenderSnowball(ItemManager.grenade));

RenderingRegistry.registerEntityRenderingHandler(Caterpillar.class, new RenderCaterpillar(new ModelCaterpillar(), 0));

RenderingRegistry.registerEntityRenderingHandler(Coyote.class, new RenderCoyote(new ModelCoyote(), 0));

RenderingRegistry.registerEntityRenderingHandler(EntityPepperSpray.class, new RenderSpray());




Is there any way I can fix this problem?  If I can't fix it using RenderSnowball, is there any way I can make a 2D model?

Thanks for your help.

Link to comment
Share on other sites

This is how I register it


public static void registerEntity() {

createEntity(Caterpillar.class, "Caterpillar", 0x66FF00, 0x000000);

createEntity(Coyote.class, "Coyote", 0x5E0F0F, 0 );

createEntity(EntityGrenade.class, "Grenade");

createEntity(EntityPepperLightning.class, "Peppa Lightning");

createEntity(EntityPepperSpray.class, "Pepper Spray");


}//end registerEntity




public static void createEntity(Class entityClass, String entityName) {

    int entityId = EntityRegistry.findGlobalUniqueEntityId();

    EntityRegistry.registerModEntity(entityClass, entityName, entityId, MainRegistry.modInstance, 64, 1, true);



Link to comment
Share on other sites

This is the one I use for Mob/Animal entities.  Also, if I get rid of the findUniqueGlobalEntityID, It doesn't work


public static void createEntity(Class entityClass, String entityName, int solidColor, int spotColor) {

int entityId = EntityRegistry.findGlobalUniqueEntityId();

    EntityRegistry.registerGlobalEntityID(entityClass, entityName, entityId);

    EntityList.entityEggs.put(Integer.valueOf(entityId), new EntityList.EntityEggInfo(entityId, solidColor, spotColor));



Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...

Important Information

By using this site, you agree to our Terms of Use.