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 aSpawnContext
record class. -
Method Summary
Modifier and TypeMethodDescriptionbiome()
Returns the value of thebiome
record component.static SpawnContext
create
(ServerLevelAccessor p_400282_, BlockPos p_399599_) final boolean
Indicates whether some other object is "equal to" this one.final int
hashCode()
Returns a hash code value for this object.level()
Returns the value of thelevel
record component.pos()
Returns the value of thepos
record component.final String
toString()
Returns a string representation of this record class.
-
Field Details
-
pos
The field for thepos
record component. -
level
The field for thelevel
record component. -
biome
The field for thebiome
record component.
-
-
Constructor Details
-
SpawnContext
Creates an instance of aSpawnContext
record class.- Parameters:
pos
- the value for thepos
record componentlevel
- the value for thelevel
record componentbiome
- the value for thebiome
record 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 thepos
record component.- Returns:
- the value of the
pos
record component
-
level
Returns the value of thelevel
record component.- Returns:
- the value of the
level
record component
-
biome
Returns the value of thebiome
record component.- Returns:
- the value of the
biome
record component
-