Class SessionData
java.lang.Object
net.neoforged.neoforge.attachment.AttachmentHolder
net.neoforged.neoforge.attachment.SessionData
- All Implemented Interfaces:
IAttachmentHolder
- Direct Known Subclasses:
ClientSessionData, ServerSessionData
A SessionData is a "special" attachment holder that lives for the lifetime of a game session.
On the server, it is bound to the MinecraftServer. On the client, it's bound to the ClientPacketListener.
It allows you to manage data that is scoped to the session (rather than a particular Level), on both the client and the server.
Both synchronized and persistent attachments are supported. If an attachment is both synchronized and persistent, it will only be serialized on the server.
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class AttachmentHolder
AttachmentHolder.AsField -
Field Summary
Fields inherited from class AttachmentHolder
attachments, ATTACHMENTS_NBT_KEY -
Constructor Summary
Constructors -
Method Summary
Methods inherited from class AttachmentHolder
deserializeAttachments, deserializeAttachments, getAttachmentMap, getData, getExistingDataOrNull, getExposedHolder, hasAttachments, hasData, removeData, serializeAttachments, serializeAttachments, setDataMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface IAttachmentHolder
getData, getExistingData, getExistingData, getExistingDataOrNull, hasData, removeData, setData, syncData, syncData
-
Constructor Details
-
SessionData
-