Hello,
I am working on a mod in which I would like to add new animations to the player (ex: push a button to rotate the arm up for 1 second). I have spent hours upon hours attempting to get to a point where I am able to control the parts of the character model, but have not had any success.
In my current approach, I have created an ExpressivePlayerModel class which extends PlayerModel. I can manipulate the parts of the player (ModelPart) such as "head," "rightArm," etc. from within this class. Basically what I think I want to do is replace PlayerModel with ExpressivePlayerModel. If I were able to simply change the Minecraft source code, I think this would be solved by changing "PlayerModel" to "ExpressivePlayerModel" in the constructor of PlayerRenderer, but obviously I can not do this.
Based on a few older posts I found on related topics, I think the correct way to go about this is using the RenderPlayerEvent.Pre event. This is where I've been stuck trying different things out for hours with no luck. I tried way too many things to list out here, most recently of which is using an access transformer to make "model" in LivingEntityRenderer public, then in the event do-
event.getRenderer.model = new ExpressivePlayerModel(p_174557_.bakeLayer(p_174558_ ? ModelLayers.PLAYER_SLIM : ModelLayers.PLAYER), p_174558_)
-but I can not even get that to work because I can't figure out how I would get p_174557_ and p_174558_.
One last note, this mod is just for a school project, so I don't care if I have to do anything that would not be compatible with other mods and/or have issues with client/server stuff. This won't be used anywhere else, I just need the character to animate on my screen.
Is anything that I've been doing on the right track? And where should I go from here?
Thanks!