Skip to content

Stat

Power Type

Tracks the effective value of the specified statistic; essentially works the same as the Resource (Power Type).

Type ID: eggolib:stat

Fields

Field Type Default Description
stat Stat The statistic to keep track the value of.
on_change_action Entity Action Type optional If specified, this action will be executed on the entity if the stored value is changed.
min_action Entity Action Type optional If specified, this action will be executed once the minimum value is reached.
max_action Entity Action Type optional If specified, this action will be executed once the maximum value is reached.
hud_render HUD Render optional Determines how the stored value is visualized in the HUD.
min Integer 0 The minimum value that is allowed to be stored in the power
max Integer 2147483647 The maximum value that is allowed to be stored in the power.
start_value Integer The value of the min field The stored starting value upon gaining the power.

Examples

{
    "type": "eggolib:stat",
    "stat": {
        "type": "custom",
        "id": "minecraft:damage_dealt"
    },
    "max": 100,
    "hud_render": {
        "should_render": true
    }
}

This example will keep track of the effective value of the minecraft.custom:minecraft.damage_dealt statistic of the player, with a maximum value of 100.

{
    "type": "eggolib:stat",
    "stat": {
        "type": "mined",
        "id": "minecraft:sand"
    }
}

This example will keep track of the effective value of the minecraft.mined:minecraft.sand statistic of the player.