Posted April 19, 201411 yr I been trying to figure out how to change the default item swing of Minecraft (Where you just hack and slash) to where the item will follow the path of the mouse cursor (similar to how the Wii Sport's sword worked). Right now I've been trying to find the related class(s) to see how the vanilla animation works. So far, it seems that the EntityOtherPlayerMP and WorldClient class might be it. Am I looking in the wrong classes, and any advice on how I could create the new animation?
April 19, 201411 yr Hi RenderPlayer.renderFirstPersonArm() is the place I think you need See also ItemRenderer.renderItemInFirstPerson EntityLivingBase.getSwingProgress -TGG
April 19, 201411 yr Assuming you want to continue to use a straight arm model (instead of creating an articulating one with an elbow) then as TGG says it is in the RenderPlayer class in the renderFirstPersonArm() method, but the actual work of setting the rotations is in the ModelPlayer class in the setRotationAngles() method. If you look at that method, it only really moves the rotationAngleX for the arm whereas you probably need to also use at least rotationAngleY as well. I'm not really certain how easy it would be to override all this but I assume you have to subscribe to the RenderPlayerEvent (which is cancelable which means you can fully replace with your own handler). In that one you'll have to invoke your own renderer which will have to invoke your own model. The good news is I think you can mostly copy the existing player renderer and model and just make the edits you want. Check out my tutorials here: http://jabelarminecraft.blogspot.com/
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.