Posted July 22, 20205 yr 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.
July 22, 20205 yr 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.