Package cz.jeme.bestium.api.inject.biome
Record Class SpawnData
java.lang.Object
java.lang.Record
cz.jeme.bestium.api.inject.biome.SpawnData
- Record Components:
weight- Relative spawn probability. Higher values increase spawn frequency compared to other entities in the same biome. To configure this accurately, compare values of other mobs in the biome. For vanilla biomes, refer to: Minecraft Wiki - Plains.minGroupSize- Minimum number of mobs that can spawn together in a group.maxGroupSize- Maximum number of mobs that can spawn together in a group.cost- Optional spawn cost. SeeSpawnData.MobCostfor details.
public record SpawnData(int weight, int minGroupSize, int maxGroupSize, @Nullable SpawnData.MobCost cost)
extends Record
Configuration for how often and in what group sizes a mob should spawn within a biome.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final recordRepresents additional spawn constraints introduced in Minecraft 1.16 ("The Nether Update"). -
Constructor Summary
ConstructorsConstructorDescriptionSpawnData(int weight, int groupSize) Creates spawn data with an exact group size (min and max will be the same).SpawnData(int weight, int minGroupSize, int maxGroupSize) Creates spawn data without a mob cost.SpawnData(int weight, int minGroupSize, int maxGroupSize, @Nullable SpawnData.MobCost cost) Creates an instance of aSpawnDatarecord class. -
Method Summary
Modifier and TypeMethodDescriptioncost()Returns the value of thecostrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.intReturns the value of themaxGroupSizerecord component.intReturns the value of theminGroupSizerecord component.net.minecraft.world.level.biome.MobSpawnSettings.SpawnerDatatoSpawnerData(net.minecraft.world.entity.EntityType<?> type) Converts thisSpawnDataintoMobSpawnSettings.SpawnerData.final StringtoString()Returns a string representation of this record class.intweight()Returns the value of theweightrecord component.
-
Constructor Details
-
SpawnData
public SpawnData(int weight, int minGroupSize, int maxGroupSize) Creates spawn data without a mob cost.- Parameters:
weight- spawn weightminGroupSize- minimum group sizemaxGroupSize- maximum group size
-
SpawnData
public SpawnData(int weight, int groupSize) Creates spawn data with an exact group size (min and max will be the same).- Parameters:
weight- spawn weightgroupSize- fixed group size
-
SpawnData
Creates an instance of aSpawnDatarecord class.- Parameters:
weight- the value for theweightrecord componentminGroupSize- the value for theminGroupSizerecord componentmaxGroupSize- the value for themaxGroupSizerecord componentcost- the value for thecostrecord component
-
-
Method Details
-
toSpawnerData
@Internal public net.minecraft.world.level.biome.MobSpawnSettings.SpawnerData toSpawnerData(net.minecraft.world.entity.EntityType<?> type) Converts thisSpawnDataintoMobSpawnSettings.SpawnerData.- Parameters:
type- the entity type to bind this spawn data to- Returns:
- the NMS representation of this spawn data
-
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. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with '=='. -
weight
public int weight()Returns the value of theweightrecord component.- Returns:
- the value of the
weightrecord component
-
minGroupSize
public int minGroupSize()Returns the value of theminGroupSizerecord component.- Returns:
- the value of the
minGroupSizerecord component
-
maxGroupSize
public int maxGroupSize()Returns the value of themaxGroupSizerecord component.- Returns:
- the value of the
maxGroupSizerecord component
-
cost
Returns the value of thecostrecord component.- Returns:
- the value of the
costrecord component
-