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

Hello, I'm trying to render a custom item. I've completed the 3rd person rendering without a problem. However, I cannot get the renderer to work for third person as there are some variables I am missing. To test the item renderer I've simply copied the code from ItemRenderer, I will change this later to suit the mod. The code uses variables either private in the ItemRenderer class or passed into the method. The variables are equippedProgress, prevEquippedProgress and the partial tick. How can I access these variables from my custom ItemRenderer?

 

EDIT: No matter what I seem to do in my first person section, nothing seems to change..

@Override
public void renderItem(ItemRenderType type, ItemStack item, Object... data) {
	EntityLivingBase par1EntityLivingBase = (EntityLivingBase) data[1];
	switch (type) {
	case EQUIPPED: {
                    // This works
	}
	case EQUIPPED_FIRST_PERSON: {
                    // How can I get this to work? links?
	}
	default:
		break;
	}
}

Hi

 

I'm not sure why you need equippedProgress and prevEquippedProgress?  - these are used by the rendering code to position the player's arm (and item) before control passes to your custom renderer, so you don't really need to worry about it?

 

Perhaps if you could describe in a bit more detail what you're trying to do?

 

There are a few links below which might (or might not..) be helpful

http://greyminecraftcoder.blogspot.com.au/2013/08/rendering-first-person-view-items.html

http://greyminecraftcoder.blogspot.com.au/2013/09/custom-item-rendering-using.html

http://greyminecraftcoder.blogspot.com.au/2013/09/sample-code-for-rendering-items.html

 

Cheers

  TGG

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.