Record Class SpawnData
java.lang.Object
java.lang.Record
net.minecraft.world.level.SpawnData
public record SpawnData(CompoundTag entityToSpawn, Optional<SpawnData.CustomSpawnRules> customSpawnRules, Optional<EquipmentTable> equipment)
extends Record
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final com.mojang.serialization.Codec<SpawnData> private final Optional<SpawnData.CustomSpawnRules> The field for thecustomSpawnRulesrecord component.static final Stringprivate final CompoundTagThe field for theentityToSpawnrecord component.private final Optional<EquipmentTable> The field for theequipmentrecord component.static final com.mojang.serialization.Codec<WeightedList<SpawnData>> -
Constructor Summary
ConstructorsConstructorDescriptionSpawnData(CompoundTag entityToSpawn, Optional<SpawnData.CustomSpawnRules> customSpawnRules, Optional<EquipmentTable> equipment) Creates an instance of aSpawnDatarecord class. -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of thecustomSpawnRulesrecord component.Returns the value of theentityToSpawnrecord component.final booleanIndicates whether some other object is "equal to" this one.Returns the value of theequipmentrecord component.final inthashCode()Returns a hash code value for this object.final StringtoString()Returns a string representation of this record class.
-
Field Details
-
entityToSpawn
The field for theentityToSpawnrecord component. -
customSpawnRules
The field for thecustomSpawnRulesrecord component. -
equipment
The field for theequipmentrecord component. -
ENTITY_TAG
- See Also:
-
CODEC
-
LIST_CODEC
-
-
Constructor Details
-
SpawnData
public SpawnData() -
SpawnData
public SpawnData(CompoundTag entityToSpawn, Optional<SpawnData.CustomSpawnRules> customSpawnRules, Optional<EquipmentTable> equipment) Creates an instance of aSpawnDatarecord class.- Parameters:
entityToSpawn- the value for theentityToSpawnrecord componentcustomSpawnRules- the value for thecustomSpawnRulesrecord componentequipment- the value for theequipmentrecord component
-
-
Method Details
-
getEntityToSpawn
-
getCustomSpawnRules
-
getEquipment
-
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). -
entityToSpawn
Returns the value of theentityToSpawnrecord component.- Returns:
- the value of the
entityToSpawnrecord component
-
customSpawnRules
Returns the value of thecustomSpawnRulesrecord component.- Returns:
- the value of the
customSpawnRulesrecord component
-
equipment
Returns the value of theequipmentrecord component.- Returns:
- the value of the
equipmentrecord component
-