Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Featured Replies

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?

  • Author

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.

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.

  • Author

I put that into my Main class and changed what I needed and it doesn't seem to be working, still invisible.

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.

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.

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

Important Information

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

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.