Posted May 8, 201411 yr 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?
May 10, 201411 yr 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.
May 12, 201411 yr 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?
May 12, 201411 yr you could check the battlegear 2 mod (its open source) Only code when your having fun doing it.
May 12, 201411 yr 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.