MobSpawnSettingsBuilder

Builder for a biome's MobSpawnSettingsBuilder. The following settings are available:

  • creatureGenerationProbability - The probability of a creature spawning in a chunk. The default value is 0.1.

  • spawners - A Map of MobCategory -> List<SpawnerData> that define the spawn conditions and properties for mobs.

  • mobSpawnCosts - A Map of EntityType ->MobSpawnCost that define the spawn costs for mobs. For more information on Minecraft's spawn costs system, check out the Minecraft Wiki

Constructors

Link copied to clipboard
constructor()

Functions

Link copied to clipboard
fun addSpawn(mobCategory: MobCategory, spawnerData: MobSpawnSettings.SpawnerData)

Adds a SpawnerData to the spawners setting of the biome's mob spawn settings.

fun addSpawn(mobCategory: MobCategory, entityType: EntityType<*>, minGroupSize: Int = 2, maxGroupSize: Int = 4)

Adds a SpawnerData to the spawners setting of the biome's mob spawn settings by creating a new SpawnerData instance out of the given entityType, minGroupSize and maxGroupSize. The weight is set to 1.

fun addSpawn(mobCategory: MobCategory, entityType: EntityType<*>, weight: Int, minGroupSize: Int, maxGroupSize: Int)

Adds a SpawnerData to the spawners setting of the biome's mob spawn settings by creating a new SpawnerData instance out of the given entityType, weight, minGroupSize and maxGroupSize.

Link copied to clipboard
fun build(): MobSpawnSettings

Builds a MobSpawnSettings instance from the current state of this builder.

Link copied to clipboard
fun creatureGenerationProbability(creatureGenerationProbability: Float)

Sets the creatureGenerationProbability setting of the biome's mob spawn settings. This setting is used to define the probability of a creature spawning in a chunk.

Link copied to clipboard
fun setSpawnCost(entityType: EntityType<*>, spawnCost: MobSpawnSettings.MobSpawnCost)

Sets the spawn cost for entityType to the given spawnCost.

fun setSpawnCost(entityType: EntityType<*>, energyBudget: Double, charge: Double = 1.0)

Sets the spawn cost for entityType to the given energyBudget and charge.