Taji34 Posted July 15, 2013 Posted July 15, 2013 Hi, I'm wondering how I would go about rendering an entity like a snowball. Like, I've created the entity and it works fine, it's just invisible because the renderer doesn't know how to. What class do I need to make a stuff to register the entity and how to render it in game? Quote
endershadow Posted July 15, 2013 Posted July 15, 2013 I've been wondering that as well, I have the same problem as you. Quote
Taji34 Posted July 15, 2013 Author Posted July 15, 2013 I've been wondering that as well, I have the same problem as you. Yeah, I figure that you have to make a separate class to register the renders in order to not edit core minecraft files, but I'm not quite sure. Quote
gristly Posted July 15, 2013 Posted July 15, 2013 I haven't tested it with 1.6.x yet, but this is the way I've been doing it: public void AddRenderer (Map map) { map.put(EntityGravelChunk.class, new RenderSnowball(GravelChunk)); } In your main class, where the item name inside RenderSnowball() is the name of the item you want the entity to render as. I'm not 100 percent sure that's the method though, so if you know where to put the render stuff and it isn't there, then justput RenderSnowball() for rendering them. Quote
Taji34 Posted July 15, 2013 Author Posted July 15, 2013 I put that into my Main class and changed what I needed and it doesn't seem to be working, still invisible. Quote
gristly Posted July 16, 2013 Posted July 16, 2013 Oops, that mighta been my old code. Try this instead, add these lines to your public void load() method: EntityRegistry.registerModEntity(EntityGravelChunk.class, "GravelChunk", 4, this, 40, 3, true); RenderingRegistry.registerEntityRenderingHandler(EntityGravelChunk.class, new RenderSnowball(GravelChunk)); the variables there in refisterModEntity are the class file for the entity, its "name", its ID, the next one is always this, then the distance that it renders from (if you go farther away you will not be able to see it), then the next one I forget, but I always have it set to 3 so I guess use that, and the last one should always be true. You might have that already, I dunnoh. Quote
endershadow Posted July 16, 2013 Posted July 16, 2013 I figured out why it wasn't rendering for me! not only was I not registering the entities, but I was setting up the render before registering the entities. Quote
Recommended Posts
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.