Jump to content

Confused about a value at EntityRegistry.registerModEntity


American2050

Recommended Posts

So I have Created a new mob, kinda copying what a vanilla one does, the problem was that as soon as I was around 8 blocks away on the X or Z axis from the mob, it dissapear (don't render) anymore.

 

EntityRegistry.registerModEntity(entityClass, entityName, ID, SinkMod.instance, 8, 1, true);

 

Is what I had, now I have:

 

EntityRegistry.registerModEntity(entityClass, entityName, ID, SinkMod.instance, 64, 1, true);

 

I thought that number was how far the mob would react to me, like for example, if Im holding food for that mob, he was going to be able to see me from that far, but I guess I'm wrong.

 

Is it ok to have 64 for a mob there? Should it be a higher number?

Link to comment
Share on other sites

It is the tracking range, meaning the range in which clients will be able to see the entity and get notified about changes (e.g. movement). Vanilla mobs use 64.

 

Got you ;)

 

PS: Do you know what should I use in 1.10 instead of the old RenderingRegistry.registerEntityRenderingHandler That's the last think I need to fix I believe.

 

Thanks a lot  ;)

Link to comment
Share on other sites

PS: Do you know what should I use in 1.10 instead of the old RenderingRegistry.registerEntityRenderingHandler

You use the new one instead, same method name, different parameters.

Couldn't find out how to use the one that requieres a IRenderFactory but found out another way to register the renders.

 

I wonder if this could work:

 

RenderManager renderManager = Minecraft.getMinecraft().getRenderManager();
	renderManager.entityRenderMap.put(EntityCopperChicken.class, new RenderCopperChicken(renderManager, new ModelCMDChicken(), 0.3F));

 

I didn't understand the other method and couldn't find any example yet.

Link to comment
Share on other sites

You need to make a class that implements IRenderFactory and if should look something like this

public class CustomModEntityRenderingHandler implements IRenderFactory<CustomModEntity> {

// Should return what you already have to render your Entity
@Override
public Render<? super CustomModENtity> createRenderFor(RenderManager manager) {
	return null;
}     

}

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

You can also do it as an anonymous class.

 

 RenderingRegistry.registerEntityRenderingHandler(Entity.class, new IRenderFactory<CustomModEntity> {
@Override
public Render<? super CustomModENtity> createRenderFor(RenderManager manager) {
	return null;
}
});

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

You can also do it as an anonymous class.

Or a lambda. Or a method reference (which gives the cleanest code I think).

 

How does the method reference version look? I had a devil of a time constructing the anonymous class correctly (and then felt like an idiot afterwards).

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

Aaah, that's what that is. Alright.  I do agree that it's cleaner alright!

 

Didn't work for me cause I'm on Java 7 still, not 8, so it doesn't have that feature (ditto lambdas).

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

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

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