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

Started by Rikurob on

Topic category: Advanced modding

Last seen on 06:22, 13. Mar 2023
Joined Feb 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
[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
Last seen on 06:22, 13. Mar 2023
Joined Feb 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
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. 

Last seen on 07:30, 24. Sep 2022
Joined Mar 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Very nice
Mon, 08/22/2022 - 12:36

Very nice

Last seen on 06:22, 13. Mar 2023
Joined Feb 2022
Points:

User statistics:

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

Thank you, get it working for you like this?

Last seen on 06:22, 13. Mar 2023
Joined Feb 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
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.

Last seen on 05:23, 27. Dec 2023
Joined May 2020
Points:

User statistics:

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

Is this still working?