Record Class SpawnContext
java.lang.Object
java.lang.Record
net.minecraft.world.entity.variant.SpawnContext
public record SpawnContext(BlockPos pos, ServerLevelAccessor level, EnvironmentAttributeReader environmentAttributes, Holder<Biome> biome)
extends Record
-
Field Summary
FieldsModifier and TypeFieldDescriptionThe field for thebiomerecord component.private final EnvironmentAttributeReaderThe field for theenvironmentAttributesrecord component.private final ServerLevelAccessorThe field for thelevelrecord component.private final BlockPosThe field for theposrecord component. -
Constructor Summary
ConstructorsConstructorDescriptionSpawnContext(BlockPos pos, ServerLevelAccessor level, EnvironmentAttributeReader environmentAttributes, Holder<Biome> biome) Creates an instance of aSpawnContextrecord class. -
Method Summary
Modifier and TypeMethodDescriptionbiome()Returns the value of thebiomerecord component.static SpawnContextcreate(ServerLevelAccessor level, BlockPos pos) Returns the value of theenvironmentAttributesrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.level()Returns the value of thelevelrecord component.pos()Returns the value of theposrecord component.final StringtoString()Returns a string representation of this record class.
-
Field Details
-
pos
The field for theposrecord component. -
level
The field for thelevelrecord component. -
environmentAttributes
The field for theenvironmentAttributesrecord component. -
biome
-
-
Constructor Details
-
SpawnContext
public SpawnContext(BlockPos pos, ServerLevelAccessor level, EnvironmentAttributeReader environmentAttributes, Holder<Biome> biome) Creates an instance of aSpawnContextrecord class.- Parameters:
pos- the value for theposrecord componentlevel- the value for thelevelrecord componentenvironmentAttributes- the value for theenvironmentAttributesrecord componentbiome- the value for thebiomerecord component
-
-
Method Details
-
create
-
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). -
pos
Returns the value of theposrecord component.- Returns:
- the value of the
posrecord component
-
level
Returns the value of thelevelrecord component.- Returns:
- the value of the
levelrecord component
-
environmentAttributes
Returns the value of theenvironmentAttributesrecord component.- Returns:
- the value of the
environmentAttributesrecord component
-
biome
-