Skip to content

[Version 4.0] Modifiable Value

Alberto edited this page Jun 22, 2023 · 3 revisions

The Modifiable Value object is used in the mod to set a value of a property.
This value can also be modified with modifiers.

Modifiable Value

  • modifiable_value: the object that contains the modifiable values properties or a numeric value.
    • value: the value
    • round: the decimal places to round "value" to after applying modifiers
    • conditions_modifier: A list of conditions modifiers
      • One condition modifier
        • condition: Same object as the conditions one in mobs properties
        • amount: The amount to apply to value if the conditions are fulfilled
        • operation: A string value (allowed values: "add", "multiply") representing if amount should affect value additively or multiplicatively

Those are the base keys, after those, modifiers objects can be added, such as Difficulty Modifier. Check the sidebar for all the modifiers. Modifiers of integer values will have the decimal part truncated. E.g. An enchantment level of 2 when modified by difficulty goes to 3.4, will result as 3.

Notes

This:

"modifiable_value": 10

equals to:

"modifiable_value": {
    "value": 10
}

Simple round example. This will round the value to 8:

"modifiable_value": {
    "value": 8.25,
    "round": 0
}

Example

Check other properties pages for examples.

Clone this wiki locally