Interface MobSpawnSettings
- All Superinterfaces:
Wrapper
Controls the mobs that may spawn naturally and the biome spawn cost assigned to each mob.
- Since:
- 4.0.0
- See Also:
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final floatstatic final MobSpawnSettingsstatic final WeightedList<SpawnerData> static final MobSpawnSettings -
Method Summary
Modifier and TypeMethodDescriptionGets every explicitly defined mob spawn cost.static MobSpawnSettings.Builderbuilder()Creates a new mob spawn settings builder.static MobSpawnSettingsReads Minecraft mob spawn settings into a wrapper.Gets the categories explicitly controlled by these settings.getMobsInCategory(MobCategory category) Gets the weighted spawn entries explicitly defined for a category.getMobSpawnCost(EntityType type) Gets the spawn cost assigned to an entity type.getMobsToSpawn(MobCategory category) Gets the weighted spawn entries for a category, returning an empty list when the category is not defined.static MobSpawnSettingsof(Map<MobCategory, WeightedList<SpawnerData>> spawnsByCategory, Map<EntityType, MobSpawnCost> mobSpawnCosts) Creates mob spawn settings.default MobSpawnSettings.BuilderConverts these settings back into a builder.Methods inherited from interface Wrapper
asHandle, toMinecraft, unwrap
-
Field Details
-
DEFAULT_CREATURE_WORLD_GEN_SPAWN_PROBABILITY
static final float DEFAULT_CREATURE_WORLD_GEN_SPAWN_PROBABILITY- See Also:
-
EMPTY_MOB_LIST
-
EMPTY
-
NO_SPAWNS
-
-
Method Details
-
getMobsToSpawn
Gets the weighted spawn entries for a category, returning an empty list when the category is not defined.- Parameters:
category- the mob category to query- Returns:
- the category's spawn entries, or an empty weighted list when it is not defined
- Since:
- 4.0.0
-
getMobsInCategory
Gets the weighted spawn entries explicitly defined for a category.An empty list means the category is explicitly disabled, while
nullmeans these settings do not override the category.- Parameters:
category- the mob category to query- Returns:
- the defined spawn entries, or
nullwhen the category is not overridden - Since:
- 4.0.0
-
definedCategories
Gets the categories explicitly controlled by these settings.- Returns:
- the defined mob categories
- Since:
- 4.0.0
-
getMobSpawnCost
Gets the spawn cost assigned to an entity type.- Parameters:
type- the entity type to query- Returns:
- the entity's spawn cost, or
nullwhen no cost is defined - Since:
- 4.0.0
-
allSpawnCosts
Gets every explicitly defined mob spawn cost.- Returns:
- an unmodifiable map of entity types to spawn costs
- Since:
- 4.0.0
-
toBuilder
Converts these settings back into a builder.- Returns:
- a builder containing these settings
- Since:
- 4.0.0
-
of
@AsOf("4.0.0") static MobSpawnSettings of(Map<MobCategory, WeightedList<SpawnerData>> spawnsByCategory, Map<EntityType, MobSpawnCost> mobSpawnCosts) Creates mob spawn settings.- Parameters:
spawnsByCategory- the spawn entries defined for each categorymobSpawnCosts- the spawn costs defined for each entity type- Returns:
- new mob spawn settings
- Since:
- 4.0.0
-
builder
Creates a new mob spawn settings builder.- Returns:
- a new builder
- Since:
- 4.0.0
-
decode
Reads Minecraft mob spawn settings into a wrapper.- Parameters:
minecraftMobSpawnSettings- the Minecraft mob spawn settings to read- Returns:
- the wrapped mob spawn settings
- Since:
- 4.0.0
-