Skip to content

Documentation rules.yml

UltimaOath edited this page Aug 8, 2021 · 8 revisions
This page was last updated for LevelledMobs 3.1.1 b481

Rules Configuration

LevelledMobs' rules.yml file allows you to craft truly modular Custom Rules which either modify or extend the Default Rule that are applied to any and all EntityTypes. The rules file is broken into three major sections: Presets, Default Rule, and Custom Rules. This documentation provides a general understanding of how the rules file works.

For more details, learn how to use the different conditions, strategies, and apply-settings here.


Universal Mob and Biome Groups:

LM includes several groups of entities and biomes which are bundled together in a convenient format. Each of these groups function as their own EntityType or Biome when using allowed-groups: or excluded-groups:, applying to multiple entities or biomes at once. We have also included the ability to craft your own entity and biome custom groups within the rules file!

NOTE: Currently the custom groups are limited to rules and cannot be used in the CustomDrops' Groups section.

This will change in the future!

You can also establish your own mob and biome groups using the mob-group: and biome-group: section located above Presets in the rules file. The default config includes several examples of these groups.

  • all_mobs - All entities whether they are levelled or not.
  • all_levellable_mobs - All entities which have been levelled.
  • all_hostile_mobs - All hostile entities, whether they are levelled or not.
  • all_passive_mobs - All passive entities, whether they are levelled or not.
  • all_overworld_mobs - All Overworld entities, whether they are levelled or not.
  • all_nether_mobs - All Nether entities, whether they are levelled or not.
  • all_flying_mobs - All flying entities, whether they are levelled or not.
  • all_ground_mobs - All ground-limited entities, whether they are levelled or not.
  • all_aquatic_mobs - All aquatic entities, whether they are levelled or not.

  • snowy_biomes
    • SNOWY_TUNDRA
    • ICE_SPIKES
    • SNOWY_TAIGA
    • SNOWY_TAIGA_MOUNTAINS
    • SNOWY_TAIGA_HILLS
    • FROZEN_RIVER
    • SNOWY_BEACH
    • SNOWY_MOUNTAINS
  • cold_biomes
    • MOUNTAINS
    • GRAVELLY_MOUNTAINS
    • MODIFIED_GRAVELLY_MOUNTAINS
    • WOODED_MOUNTAINS
    • TAIGA
    • TAIGA_MOUNTAINS
    • TAIGA_HILLS
    • GIANT_TREE_TAIGA
    • GIANT_TREE_TAIGA_HILLS
    • GIANT_SPRUCE_TAIGA
    • GIANT_SPRUCE_TAIGA_HILLS
    • STONE_SHORE
  • temperate_biomes
    • PLAINS
    • SUNFLOWER_PLAINS
    • FOREST
    • FLOWER_FOREST
    • BIRCH_FOREST
    • BIRCH_FOREST_HILLS
    • TALL_BIRCH_FOREST
    • TALL_BIRCH_HILLS
    • DARK_FOREST
    • DARK_FOREST_HILLS
    • SWAMP
    • SWAMP_HILLS
    • JUNGLE
    • MODIFIED_JUNGLE
    • JUNGLE_HILLS
    • MODIFIED_JUNGLE_EDGE
    • BAMBOO_JUNGLE
    • BAMBOO_JUNGLE_HILLS
    • RIVER
    • BEACH
    • MUSHROOM_FIELDS
    • MUSHROOM_FIELD_SHORE
    • WOODED_HILLS
  • dry_biomes
    • DESERT
    • DESERT_LAKES
    • DESERT_HILLS
    • SAVANNA
    • SHATTERED_SAVANNA
    • SHATTERED_SAVANNA_PLATEAU
    • BADLANDS
    • ERODED_BADLANDS
    • WOODED_BADLANDS_PLATEAU
    • BADLANDS_PLATEAU
    • SAVANNA_PLATEAU
    • MODIFIED_BADLANDS_PLATEAU
    • NODIFIED_WOODED_BADLANDS_PLATEAU
    • MODIFIED_SAVANNA_PLATEAU
  • ocean_biomes
    • WARM_OCEAN
    • DEEP_WARM_OCEAN
    • LUKEWARM_OCEAN
    • DEEP_LUKEWARM_OCEAN
    • OCEAN
    • DEEP_OCEAN
    • COLD_OCEAN
    • DEEP_COLD_OCEAN
    • FROZEN_OCEAN
    • DEEP_FROZEN_OCEAN
  • nether_biomes
    • NETHER_WASTES
    • CRIMSON_FOREST
    • WARPED_FOREST
    • SOUL_SAND_VALLEY
    • BASALT_DELTAS
  • end_biomes
    • THE_END
    • SMALL_END_ISLANDS
    • END_MIDLANDS
    • END_HIGHLANDS
    • END_BARRENS

