Interface MobSpawnSettings

All Superinterfaces:
Wrapper

@NullMarked @AsOf("4.0.0") public interface MobSpawnSettings extends Wrapper
Controls the mobs that may spawn naturally and the biome spawn cost assigned to each mob.
Since:
4.0.0
See Also:
  • Field Details

  • Method Details

    • getMobsToSpawn

      @AsOf("4.0.0") WeightedList<SpawnerData> getMobsToSpawn(MobCategory category)
      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

      @AsOf("4.0.0") @Nullable WeightedList<SpawnerData> getMobsInCategory(MobCategory category)
      Gets the weighted spawn entries explicitly defined for a category.

      An empty list means the category is explicitly disabled, while null means these settings do not override the category.

      Parameters:
      category - the mob category to query
      Returns:
      the defined spawn entries, or null when the category is not overridden
      Since:
      4.0.0
    • definedCategories

      @AsOf("4.0.0") Set<MobCategory> definedCategories()
      Gets the categories explicitly controlled by these settings.
      Returns:
      the defined mob categories
      Since:
      4.0.0
    • getMobSpawnCost

      @AsOf("4.0.0") @Nullable MobSpawnCost getMobSpawnCost(EntityType type)
      Gets the spawn cost assigned to an entity type.
      Parameters:
      type - the entity type to query
      Returns:
      the entity's spawn cost, or null when no cost is defined
      Since:
      4.0.0
    • allSpawnCosts

      @AsOf("4.0.0") Map<EntityType, MobSpawnCost> allSpawnCosts()
      Gets every explicitly defined mob spawn cost.
      Returns:
      an unmodifiable map of entity types to spawn costs
      Since:
      4.0.0
    • toBuilder

      @AsOf("4.0.0") default MobSpawnSettings.Builder 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 category
      mobSpawnCosts - the spawn costs defined for each entity type
      Returns:
      new mob spawn settings
      Since:
      4.0.0
    • builder

      @AsOf("4.0.0") static MobSpawnSettings.Builder builder()
      Creates a new mob spawn settings builder.
      Returns:
      a new builder
      Since:
      4.0.0
    • decode

      @AsOf("4.0.0") static MobSpawnSettings decode(Object minecraftMobSpawnSettings)
      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