Jump to content

[1.10] RegisterEntityRenderingHandler


JackTheRedCreeper

Recommended Posts

I've started modding a few days ago (already got my first items, blocks, some crops..).

Now I want to make a simple modification, a craftable, more powerful ghast fireball.

The big problem is, there's no tutorials for 1.10/1.9, and every other tutorial uses registerentityrenderinghandler which is deprecated.

 

I've read something about setting up a factory and anonymous class but I'm just getting more and more lost. Any help?

 

Try to give full info, maybe we can turn this into a refferal for future modders.

Link to comment
Share on other sites

Use

RenderingRegistry.registerEntityRenderingHandler(Class<T>, IRenderFactory<? super T>)

in preInit.

 

IRenderFactory

has a single method that takes the

RenderManager

instance as an argument and creates and returns the instance of your

Render

class. You can implement it using a named or anonymous class (Java 6/7), a lambda or a constructor method reference (Java 8).

 

You can find links to several tutorials here. McJty has a tutorial on mobs here.  You can see how I register the

IRenderFactory

for an entity in my mod here.

 

Edit: Removed unintentional smiley.

Please don't PM me to ask for help. Asking your question in a public thread preserves it for people who are having the same problem in the future.

Link to comment
Share on other sites

Thank you for the links, I'll get working again and see if I can get something done :)

 

I would've stared at the minecraft code but this simply isn't there :D

 

Edit: I think I almost got it, question is, what renderers are out there? I see RenderArrow, RenderFireball..

I guess this is for a custom renderer? I might've stranded off too far, atm I just want to change some code, I don't care about visuals

Link to comment
Share on other sites

Edit: I think I almost got it, question is, what renderers are out there? I see RenderArrow, RenderFireball..

I guess this is for a custom renderer? I might've stranded off too far, atm I just want to change some code, I don't care about visuals

 

Use your IDE to find classes that extend

Render

, or look at the

RenderManager

constructor to see where vanilla creates its

Render

instances.

 

If your entity extends

EntityFireball

and should render like the vanilla fireball, use

RenderFireball

.

Please don't PM me to ask for help. Asking your question in a public thread preserves it for people who are having the same problem in the future.

Link to comment
Share on other sites

Something like this? RenderingRegistry.registerEntityRenderingHandler(CannonBall.class, RenderFireball);

 

This is my first time fiddling with entities. Somewhy, Eclipse won't accept RenderFireball

 

That's not valid Java, a class name isn't a value. You must have a solid understanding of Java and OO programming in general before you can make a mod.

 

You need to create an instance of a class (named or anonymous) that implements

IRenderFactory

and pass it to

RenderingRegistry.registerEntityRenderingHandler

. This class must override

IRenderFactory#createRenderFor

to create and return the

RenderFireball

instance using the provided

RenderManager

instance.

Please don't PM me to ask for help. Asking your question in a public thread preserves it for people who are having the same problem in the future.

Link to comment
Share on other sites

I do have quite hte experience with Expression 2 in Garry's mod, it's just that I don't know what to look for here :x

 

I don't know if studying Java will help me with Forge..

 

 

Edit: Apparently I was just being dumb with the /summon command. The fireball works fine apparently.

 

This render thing seems too complicated, specially if you compare it with items and blocks O.o

Link to comment
Share on other sites

I do have quite hte experience with Expression 2 in Garry's mod, it's just that I don't know what to look for here :x

 

I don't know if studying Java will help me with Forge..

Of course it will, that is the language that minecraft and forge use.

VANILLA MINECRAFT CLASSES ARE THE BEST RESOURCES WHEN MODDING

I will be posting 1.15.2 modding tutorials on this channel. If you want to be notified of it do the normal YouTube stuff like subscribing, ect.

Forge and vanilla BlockState generator.

Link to comment
Share on other sites

I mean studying Java in-depth.

Damn I express myself terribly >-<

 

Like, I might know every notch and cranny about java, but in the end, it's more about forge.

You don't need to know every notch and cranny you just need to know enough to know what you are doing.

VANILLA MINECRAFT CLASSES ARE THE BEST RESOURCES WHEN MODDING

I will be posting 1.15.2 modding tutorials on this channel. If you want to be notified of it do the normal YouTube stuff like subscribing, ect.

Forge and vanilla BlockState generator.

Link to comment
Share on other sites

I do have quite hte experience with Expression 2 in Garry's mod, it's just that I don't know what to look for here :x

 

I don't know if studying Java will help me with Forge..

You can't make a mod without knowing basic concepts like how to implement interfaces.

 

Edit: Apparently I was just being dumb with the /summon command. The fireball works fine apparently.

If you don't register a renderer for your entity, Minecraft will use the one registered for its super class.

Please don't PM me to ask for help. Asking your question in a public thread preserves it for people who are having the same problem in the future.

Link to comment
Share on other sites

Eh whatever, my issue was solved.

I do know Java but I don't know Forge.

 

"Implement an interface" is a Java thing, not a Forge thing. Ye, the interface in question is a Forge-supplied interface, but implementing it requires no special knowledge of Forge.

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

Link to comment
Share on other sites

  • 9 months later...

Y'all are really mean on these freaken forums. Just cause we don't know as much as you doesn't mean y'all need to be all mean about teaching us. Smfh

 

Especially you, Diesieben07. You shouldn't be on these forums if all you do is be mean to people. I've seen you everywhere doing exactly that. It doesn't matter how much you help them. You don't gotta be mean about it.

Edited by RoyalKingZB
Needed to say something else
Link to comment
Share on other sites

  • Guest locked this topic
Guest
This topic is now closed to further replies.


×
×
  • Create New...

Important Information

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