[TUTORIAL] Basics For Rendering An Entity As A Player Model Example

Started by Rikurob on

Topic category: Advanced modding

Active 2 years ago
Joined Feb 2022
Points:
619

User statistics:

  • Modifications: 1
  • Forum topics: 13
  • Wiki pages: 0
  • MCreator plugins: 0
  • Comments: 161
[TUTORIAL] Basics For Rendering An Entity As A Player Model Example
Mon, 08/22/2022 - 14:31 (edited)

This is a copy of my NPCEntityRenderer.java file for my upcoming mod Personas. This code renders the entity with the Player Model by extending HumanoidMobRenderer instead of something else, allowing the user to set the entity to use player skins.

Just replace the imports with your respective imports, NPCEntity with YourEntityNameEntity, the texture with the location of the skin texture you want to use, and plug this into your Entity Renderer.

Notes:

  • Some of the imports are currently unused. I haven't working out crossbow charging as of yet but I am working on it, but I gave up for now and wanted to post this as is lol. I believe I have to edit the NPCEntity.java for that.
  • Attacking with a bow must be set in your NPCEntity.java, not the renderer. This would only render the bow in the correct position.
  • I'm sure there is stuff I left out of this, but this is the basics for how to make your entity look like the player
  • Let me know if you have any questions.

Image

Image

 

Edited by Rikurob on Mon, 08/22/2022 - 14:31
Active 2 years ago
Joined Feb 2022
Points:
619

User statistics:

  • Modifications: 1
  • Forum topics: 13
  • Wiki pages: 0
  • MCreator plugins: 0
  • Comments: 161
You could add a skin…
Sun, 08/21/2022 - 18:48

You could add a skin randomizer to your entity, and set the value to your entity, and call that value as the skin texture as well if you wanted to randomize textures from a list of textures that you could set either in that file or in a config file. 

Active 2 years ago
Joined Feb 2022
Points:
619

User statistics:

  • Modifications: 1
  • Forum topics: 13
  • Wiki pages: 0
  • MCreator plugins: 0
  • Comments: 161
Thank you, get it working…
Mon, 08/22/2022 - 14:29

Thank you, get it working for you like this?

Active 2 years ago
Joined Feb 2022
Points:
619

User statistics:

  • Modifications: 1
  • Forum topics: 13
  • Wiki pages: 0
  • MCreator plugins: 0
  • Comments: 161
Yes it is possible! You have…
Mon, 08/22/2022 - 19:50

Yes it is possible! You have to add another layer. I am not exactly sure how to do it but the base to figure it out is there. It would work similar to the way the armor layer does, but you'd have to make a custom layer for it.

Active 1 year ago
Joined May 2020
Points:
664

User statistics:

  • Modifications: 0
  • Forum topics: 5
  • Wiki pages: 0
  • MCreator plugins: 0
  • Comments: 32
Is this still working?
Tue, 12/06/2022 - 05:07

Is this still working?