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 don't need to be able to use 2 different weapons at once, just the same weapon in both hands when you're using it. Is there a simple way to do this?

You'd need to create your own player render, or just a crazy item render that makes the weapon appear in both hands, but really not.

 

The left hand is un-used in Minecraft unless you override the player render and create your own render.

  • Author

So for my mod I am using my own Player Renderer, so that's not a problem. Currently I have been able to add a second weapon in the player's hand, but It only works in 3rd person. It doesn't show up in 1st person. Also, I can't get the player's left hand to rotate like it does when you're holding something. (Interesting thing there, there's already code for it in the model file.) But it won't work.

public void doRenderCustom(AbstractClientPlayer par1AbstractClientPlayer, double par2, double par4, double par6, float par8, float par9)
{
	if (MinecraftForge.EVENT_BUS.post(new RenderPlayerEvent.Pre(par1AbstractClientPlayer, this, par9))) return;
	GL11.glColor3f(1.0F, 1.0F, 1.0F);
	ItemStack itemstack = par1AbstractClientPlayer.inventory.getCurrentItem();
	this.modelArmorChestplate.heldItemRight = this.modelArmor.heldItemRight = this.modelBipedMain.heldItemRight = itemstack != null ? 1 : 0;
	this.modelArmorChestplate.heldItemLeft = this.modelArmor.heldItemLeft = this.modelBipedMain.heldItemLeft = itemstack != null ? 1 : 0;

	if (itemstack != null && par1AbstractClientPlayer.getItemInUseCount() > 0)
	{
		EnumAction enumaction = itemstack.getItemUseAction();

		if (enumaction == EnumAction.block) 
		{
			this.modelArmorChestplate.heldItemRight = this.modelArmor.heldItemRight = this.modelBipedMain.heldItemRight = 3;
		}
		else if (enumaction == EnumAction.bow)
		{
			this.modelArmorChestplate.aimedBow = this.modelArmor.aimedBow = this.modelBipedMain.aimedBow = true;
		}
	}

	this.modelArmorChestplate.isSneak = this.modelArmor.isSneak = this.modelBipedMain.isSneak = par1AbstractClientPlayer.isSneaking();
	double d3 = par4 - (double)par1AbstractClientPlayer.yOffset;

	if (par1AbstractClientPlayer.isSneaking() && !(par1AbstractClientPlayer instanceof EntityPlayerSP))
	{
		d3 -= 0.125D;
	}

	super.doRender((EntityLivingBase)par1AbstractClientPlayer, par2, d3, par6, par8, par9);
	this.modelArmorChestplate.aimedBow = this.modelArmor.aimedBow = this.modelBipedMain.aimedBow = false;
	this.modelArmorChestplate.isSneak = this.modelArmor.isSneak = this.modelBipedMain.isSneak = false;
	this.modelArmorChestplate.heldItemRight = this.modelArmor.heldItemRight = this.modelBipedMain.heldItemRight = 0;
	this.modelArmorChestplate.heldItemLeft = this.modelArmor.heldItemLeft = this.modelBipedMain.heldItemLeft = 0;
	MinecraftForge.EVENT_BUS.post(new RenderPlayerEvent.Post(par1AbstractClientPlayer, this, par9));
}

This is what I have in my Custom PlayerRender. The left hand never rotates upward.

 

And for the 1st person part... I have no clue. this is what I have:

public void renderFirstPersonArm(EntityPlayer par1EntityPlayer)
{
	float f = 1.0F;
	GL11.glColor3f(f, f, f);
	this.modelBipedMain.onGround = 0.0F;
	this.modelBipedMain.setRotationAngles(0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0625F, par1EntityPlayer);
	this.modelBipedMain.bipedRightArm.render(0.0625F);
	this.modelBipedMain.bipedLeftArm.render(0.0625F);
}

And the left hand is really low, and is hidden by the hotbar. ???? I don' know why... Could someone help?

  • Author

I already have. It's wayyyyy to complex of a system than what I need. I don't even know what to do when I look at his code...

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.