Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Featured Replies

Posted

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?

  • Author

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  ;)

  • Author

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.

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.

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.

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.

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.

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...

Important Information

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

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.