Presets:

LM allows you to craft certain sets of config options into sets known as Presets, which can be applied within either the Default Rule or any Custom Rules utilizing the use-preset: config line. For example:

custom-rules:
  - enabled: true
    name: 'Custom Rule'
    use-preset: presetName, otherPresetName
    use-preset:
      - presetName
      - otherPresetName
presets:
  presetName:
    name: 'Preset Name'
    system:

The Presets section covers the first third of the file, and by default it is used to mostly populate the Default Rule with multiple different out-of-the-box solutions to common questions! You can edit or add your own presets to the list, or choose to not use the preset system at all. This is meant to be an aid in preventing duplicate text across the rules file.

When crafting a preset, the above structure should be followed. Beginning with the presets: tag, you indent two spaces and then give your preset a name to reference later, replacing presetName: with this value. Make sure to only use alphanumeric values, without spaces, for this value. On the next time, two further spaces indented, you should give your preset an easy-to-read name:. While this is not required, you will thank yourself later! Finally, system: represents either conditions:, strategies:, and apply-settings: depending on the type of preset you intend to build!

Default Rule:

LM requires this section to be populated with the following minimal information in order to work with a minimum of functionality. By default, LM uses the Presets system explained above to populate the Default Rule with the necessary values, plus several more, in order to make things quick and easy to switch between preconfigured settings.

default-rule:
  conditions:
    worlds:
      allowed-list: ['*']
    strategy:
      random: true
    apply-settings:
      minLevel: 1
      maxLevel: 25
      multipliers:
        max-health: 5.0
        movement-speed: 0.15
        attack-damage: 2.25
        ranged-attack-damage: 2.0
        creeper-blast-damage: 1.0
        item-drop: 3
        xp-drop: 5
      nametag: '&8&lΰΌΊ %tiered%Lvl %mob-lvl%&8 | &f%displayname%&8 | &f%entity-health-rounded% %tiered%%heart_symbol% &r%health-indicator% &8&lΰΌ»'
      creature-death-nametag: '%tiered%Lvl %mob-lvl%&8 | &f%entity-name%'

Custom Rules:

LM comes out-of-the-box with several different Custom Rules which are both enabled and disabled. These are used to both achieve specific results, such as disabling the levelling of passive entities with the first custom rule, as well as provide multiple examples of how to use custom rules in unique ways.

Priority:

By default, LM processes the rules in a linear order: from top to bottom; from the Default Rule to the first through last Custom Rule. You can establish a priority config line within a custom rule which will override it's position in the queue, allowing it to process earlier or later than the rest of the stack. Remember that the Default Rule will ALWAYS process first before any Custom Rules to populate any necessary default values. Below represents an example of how priority alters the 'stack queue' of Custom Rules:

custom-rules:
  - enabled: true
    name: 'Run before the stack, as the highest priority, as the first rule processed after the Default Rule'
    priority: 2

  - enabled: true
    name: 'Run before the stack, after any higher priority'
    priority: 1

  - enabled: true
    name: 'Run the queued stack (same as not listing priority)'
    priority: 0

  - enabled: true
    name: 'Run the queued stack (same as priority: 0)'

  - enabled: true
    name: 'Run after the stack, before any lower priority'
    priority: -1

  - enabled: true
    name: 'Run after the stack, as the lowest priority, at the very end'
    priority: -2

Below represents the basic framework of a Custom Rule:

custom-rules:
  - enabled: true
    priority: 1
    name: ''
    use-preset: 
    conditions:
    strategies:
    apply-settings:
  • - enabled: - This represents whether the custom rule is enabled or disabled.
  • priority: - This value overrides the custom rule's processing order.
  • name: - This represents an easy-to-read representation of the Custom Rule for debug purposes.
  • use-preset: - This allows you to use a Preset within a Custom Rule.
  • conditions:, strategies:, and apply-settings: - These are elaborated on further here.

Any detail not specifically listed within the custom rule will gather that information from the Default Rule when constructing the final custom rule to apply to an entity. For example:

default-rule:
  conditions:
    worlds:
      allowed-list: ['*']
    entities:
      allowed-list: ['all_mobs']

custom-rules:
  - enabled: true
    name: 'Disable Passive Entities'
    conditions:
      entities:
        allowed-list: ['all_passive_mobs']
    apply-settings:
      maxLevel: 0

The way the above structure is read, starting from the default rule: All worlds are levellable, and all entities are levellable based on the Default Rule. When the custom rule was crafted, I did not need to specify what world the rule would apply to, since it grabs the value 'all worlds' from the Default Rule. I do however, have to specify the entities, because if I didn't the custom rule would apply to 'all entities' as stated in the Default Rule. Finally, I have applied the level 0 which disables levelling to the passive entities in all worlds.

Clone this wiki locally