Jump to content

Recommended Posts

Posted

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?

Posted

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.

Posted

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.

Posted

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.

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.

Guest
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.

Announcements



×
×
  • Create New...

Important Information

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