Jump to content

[SOLVED] [1.8] Changing Player Skin


EverythingGames

Recommended Posts

Hi

How would I go about changing the player's skin (not using the Mojang servers of course)? I tried binding a pre-made skin during the RenderPlayerEvent.Pre but that seems to do absolutely nothing. Does anyone know how to achieve this without creating a new player model (seems like to much work considering I would probably write a new RenderPlayer class)? Thanks in advance!

Development of Plugins [2012 - 2014] Development of Mods [2012 - Current]

Link to comment
Share on other sites

If you want to do this using vanilla itself - you can.

Look deep into AbstractClientPlayer. Since 1.7 there is whole skin-caching system so idk how to work with it directly, but I did that in 1.6 (changed skin-downloading page). Difference between 1.6 and 1.7 is literally one thing - caching.

 

You will most likely need reflection to access skin fields. You can even change capes.

1.7.10 is no longer supported by forge, you are on your own.

Link to comment
Share on other sites

Thanks for the reply, @Ernio. I didn't have much time today earlier, but I took a quick look around in AbstractClientPlayer, RenderPlayer, and some of the methods in those pertaining to the player skin. The only time it returns a ResourceLocation locally (not downloaded) is when the player uses the default skin - Minecraft has to resort to the Steve / Alex player skin. Maybe I could find the method that returns true or false based on a custom skin and utilize reflection to return false there every time. Then I could again use reflection to change the method that grabs the Steve / Alex player skin and return my own ResourceLocation there. In theory, it might work, I'll try what I said and see if I can figure a solution. If someone has a better one, let me know. Thanks.

Development of Plugins [2012 - 2014] Development of Mods [2012 - Current]

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.

Announcements



×
×
  • Create New...

Important Information

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