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

Hey guys!

I was looking for a custom renderer for my armor and I found this method in the Item class :

public ModelBiped getArmorModel(EntityLiving entityLiving, ItemStack itemStack, int armorSlot){
   return null;
}

To do that you need to create a new class that extends ModelBiped :

public class MyCustomArmorRender extends ModelBiped{
      public MyCustomArmorRender(){
            //load the normal player model from ModelBiped
            super();
      }
      
      //self explaining
      public void render(Entity par1Entity, float par2, float par3, float par4, float par5, float  par6, float par7){

      }
}

.....and thanks to the 'Advanced model loader' in Forge you can render a wavefront object for your armor.

If you are done with your render you can bind the texture for the model with :

public String getArmorTexture(ItemStack stack, Entity entity, int slot, int layer){

}

in the Item class. Put 'return new MyCustomArmorRender();' into the 'getArmorModel' method.

(I hope it was not pure luck that it worked for me, correct me if I'm wrong)

 

  • 1 month later...

I tried to reproduce this by myself.

But I'm running into some errors, so if you could specify them a little more I'd be thankful.

 

1. Do I have to make my Items class extend Item or ItemArmor (ran in some errors with the renderIndex while having it extend ItemArmor)? You obviously can't wear an Item so I tried it with the isValidArmor() method (it worked).

 

2. In the render() method in the ModelBiped extending class, do you render the ModelBiped model AND your model (btw I'm using normal techne made models, so I'm loading them in the constructor too) or something else?

 

At the moment nothing renders when I put on my item (or at least is invisible ^^) but I really hope that you can clarify this because it sounds very good to me at the moment.

And no my name is not inspired by DBZ ^^

  • 2 weeks later...

Sir could you explain it a little further it wont work on me

and what do you mean by that Tutorial button ?

 

Sir could you explain it a little further it wont work on me

and what do you mean by that Tutorial button ?

We have a wiki for tutorials. This board is for people who need help. We appreciate the tutorial, but this is not the place for it.

BEWARE OF GOD

---

Co-author of Pentachoron Labs' SBFP Tech.

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.