Record Class MobSpawnSettings.SpawnerData
java.lang.Object
java.lang.Record
net.minecraft.world.level.biome.MobSpawnSettings.SpawnerData
- Enclosing class:
MobSpawnSettings
public static record MobSpawnSettings.SpawnerData(EntityType<?> type, int minCount, int maxCount)
extends Record
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final com.mojang.serialization.MapCodec<MobSpawnSettings.SpawnerData> private final intThe field for themaxCountrecord component.private final intThe field for theminCountrecord component.private final EntityType<?> The field for thetyperecord component. -
Constructor Summary
ConstructorsConstructorDescriptionSpawnerData(EntityType<?> type, int minCount, int maxCount) Creates an instance of aSpawnerDatarecord class. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.intmaxCount()Returns the value of themaxCountrecord component.intminCount()Returns the value of theminCountrecord component.toString()Returns a string representation of this record class.EntityType<?> type()Returns the value of thetyperecord component.
-
Field Details
-
type
The field for thetyperecord component. -
minCount
private final int minCountThe field for theminCountrecord component. -
maxCount
private final int maxCountThe field for themaxCountrecord component. -
CODEC
-
-
Constructor Details
-
SpawnerData
Creates an instance of aSpawnerDatarecord class.- Parameters:
type- the value for thetyperecord componentminCount- the value for theminCountrecord componentmaxCount- the value for themaxCountrecord component
-
-
Method Details
-
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. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with thecomparemethod from their corresponding wrapper classes. -
type
Returns the value of thetyperecord component.- Returns:
- the value of the
typerecord component
-
minCount
public int minCount()Returns the value of theminCountrecord component.- Returns:
- the value of the
minCountrecord component
-
maxCount
public int maxCount()Returns the value of themaxCountrecord component.- Returns:
- the value of the
maxCountrecord component
-