Jump to content

A question about Datawatcher and entities


MrCredits

Recommended Posts

Hi everyone.

 

I've been studying the vanilla mob entities source lately. What's utilized frequently is the Datawatcher class. Now, I did some looking into it on my own and learned a bit about how it operates. (Which is I believe to sync entities with the server) Despite that, I have a few questions of my own. Namely:

 

Is my premise on the purpose of Datawatcher incorrect? Please correct me if so/

 

If that is not the case, and Datawatcher is responsible for syncing entities, is it possible to substitute and instead utilize packets?

 

Thanks, I very much appreciate any insight!

 

 

 

 

 

 

Link to comment
Share on other sites

To add to that, I've previously tried to sync server- and client sided entities with packets, but I wasn't able to figure out how to add info in the packet that would identify for which entity the packet was for. There is a thing in entities called the EntityID, but these are different for the client and server (as far as I tested it). Sending the position of the entity with the packet is unreliable, as these are one of the variables that need to be synched, plus it could be very possible that there are two entities at the same position.

 

After all this messing around I found out what datawatchers do ;).

Author of PneumaticCraft, MineChess, Minesweeper Mod and Sokoban Mod. Visit www.minemaarten.com to take a look at them.

Link to comment
Share on other sites

Isn't that the brand new ID used in entity attributes? And isn't that the same for every entity of the same type? But I haven't tested that myself either. Let's stick with datawatchers ;).

Author of PneumaticCraft, MineChess, Minesweeper Mod and Sokoban Mod. Visit www.minemaarten.com to take a look at them.

Link to comment
Share on other sites

wait wait, you guys telling me that entityID ISNT always refering the same entity server and client side ?

 

like suppose i spawn a new derpysquid entity, it *might* not have the same entityID on both side, if not what are you suppose to use to sync entities ? (you mentionned a UUID earlier :\)

how to debug 101:http://www.minecraftforge.net/wiki/Debug_101

-hydroflame, author of the forge revolution-

Link to comment
Share on other sites

Hmm, I was under the impression that each entity had a already unique ID in the world's "loadedentitylist"? Well, perhaps, not the actual entity ID, but rather a hashcode?

 

Anyhow, I'd actually prefer not to use datawatchers. Primarily reason being, like Goto said, most are already occupied by vanilla mobs.

 

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.