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 all, I am trying to create a custom model for my entity. I am trying to load an obj model. I know I need to use the OBJLoader class during model registration but I cant seem to find a consistent way to do this as it seems to vary between entity types. So far I have a class extending the EntityModel and my entity as a generic. I assume this can then be put into a mob renderer but, again I'm not sure and I just seem to be getting lots of errors.

I'm using the latest stable release 36.1.0.

Any help would be greatly appreciated. 

Edited by henzo800
EDIT: Clarified

  • Author

Thanks for your quick reply spiritfilled. 

However, I'm still not sure how to load an OBJ model. My entity seems to be rendering Minecraft's included models just fine but I want to load an OBJ and MTL stored in the resources. Is there some way to convert an OBJ to parts. Although shouldn't I use the loader outlined in the forge doc's.

Here is my renderer and model so far.

public class CarEntityRender extends MobRenderer<CarEntity, CarModel> {
  
    public CarEntityRender(EntityRendererManager renderManagerIn) {
        super(renderManagerIn, new CarModel(), 1.0F);
    }
	@Override
	public ResourceLocation getTextureLocation(CarEntity p_110775_1_) {
		return new ResourceLocation(STAR.MODID, "textures/entity/red_rack.png");
	}
  
}
public class CarModel extends EntityModel<CarEntity>{

	@Override
	public void setupAnim(CarEntity p_225597_1_, float p_225597_2_, float p_225597_3_, float p_225597_4_,
			float p_225597_5_, float p_225597_6_) {
	}

	@Override
	public void renderToBuffer(MatrixStack p_225598_1_, IVertexBuilder p_225598_2_, int p_225598_3_, int p_225598_4_,
			float p_225598_5_, float p_225598_6_, float p_225598_7_, float p_225598_8_) {	
	}

}

Any help would be appreciated. 

Edited by henzo800
EDIT: Clarified

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.