Jump to content

Rendering vanilla sword [SOLVED]


Turtledove

Recommended Posts

I'm attempting to cancel the vanilla sword render when the player swings, and replace it with my own. I've subscribed to that event, cancelled it, now I just need to call a render class. What do I need to do from there in terms of registering and calling a renderer?

I'm almost tempted to load in custom models and register them as entities, but I'd rather not do that if I can help it.

Edited by Turtledove
Link to comment
Share on other sites

12 minutes ago, kaydogz said:

I'd look into net.minecraft.client.renderer.FirstPersonRenderer

The issue isn't how to register items or even the rendering step, because I'm using the vanilla items so it's already registered, I'm not sure where the animation logic is done and whether I need to register a renderer for items already registered.

 

I've written a keyframe animation API for my entities but all of that logic is done in the model class depending on model states, but for items, I don't know how Minecraft handles animation on a tick-by-tick basis for equipped items.

Edited by Turtledove
Link to comment
Share on other sites

It looks like I should be able to directly do the rendering from my event handler, but damn it's super finicky. Can't get the arm to show up on screen, but I know it's there because when I look side to side really fast I see it floating there, trailing.

Link to comment
Share on other sites

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.