Jump to content

[1.7.10]Sending generic entity data that contorls rendering to client side


Mecblader

Recommended Posts

Hello, I am making a mod were I have a block that scans an entity and copies its entity data. Then it uses the entities id to render it on the client side. The problem that I have been experiencing is that I want this to be generic so it would work with entities in other mods, but I'm not sure if there is a generic way to transfer nbt that controls the render of a entity. For example, a sheep, I believe uses nbt to determine what color it is going to render. I know I could hard code that in, but I want to see if there are other option before I do something like this. All help is appreciated, Thank You!

Don't be afraid to ask question when modding, there are no stupid question! Unless you don't know java then all your questions are stupid!

Link to comment
Share on other sites

Again sorry for the delay, but is there some good ways to get the variable or keys that mod authors use for their entities in their mods. I can manage the sending to the client part, but I don't know how to specific variables to send across. For example, say that a mod adds a entity that is a random color and that color is stored in the nbt data or somthing like that, how would I be able to got that variable generically, without hardcodeing it in. I would like my mod to work with any mod that it installed with, as long as they don't setup their entities weird.

 

Also I would like to know if the method bellow would work for spawning an entity that is part of a mod, if not then could someone tell me a way that could work.

 

Method:

EntityLiving entityLiving = (EntityLiving) EntityList.createEntityByName(this.getEntityData().getString("id"), this.worldObj);

 

Basibally I have a variable that has an entities nbt data stored and in that nbt, there is a key that is labled id, that is the id of the entity. That variable comes from this method: EntityList.getEntityString();

Don't be afraid to ask question when modding, there are no stupid question! Unless you don't know java then all your questions are stupid!

Link to comment
Share on other sites

Sorry I should have been more specific, I meant actually sending the nbt data, but never mind that because I was being a derp and didn't see that ByteBufUtils has a writeTag method. Going to see if it works now.

Don't be afraid to ask question when modding, there are no stupid question! Unless you don't know java then all your questions are stupid!

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.