Posted April 24, 201411 yr Hey, I want to render my projectile as a simple item icon. What's the best way to do this?
April 24, 201411 yr Use RenderSnowball. See here for more information. http://i.imgur.com/NdrFdld.png[/img]
April 24, 201411 yr Author Good work there! Thank you! Another question: Do you know how to create the render without having an item (just the texture) ?
April 25, 201411 yr Author If I want to add one more projectile it is always rendered as the previously..
April 25, 201411 yr Good work there! Thank you! Another question: Do you know how to create the render without having an item (just the texture) ? You will have to use the Tessellator to draw it, like vanilla does when rendering an IIcon texture. Another option is to use a model and let the model renderer do the work for you. While the 1.7.2 code for my mod isn't up yet (dang GitHub), the rendering code hasn't changed all that much from 1.6.4, and I've got plenty of projectile entities that you could look at for inspiration: https://github.com/coolAlias/ZeldaSwordSkills If I want to add one more projectile it is always rendered as the previously.. Make sure you're not using "static" for things in your render or entity. That's the best advice I can give without seeing any code. http://i.imgur.com/NdrFdld.png[/img]
April 26, 201411 yr Could you give me an example? Did you not find any in the github repository? There are lots of examples in there. Or look at the RenderSnowball code, or any of the other vanilla Minecraft projectile rendering classes. Are those not enough examples? http://i.imgur.com/NdrFdld.png[/img]
April 26, 201411 yr Author Yes, but the problem is that my next projectile is rendered as this one before.. EntityRegistry.registerModEntity(EntityMyItem.class, "MyItem", EntityRegistry.findGlobalUniqueEntityId(), this, 64, 10, true); EntityRegistry.registerModEntity(EntityMySecondItem.class, "MySecondItem", EntityRegistry.findGlobalUniqueEntityId(), this, 64, 10, true); RenderingRegistry.registerEntityRenderingHandler(EntityMyItem.class, new RenderSnowball(Items.egg)); RenderingRegistry.registerEntityRenderingHandler(EntityMySecondItem.class, new RenderSnowball(Items.fire_charge));
April 26, 201411 yr Don't use "EntityRegistry.findGlobalUniqueEntityId()" with registerModEntity - that's completely different. What I do is create a local "int entityIndex = 0" and use that as "entityIndex++" for the id of each mod entity. int entityIndex = 0; EntityRegistry.registerModEntity(EntityMyItem.class, "MyItem", entityIndex++, this, 64, 10, true); EntityRegistry.registerModEntity(EntityMySecondItem.class, "MySecondItem", entityIndex++, this, 64, 10, true); http://i.imgur.com/NdrFdld.png[/img]
April 26, 201411 yr Author I use EntityRegistry.findGlobalUniqueEntityId() at EntityRegistry.registerGlobalEntityID too. Is this wrong?
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.