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

Hi

 

RenderPlayer.renderFirstPersonArm() is the place I think you need

 

See also

ItemRenderer.renderItemInFirstPerson

EntityLivingBase.getSwingProgress

 

 

-TGG

 

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

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.