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

As the title says, I want to return a .json model in third person. How would I be able to check if I was in third person and change the ModelResourceLocation of an item? I have the model, I just need to know if this is possible and if players on a multiplayer server would be able to see the third person model rather than the first person model. If I could also add that I would like to also return a texture rather than a model for the inventory (Gui) view. Thanks all in advance!

Development of Plugins [2012 - 2014] Development of Mods [2012 - Current]

I did it in my item class, override getModel method:

@Override
@SideOnly(Side.CLIENT)
public ModelResourceLocation getModel(ItemStack stack, EntityPlayer player, int useRemaining) {
	Minecraft mc = Minecraft.getMinecraft();
	boolean isFirstPersonView = mc.thePlayer.getUniqueID().equals(player.getUniqueID()) &&
			mc.gameSettings.thirdPersonView == 0;
	if(isFirstPersonView) {
		return /* some resource */
	} else {
		return /* some other resource */
	}
}

 

Author of Tao Land Mod.

width=200 height=69http://taoland.herbix.me/images/1/14/TaoLandLogo.png[/img]

Also, author of RenderTo

----

I'm not an English native speaker. I just try my best.

  • Author

That looks like that'll work! I thought about doing exactly that, but I wanted to make sure it was fullproof. May I ask why you are checking the player's unique ID? Thanks so much for the response!

Development of Plugins [2012 - 2014] Development of Mods [2012 - Current]

Sure.

These code works on client side. When rendering other players, they are looked from your eyes. That means they are always in third view. If not check unique ID, other players' item are rendered as first view when you are in first view.

Author of Tao Land Mod.

width=200 height=69http://taoland.herbix.me/images/1/14/TaoLandLogo.png[/img]

Also, author of RenderTo

----

I'm not an English native speaker. I just try my best.

  • Author

Man I sure do appreciate your help! Thanks alot! That cleared up so many things for me.

Development of Plugins [2012 - 2014] Development of Mods [2012 - Current]

Guest
This topic is now closed to further replies.

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.