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

I'm trying to set a renderpass model to the player so I can render custom 3d armor. all i managed to do so far is  something like this :

 

 

this code does the trick. it will give some problems with crouching, and size related issues, but those are fixed easely.

if(evt.stack != null){
		armor = ForgeHooksClient.getArmorModel(player, evt.stack, evt.slot, beastarmor);
		mc.renderEngine.func_110577_a(new ResourceLocation("armor:beast_3.png"));
		evt.renderer.setRenderPassModel(armor);
	}

 

 

old wrong code:

 

public void PlayerRender(RenderPlayerEvent.SetArmorModel evt ){

	EntityPlayer player = evt.entityPlayer;
	main = evt.renderer.modelBipedMain;

	/*===== RENDERING ARMOR=====*/

	if(evt.slot == 3){
		if(evt.stack != null){
			if(evt.stack.getItem() == mod_RpgInventory.beastHood){
				mc.renderEngine.func_110577_a(new ResourceLocation("armor:beast_3.png"));
				beastarmor.render(player, 0, 0, 0, 0, 0, 0.0625f);
				//evt.renderer.setRenderPassModel(beastarmor); < this line doesnt change anything. code is crap or code doesnt work ?
			}
		}
	}

 

which effectively renders the armor, but it does not move around with the player itself. it does however turn left or right, but the spaulders dont move along with the arms, nor do the horns on the head turn around with the player's head movement.

 

any help is welcome x__x

 

thank you !

Not sure which version of Forge you're using, but if you're using at least 871 it looks like they've added some hooks into RenderBiped to allow for setting custom armor models:

modelbiped = ForgeHooksClient.getArmorModel(par1EntityLiving, itemstack, par2, modelbiped);
this.setRenderPassModel(modelbiped);

Which links to:

public static ModelBiped getArmorModel(EntityLivingBase entityLiving, ItemStack itemStack, int slotID, ModelBiped _default)
{
   ModelBiped modelbiped = itemStack.getItem().getArmorModel(entityLiving, itemStack, slotID);
   return modelbiped == null ? _default : modelbiped;
}

Looks like you can now return a custom model from your ItemArmor class. From there your custom render for your armor model should be called, judging by the next line.

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.