PluginSave
What a plugin keeps in a player’s save, through definePlugin’s
save: a kit’s under kits.<name>, on once the game lists the kit; an
engine plugin’s under engine.<name>, off until the game names it in
include.
Type Parameters
Section titled “Type Parameters”| Type Parameter | Default type |
|---|---|
Schema extends SaveSchema |
SaveSchema |
Scope extends SaveScopeName |
SaveScopeName |
Properties
Section titled “Properties”Methods
Section titled “Methods”read()
Section titled “read()”read(
context):input<Schema>
What to keep, as plain JSON: synchronous, and changing nothing. A value its schema or JSON would refuse refuses the whole read.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
context |
SaveContext<Scope> |
Returns
Section titled “Returns”input<Schema>
restore()
Section titled “restore()”restore(
context,saved):void
Puts a loaded state back: a player’s after every onPlayerJoin
and before any onPlayerReady, a saved entity’s as setSavedEntity
registers it, over what its spawn set up, and the world’s as the
record loads. A throw refuses the load.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
context |
RestoreContext<Scope> |
saved |
output<Schema> |
Returns
Section titled “Returns”void