Jump to content

[SOLVED]Entity not rendering/not detecting collision


battlefield

Recommended Posts

After updating my mod from 1.3.1 to 1.3.2 I can't see my entities in the world even though I can hear them and spawn them with spawning eggs. Anyone else having similar problems? I know it's more of a minecraft problem than a forge problem but still this is a forum on which modders are mostly active.

 

Before asking have you registered the entity inside EntityRegistry and it's render inside RenderingRegistry, yes I did that and I double checked it or asking if I have textures on their apropriate spots, yes I have but even If I wouldn't have them I could see the shadow of that entity.

 

I have allso perfomed some quick tests and it seems like my entity wouldn't even be passed into the loaded entities list.

Link to comment
Share on other sites

the question is here: HOW did you register your entities? A piece of your code would be very helpful then.

Don't ask for support per PM! They'll get ignored! | If a post helped you, click the "Thank You" button at the top right corner of said post! |

mah twitter

This thread makes me sad because people just post copy-paste-ready code when it's obvious that the OP has little to no programming experience. This is not how learning works.

Link to comment
Share on other sites

I registered them in my core class(the initialize method gets called from load method), what I posted are just snippets of the code

 

 

public void initialize()
{
	EntityList.addMapping(DartEntity.class, "Dart", getOrCreatEntityID("Dart", 42));
}

 

 

This method gets called from ClientProxy

 

public void initializeRenders()
{	
	RenderingRegistry.registerEntityRenderingHandler(DartEntity.class, new DartRender());
}

 

Link to comment
Share on other sites

Then you're registering them wrong, at least the first one:

EntityList.addMapping(DartEntity.class, "Dart", getOrCreatEntityID("Dart", 42));

 

You have to use these methods to register your entity properly:

EntityRegistry.registerGlobalEntityID(entity, entityName, EntityRegistry.findGlobalUniqueEntityId());
EntityRegistry.registerModEntity(entity, entityName, id, mod.instance, trackingRange, updateFrequency, sendsVelocityUpdates);

 

so I would say in your case:

EntityRegistry.registerGlobalEntityID(DartEntity.class, "Dart", EntityRegistry.findGlobalUniqueEntityId());
EntityRegistry.registerModEntity(DartEntity.class, "Dart", 0, DartMod.instance, 128, 1, true);

 

The ID in registerModEntity is mod-specific, so your first entity should get 0 as ID, then your second gets 1 as ID and so on.

Don't ask for support per PM! They'll get ignored! | If a post helped you, click the "Thank You" button at the top right corner of said post! |

mah twitter

This thread makes me sad because people just post copy-paste-ready code when it's obvious that the OP has little to no programming experience. This is not how learning works.

Link to comment
Share on other sites

  • 8 months later...

Then you're registering them wrong, at least the first one:

EntityList.addMapping(DartEntity.class, "Dart", getOrCreatEntityID("Dart", 42));

 

You have to use these methods to register your entity properly:

EntityRegistry.registerGlobalEntityID(entity, entityName, EntityRegistry.findGlobalUniqueEntityId());
EntityRegistry.registerModEntity(entity, entityName, id, mod.instance, trackingRange, updateFrequency, sendsVelocityUpdates);

 

so I would say in your case:

EntityRegistry.registerGlobalEntityID(DartEntity.class, "Dart", EntityRegistry.findGlobalUniqueEntityId());
EntityRegistry.registerModEntity(DartEntity.class, "Dart", 0, DartMod.instance, 128, 1, true);

 

The ID in registerModEntity is mod-specific, so your first entity should get 0 as ID, then your second gets 1 as ID and so on.

 

Wow, thanks! This really helped me c:

Link to comment
Share on other sites

Then you're registering them wrong, at least the first one:

EntityList.addMapping(DartEntity.class, "Dart", getOrCreatEntityID("Dart", 42));

 

You have to use these methods to register your entity properly:

EntityRegistry.registerGlobalEntityID(entity, entityName, EntityRegistry.findGlobalUniqueEntityId());
EntityRegistry.registerModEntity(entity, entityName, id, mod.instance, trackingRange, updateFrequency, sendsVelocityUpdates);

 

so I would say in your case:

EntityRegistry.registerGlobalEntityID(DartEntity.class, "Dart", EntityRegistry.findGlobalUniqueEntityId());
EntityRegistry.registerModEntity(DartEntity.class, "Dart", 0, DartMod.instance, 128, 1, true);

 

The ID in registerModEntity is mod-specific, so your first entity should get 0 as ID, then your second gets 1 as ID and so on.

 

Wow, thanks! This really helped me c:

 

heh, it's like a bit outdated :P

Anyway, you need only the registerModEntity now. The registerGlobalEntityID isn't needed anymore and also I don't recommend to use it, because it has an ID limitation of max. 256 IDs.

Don't ask for support per PM! They'll get ignored! | If a post helped you, click the "Thank You" button at the top right corner of said post! |

mah twitter

This thread makes me sad because people just post copy-paste-ready code when it's obvious that the OP has little to no programming experience. This is not how learning works.

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.

Announcements



×
×
  • Create New...

Important Information

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