Skip to content

[Version 4.10] Presets

Alberto Del Villano edited this page May 25, 2024 · 2 revisions

A preset is a way to set some specific properties to a single mob (E.g. it lets you make a boss zombie that rarely spawns).

In the config folder you'll find a presets folder, in here you want to add your presets. A preset is a Mob property file without the target and presets keys.

But also has this bonus properties:

Once you've created you preset you must add the preset to the mob with the presets key.
In the mob file under the presets.list key you'll have to add a Weighted preset.

NOTE

Presets by default are exclusive to the mob (so other properties in the mob file will not be applied) unless the presets.mode is changed.

Preset

  • mode: (String) How will the preset behave with the other properties in the file.
    "exclusive": when the preset is chosen the other properties will not apply. This is the default behaviour
    "before": the preset properties are applied before the mob properties. "after": the preset properties are applied after the mob properties.
  • chance: (Modifiable Value Object) percentage chance (between 0 and 1) for mob to get a preset applied
  • list: a (Weighted Presets) list

Weighted Preset

  • id: (Resource location) The preset id (the preset file with the namespace and without the .json at end)
  • weight: (Modifiable Value Object) The weight of the preset. Can be omitted and will default to 1
  • chance: (Modifiable Value Object) rapresenting the percentage chance (between 0 and 1) to apply the preset. If omitted the preset will always be applied.
  • conditions: (Conditions Object)

Example

This examples shows how to make a "ghost" mob (an invisible silent zombie with glowing effect) that has 5% chance to spawn only above sea level.

data/<namespace>/mobs_properties_randomness/presets/ghost_zombie.json

{
    "potion_effects": [
        {
            "id": "minecraft:invisibility",
            "hide_particles": true
        },
        {
            "id": "minecraft:glowing",
            "hide_particles": true
        }
    ],
    "custom_name": {
        "overrides": [ "Ghost" ]
    },
    "silent": 1
}

data/<namespace>/mobs_properties_randomness/mobs/zombies.json

{
    "target": "minecraft:zombie",
    "presets": {
        "chance": 0.05,
        "list": [
            {
                "weight": 1,
                "id": "<namespace>:ghost_zombie",
                "world_whitelist": {
                    "deepness": {
                        "min": 64,
                        "max": 320
                    }
                }
            }
        ]
    }
}
Clone this wiki locally