Jump to content

Recommended Posts

Posted

Hi Everyone,

 

I have figured out how to change the players model using the ObfuscationReflectionHelper but i have not been able to figure out a way to change the model and texture. Using the method directly below (spoiler 1) the default player texture is overlaid onto the model you choose. Also this method is currently inefficient since I believe it is called multiple times a frame but I am not positive about this.

 

  Reveal hidden contents

 

 

What I want it to do is something more like cancel the player render event and then render my own model in its place using my custom renderer so that I can have custom textures. But I have run into a problem. I know how to cancel the player event but dont know how to add my own renderer in its place after cancelling so that the player model is replaced with the custom one I choose.

 

  Reveal hidden contents

 

 

Im not sure what the problem is since the method addCustomRenderer works perfectly when I use it in my ClientProxy to render my mobs when they are spawned in game. In my ClientProxy I use the following method(s) to register my entities  and this works perfectly where my mobs show up normal and rendered correctly whether i use my custom spawning event or using a monster egg.

 

I have also tried to call my renderer directly in place of the addCustomRenderer Method using -> RenderCustomModel() render = new  RenderCustomModel(new ModelMonster(), "Monster.png", 1f); but this didnt work either. Am I missing something stupid I have been at this for a while.

The ClientProxy Methods

 

  Reveal hidden contents

 

 

my entity renderer class (works) [note**] I removed a function that I use to render custom entity information cause I dont wish to share that and it shouldnt be relevant to my problem

 

  Reveal hidden contents
Posted

I have solved this problem but I do have a question. How do you access the players height and width and the bounding box and the camera zoom. I need to alter these fields to work with my model. I have been trying to figure that out for a while and cant seem to figure it out.

 

My solution (posted below) involves cancelling the default player render and then rendering my own model. The model shows up with the correct texture. I had to change my renderer to extend RendererLivingEntity otherwise if I extend RenderLiving I got a crash Im not sure why. Anyway, this is the solution I came up with below. I do have a question as I have very little experience with changing the player - will my solution work in multiplayer to display the model to other players? Or do I have to do something special to achieve this? Currently I dont have a way to test for this multiplayer behaviour so That is why I am asking.

 

My Renderer

 

  Reveal hidden contents

 

 

ChangePlayerModel Event

 

  Reveal hidden contents

 

Posted

I was wondering if anyone knows how I could access the players height and width of the bounding box and the player camera zoom (i guess its position). I need to alter these fields to work with my model (I need to zoom out the camera (change its position to be farther backwards) and I need to change the height of the players bounding/hitbox and I need to change the location of the + target mouse over icon thing to change the "height" at which the model breaks blocks/hits entities etc. If anyone knows anything about this I would appreciate your input

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.