Jump to content

Recommended Posts

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]

Posted

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.

Posted

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]

Guest
This topic is now closed to further replies.

Announcements



×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.