Closed neinome closed 2 months ago
Don't know how I overlooked this during my previous testing... Experience needs to have a condition associated with it, or it will just keep increasing.
Adding a condition using the referenced variable before the experience expression fixed the issue. { "type": "puffish_skills:increase_stat", "data": { "variables": { "dmg": { "operations": [{ "type": "get_stat" }, { "type": "puffish_skills:test", "data": { "stat": "minecraft.custom:minecraft.damage_dealt" }}]}}, "experience": [{ "condition": "dmg", "expression": "1" }]}}
Following the examples in the documentation, increase_stat causes experience bar to constantly increase. Changing the stat, even to a stat that is still 0, does not change this behavior. Removing the section using increase_stat stops the increase.
Here is the original code for what was being used (formatting changed): { "type": "puffish_skills:increase_stat", "data": { "variables": { "dmg": { "operations": [{ "type": "get_stat" }, { "type": "puffish_skills:test", "data": { "stat": "minecraft.custom:minecraft.damage_dealt" }}]}}, "experience": [{ "expression": "1" }]}}
Attempt 2: { "type": "puffish_skills:increase_stat", "data": { "variables": { "dmg": { "operations": [{ "type": "get_stat" }, { "type": "puffish_skills:test", "data": { "stat": "minecraft.custom:minecraft.damage_dealt" }}]}, "amt": { "operations":[{ "type": "get_increase_amount" }]}}, "experience": [{ "expression": "amt" }]}}
Attempt 3: { "type": "puffish_skills:increase_stat", "data": { "variables": { "dmg": { "operations": [{ "type": "get_stat" }, { "type": "puffish_skills:test", "data": { "stat": "minecraft.custom:minecraft.jump" }}]}, "amt": { "operations":[{ "type": "get_increase_amount" }]}}, "experience": [{ "expression": "amt" }]}}
Attempt 4 (stat that is still 0): { "type": "puffish_skills:increase_stat", "data": { "variables": { "dmg": { "operations": [{ "type": "get_stat" }, { "type": "puffish_skills:test", "data": { "stat": "minecraft.custom:minecraft.boat_one_cm" }}]}, "amt": { "operations":[{ "type": "get_increase_amount" }]}}, "experience": [{ "expression": "amt" }]}}