Jump to content

Recommended Posts

Posted

I am aware capabilities will help me write and store data in my world, but I'm honestly very confused how it works. I am trying to store the spawn point of a entity so whenever I reload the game the entity still knows its spawn point which will be used to find its way back home.

Posted

Although the docs on this is still outdated (my fault for incorrectly basing a branch, causing a larger delay on it), it still is plenty useful. As you said, capabilities are used to store extra information on TileEntities, Entities, ItemStacks, Worlds, and Chunks. You can attach your capability via a provider or by using the attached method to the class (usually on TileEntity and Entity I believe). Basically, it just stores excess information on the object provided. Now capability data is specifically for the logical server as by default, it is not sent to the client. There are three use cases for this information and how to synchronize efficiently without creating a bottleneck is depending on how or what information you sync.

 

Hopefully this gives you a good starting point. As for examples, I think Choonster made a pretty good one (it doesn't matter that it was for a previous version since the implementation of capabilities have still been the same).

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.