Storage class

/ The Storage Widget gives you easy tools to store and receive nbt data globally.

Inheritance

Constructors

Storage(String name, {bool autoNamespace = true})
The Storage Widget gives you easy tools to store and receive nbt data globally. A Store takes in a name, by default it already uses the current pack namespace. Example:
Storage.copyData(String name, {bool autoNamespace = true, required String? key, required Data data})
Copies Nbt Data from a Data.get Widget.
Storage.copyScore(String name, {bool autoNamespace = true, double? scale = 1, String? datatype = 'byte', required String? key, required Score? score})
Similar to copyData is copyScore which copies the value of a score into a nbt path.
Storage.get(String name, {bool autoNamespace = true, double? scale = 1, required String? key})
To get a value back, use Storage.get.
Storage.merge(String name, {bool autoNamespace = true, required Map<String, dynamic>? nbt})
But of course you can also insert a Map with multiple keys and values.
Storage.modify(String name, {required String toPath, bool autoNamespace = true, required DataModify modify})
Modifies Nbt Data(look at Data Widget).
Storage.remove(String name, {bool autoNamespace = true, required String? key})
Removes certain Nbt Data.
Storage.set(String name, {bool autoNamespace = true, required String key, required dynamic value})
Here you can set one key to a specific value.

Properties

autoNamespace → bool
final
data ↔ Data?
getter/setter pair
datatype ↔ String?
getter/setter pair
hashCode → int
The hash code for this object.
no setterinherited
key ↔ String?
getter/setter pair
name → String
final
nbt ↔ Map<String, dynamic>?
getter/setter pair
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
scale ↔ double?
getter/setter pair
score ↔ Score?
getter/setter pair

Methods

copyData(String key, {required Data data}) → Storage
Copies Nbt Data from a Data.get Widget.
copyScore(String key, {double scale = 1, String datatype = 'byte', Score? score}) → Storage
Similar to copyData is copyScore which copies the value of a score into a nbt path.
generate(Context context) → Widget
override
get(String key) → Storage
To get a value back, use Storage.get.
merge(Map<String, dynamic> nbt) → Storage
Of course you can also insert a Map with multiple keys and values.
modify(String toPath, DataModify modify) → Storage
Modifies Nbt Data(look at Data Widget).
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
remove(String key) → Storage
Removes certain Nbt Data.
set(String key, dynamic value) → Storage
Here you can set one key to a specific value.
toData([DataStorage? target]) → Data
toMap() → dynamic
inherited
toString() → String
A string representation of this object.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited