Record Class StorageNbtProvider
java.lang.Object
java.lang.Record
net.minecraft.world.level.storage.loot.providers.nbt.StorageNbtProvider
- All Implemented Interfaces:
LootContextUser, NbtProvider, Validatable
An NbtProvider that provides NBT data from a named
.
invalid reference
CommandStorage
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final IdentifierThe field for theidrecord component.static final com.mojang.serialization.MapCodec<StorageNbtProvider> -
Constructor Summary
ConstructorsConstructorDescriptionCreates an instance of aStorageNbtProviderrecord class. -
Method Summary
Modifier and TypeMethodDescriptioncom.mojang.serialization.MapCodec<StorageNbtProvider> codec()final booleanIndicates whether some other object is "equal to" this one.get(LootContext context) final inthashCode()Returns a hash code value for this object.id()Returns the value of theidrecord component.final StringtoString()Returns a string representation of this record class.Methods inherited from interface LootContextUser
getReferencedContextParams, validate
-
Field Details
-
id
The field for theidrecord component. -
MAP_CODEC
-
-
Constructor Details
-
StorageNbtProvider
Creates an instance of aStorageNbtProviderrecord class.- Parameters:
id- the value for theidrecord component
-
-
Method Details
-
codec
- Specified by:
codecin interfaceNbtProvider
-
get
- Specified by:
getin interfaceNbtProvider
-
toString
-
hashCode
-
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared withObjects::equals(Object,Object). -
id
Returns the value of theidrecord component.- Returns:
- the value of the
idrecord component
-