Skip to content

[1.20.1] Data Pack

Alberto Del Villano edited this page Aug 9, 2024 · 9 revisions

The mod uses various Data Pack feature to customize the game.

Anvil Repair

Used to define custom anvil repairing. The mod's default data can be found here.

Definition

  • item_to_repair: Define an item or an item tag that can be repaired.
  • repair: An array of Repair Data defining which and how many items repair item_to_repair
    • A Repair Data
      • repair_material: The item or item tag that will be used to repair item_to_repair
      • amount: The amount of repair_material required to fully repair item_to_repair
      • max_repair: Max percentage for repairing the item. E.g. with this set to 0.5 means that the repair_material can only repair up to 50% of item_to_repair's durability
      • cost_multiplier: A multiplier to the base cost of repairing, used to calculate the correct xp cost. E.g. this should be set to 9 for nuggets

Item Stats

Used to define item properties such as stack sizes, enchantments, modifiers, ... Here's the default item stats

Definition

  • item: An item or an item tag
  • max_stack: The max stack size for the item specified
  • durability: The durability for the item specified
  • durability_multiplier: A multiplier to durability applied after durability. Multiple item stats can have a durability multiplier summing up.
  • efficiency: item's efficiency (only works on items that can actually dig)
  • enchantability: item's enchantability
  • attack_damage: The base item's attack damage
  • attack_speed: The base item's attack speed
  • armor: The base item's armor
  • armor_toughness: The base item's armor toughness
  • regenerating_absorption: The base item's regenerating absorption
  • regenerating_absorption_speed: The base item's regenerating absorption speed
  • knockback_resistance: The base item's knockback resistance
  • movement_speed_penalty: The base item's movement speed penalty
  • modifiers: A list of attribute modifiers
    • An attribute modifier
      • uuid: The uuid of the modifier
      • name: The modifier's name
      • slot: The slot on which to apply the modifier
      • attribute: The attribute id
      • amount
      • operation: "addition", "multiply_base", "multiply_total"

Block Data

Used to change some blocks properties. Here is the default data

Definition

  • block: Block ID. Either this or block_tag must be present.
  • block_tag: Block tag. Cannot be used with states. Either this or block must be present.
  • states: A list of block states
  • state_hardness: Block hardness for the specified states or block_tag
  • state_requires_correct_tool_for_drops: Defines if the states or block_tag require a correct tool for drops
  • state_instrument: Instrument for the specified states or block_tag
  • explosion_resistance: block or block_tag's explosion resistance
  • friction: block or block_tag's friction (Used e.g. by ice to make it slippery)
  • speed_factor: block or block_tag's speed modifier (Used e.g. by soul sand to slow down)
  • jump_factor: block or block_tag's jump factor (Used e.g. by powdered snow to prevent jumping)
  • bone_meal_fail_chance: chance for bone meal to fail to grow the block

Plants Growth

Used to slowdown plants growing based off different modifiers. Default plant growth modifiers If the multiplier final value is 0, the plant will not grow. Values between 0 and 1 (inclusive) do nothing.

Definition

  • block: block id or block tag
  • growth_multiplier: the chance for the block to grow is 1 in x chance, where x is this value multiplied by all modifiers
  • modifiers: A list of modifiers to further customize growth speed
    • A modifier

Livestock Data

Defines different properties for animals, such as growing speed, breeding cooldown and living days. Default data pack

Definition

  • entity: Entity ID or Tag
  • living_days: In-game days after which the animal will die of old age. Animals have 4 stages of growth: young, adult, mid_age, old each lasting 25% of they're lifespan (living_days)
  • living_days_fluctuation: this is added or removed from entity's living_days. E.g. with living days set to 10 and this set to 3, entities will live between 7 and 13 days.
  • growth_speed_modifiers: A list of modifiers that will be applied to the growth speed of the entity (only affects the entity when it's growing from baby)
  • breeding_cooldown_modifiers: A list of modifiers that will be applied to the breeding cooldown of the entity
  • egg_lay_cooldown_modifiers: A list of modifiers that will be applied to the chicken's cooldown to lay eggs
  • breeding_fail_chance_modifiers: modifiers final value is the chance 0~1 for a breeding to fail to get a new born baby. Initial value is 0.
  • cow_fluid_cooldown_modifiers: modifiers applied to the cows' cooldown to be milked. Initial value (cooldown in seconds) is defined in configs.
  • sheep_wool_growth_chance: Chance (0~1) for a sheep to successfully regrow the wool when eating grass
  • sheep_wool_growth_chance_modifiers: modifiers added to sheep_wool_growth_chance

Modifiers

Common Definition

  • modifier: All modifiers have a modifier field that will affect the base value
  • operation: Either "add" or "multiply", defines how is modifier applied to values.
    • "add": modifier is added to the base value and other "add" modifiers
    • "multiply": modifier is multiplied by the sum of the base value plus the "add" modifiers and then added to the value.

List of modifiers and definitions

  • iguanatweaksreborn:true
    Straightforward modifier that always applies.
  • iguanatweaksreborn:sunlight Modifier that applies if the sunlight of the block is lower than the specified one.
    • min_sunglight: The sunlight (equal or greater than) at which the modifier will not be applied
  • iguanatweaksreborn:night_time Modifier that applies only at night time.
  • iguanatweaksreborn:matches_biome Modifier that will apply if the plant/entity is in one of the specified biomes. inverse can be used to make the modifier apply only if the plant/entity is NOT in one of the specified biomes.
    • biomes: A list of biome id or tags where the modifier will not be applied
    • inverse: Inverts the condition
  • iguanatweaksreborn:age Modifier that will apply if the entity age is the specified one.
    • age: "young", "adult", "mid_age", "old"
  • iguanatweaksreborn:season Modifier that will apply if the world is in the specified season. Requires Serene Seasons' to be installed.
    • seasons: A list of Serene Seasons' seasons ("WINTER", "SUMMER", "SPRING", "AUTUMN")

Examples

This plant growth modifier changes carrots. Carrots will take 2x more time to grow if not under sunlight. Will take 1.5x more time to grow if in a cold biome. Will not grow if in Winter or Summer.
If it's in the correct season and the other modifiers are both applied, the formula is 2 + 1.5 = 3.5x more time to grow.
Instead, if in the wrong season and the other modifiers are both applied, the formula is 2 + 1.5 + ((2 + 1.5) * -1) = 3.5 + (3.5 * -1) = 3.5 - 3.5 = 0, so will not grow.

{
    "block": "minecraft:carrots",
    "modifiers": [
        {
            "id": "iguanatweaksreborn:sunlight",
            "min_sunlight": 10,
            "modifier": 2,
            "operation": "add"
        },
        {
            "id": "iguanatweaksreborn:matches_biome",
            "biomes": [
                "#forge:is_cold"
            ],
            "modifier": 1.5,
            "operation": "add"
        },
        {
            "id": "iguanatweaksreborn:season",
            "seasons": [
                "WINTER",
                "SUMMER"
            ],
            "modifier": -1,
            "operation": "multiply"
        }
    ]
}