Record Class SpawnContext
java.lang.Object
java.lang.Record
net.minecraft.world.entity.variant.SpawnContext
public record SpawnContext(BlockPos pos, ServerLevelAccessor level, Holder<Biome> biome)
extends Record
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionSpawnContext(BlockPos pos, ServerLevelAccessor level, Holder<Biome> biome) Creates an instance of aSpawnContextrecord class. -
Method Summary
Modifier and TypeMethodDescriptionbiome()Returns the value of thebiomerecord component.static SpawnContextcreate(ServerLevelAccessor pLevel, BlockPos pPos) 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. -
biome
The field for thebiomerecord component.
-
-
Constructor Details
-
SpawnContext
Creates an instance of aSpawnContextrecord class.- Parameters:
pos- the value for theposrecord componentlevel- the value for thelevelrecord componentbiome- the value for thebiomerecord component
-
-
Method Details
-
create
-
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
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
-
biome
Returns the value of thebiomerecord component.- Returns:
- the value of the
biomerecord component
-