Jump to content

Recommended Posts

Posted

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?

Posted

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.

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...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



×
×
  • Create New...

Important Information

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