Class SessionData

java.lang.Object
net.neoforged.neoforge.attachment.AttachmentHolder
net.neoforged.neoforge.attachment.SessionData
All Implemented Interfaces:
IAttachmentHolder
Direct Known Subclasses:
ClientSessionData, ServerSessionData

@NonExtendable public abstract class SessionData extends AttachmentHolder

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:
  • Constructor Details

    • SessionData

      @Internal protected SessionData()