From 44eea04f96c2c8a654f07143e72b58535c9bef7a Mon Sep 17 00:00:00 2001 From: runcows Date: Sat, 11 Oct 2025 04:24:31 +0900 Subject: [PATCH] Adjust gold max damage + remove redundancy --- .../function/active_tool.mcfunction | 6 ++- .../function/store_maximum.mcfunction | 37 ------------------- .../tags/function/apply_band.json | 5 --- .../player/modify_axe_durability.mcfunction | 4 +- .../function/active_tool.mcfunction | 3 +- .../function/store_maximum.mcfunction | 9 +++-- 6 files changed, 13 insertions(+), 51 deletions(-) delete mode 100644 gm4_audere_shamir/data/gm4_audere_shamir/function/store_maximum.mcfunction delete mode 100644 gm4_audere_shamir/data/gm4_metallurgy/tags/function/apply_band.json diff --git a/gm4_audere_shamir/data/gm4_audere_shamir/function/active_tool.mcfunction b/gm4_audere_shamir/data/gm4_audere_shamir/function/active_tool.mcfunction index b726260142..04373d55d4 100644 --- a/gm4_audere_shamir/data/gm4_audere_shamir/function/active_tool.mcfunction +++ b/gm4_audere_shamir/data/gm4_audere_shamir/function/active_tool.mcfunction @@ -4,7 +4,8 @@ data modify storage gm4_audere_shamir:temp/player/tool SelectedItem set from entity @s SelectedItem execute store result score $tool_current_damage gm4_ml_data run data get storage gm4_audere_shamir:temp/player/tool SelectedItem.components."minecraft:damage" -execute store result score $tool_max_damage gm4_ml_data run data get storage gm4_audere_shamir:temp/player/tool SelectedItem.components."minecraft:custom_data".gm4_audere_shamir.max_durability +execute store result score $tool_max_damage gm4_ml_data run data get storage gm4_audere_shamir:temp/player/tool SelectedItem.components."minecraft:custom_data".MaxDurability +# | MaxDamage is set by gm4_moneo_shamir:store_maximum # update newly upgraded netherite gear execute if score $tool_max_damage gm4_ml_data matches 1561 if predicate gm4_audere_shamir:holding_netherite run function gm4_audere_shamir:update_netherite @@ -15,7 +16,8 @@ execute if score $tool_max_damage gm4_ml_data matches 131 run function gm4_auder execute if score $tool_max_damage gm4_ml_data matches 250 run function gm4_audere_shamir:tools/materials/iron execute if score $tool_max_damage gm4_ml_data matches 1561 run function gm4_audere_shamir:tools/materials/diamond execute if score $tool_max_damage gm4_ml_data matches 2031 run function gm4_audere_shamir:tools/materials/netherite -execute if score $tool_max_damage gm4_ml_data matches 33 run function gm4_audere_shamir:tools/materials/gold +# | gold used to be listed as 33 max damage, this is kept for compatibility with old items +execute if score $tool_max_damage gm4_ml_data matches 32..33 run function gm4_audere_shamir:tools/materials/gold execute if score $tool_max_damage gm4_ml_data matches 237 run function gm4_audere_shamir:tools/shears # reset storage and fake players diff --git a/gm4_audere_shamir/data/gm4_audere_shamir/function/store_maximum.mcfunction b/gm4_audere_shamir/data/gm4_audere_shamir/function/store_maximum.mcfunction deleted file mode 100644 index 674f9c1f6d..0000000000 --- a/gm4_audere_shamir/data/gm4_audere_shamir/function/store_maximum.mcfunction +++ /dev/null @@ -1,37 +0,0 @@ -# @s = Audere tool item -# run from #gm4_metallurgy:apply_band - -execute store success score $success gm4_ml_data if items entity @s contents minecraft:netherite_shovel run data modify entity @s Item.components."minecraft:custom_data".gm4_audere_shamir.max_durability set value 2031 -execute unless score $success gm4_ml_data matches 1.. store success score $success gm4_ml_data if items entity @s contents minecraft:netherite_pickaxe run data modify entity @s Item.components."minecraft:custom_data".gm4_audere_shamir.max_durability set value 2031 -execute unless score $success gm4_ml_data matches 1.. store success score $success gm4_ml_data if items entity @s contents minecraft:netherite_hoe run data modify entity @s Item.components."minecraft:custom_data".gm4_audere_shamir.max_durability set value 2031 -execute unless score $success gm4_ml_data matches 1.. store success score $success gm4_ml_data if items entity @s contents minecraft:netherite_axe run data modify entity @s Item.components."minecraft:custom_data".gm4_audere_shamir.max_durability set value 2031 - -execute unless score $success gm4_ml_data matches 1.. store success score $success gm4_ml_data if items entity @s contents minecraft:diamond_shovel run data modify entity @s Item.components."minecraft:custom_data".gm4_audere_shamir.max_durability set value 1561 -execute unless score $success gm4_ml_data matches 1.. store success score $success gm4_ml_data if items entity @s contents minecraft:diamond_pickaxe run data modify entity @s Item.components."minecraft:custom_data".gm4_audere_shamir.max_durability set value 1561 -execute unless score $success gm4_ml_data matches 1.. store success score $success gm4_ml_data if items entity @s contents minecraft:diamond_hoe run data modify entity @s Item.components."minecraft:custom_data".gm4_audere_shamir.max_durability set value 1561 -execute unless score $success gm4_ml_data matches 1.. store success score $success gm4_ml_data if items entity @s contents minecraft:diamond_axe run data modify entity @s Item.components."minecraft:custom_data".gm4_audere_shamir.max_durability set value 1561 - -execute unless score $success gm4_ml_data matches 1.. store success score $success gm4_ml_data if items entity @s contents minecraft:iron_shovel run data modify entity @s Item.components."minecraft:custom_data".gm4_audere_shamir.max_durability set value 250 -execute unless score $success gm4_ml_data matches 1.. store success score $success gm4_ml_data if items entity @s contents minecraft:iron_pickaxe run data modify entity @s Item.components."minecraft:custom_data".gm4_audere_shamir.max_durability set value 250 -execute unless score $success gm4_ml_data matches 1.. store success score $success gm4_ml_data if items entity @s contents minecraft:iron_hoe run data modify entity @s Item.components."minecraft:custom_data".gm4_audere_shamir.max_durability set value 250 -execute unless score $success gm4_ml_data matches 1.. store success score $success gm4_ml_data if items entity @s contents minecraft:iron_axe run data modify entity @s Item.components."minecraft:custom_data".gm4_audere_shamir.max_durability set value 250 - -execute unless score $success gm4_ml_data matches 1.. store success score $success gm4_ml_data if items entity @s contents minecraft:stone_shovel run data modify entity @s Item.components."minecraft:custom_data".gm4_audere_shamir.max_durability set value 131 -execute unless score $success gm4_ml_data matches 1.. store success score $success gm4_ml_data if items entity @s contents minecraft:stone_pickaxe run data modify entity @s Item.components."minecraft:custom_data".gm4_audere_shamir.max_durability set value 131 -execute unless score $success gm4_ml_data matches 1.. store success score $success gm4_ml_data if items entity @s contents minecraft:stone_hoe run data modify entity @s Item.components."minecraft:custom_data".gm4_audere_shamir.max_durability set value 131 -execute unless score $success gm4_ml_data matches 1.. store success score $success gm4_ml_data if items entity @s contents minecraft:stone_axe run data modify entity @s Item.components."minecraft:custom_data".gm4_audere_shamir.max_durability set value 131 - -execute unless score $success gm4_ml_data matches 1.. store success score $success gm4_ml_data if items entity @s contents minecraft:wooden_shovel run data modify entity @s Item.components."minecraft:custom_data".gm4_audere_shamir.max_durability set value 59 -execute unless score $success gm4_ml_data matches 1.. store success score $success gm4_ml_data if items entity @s contents minecraft:wooden_pickaxe run data modify entity @s Item.components."minecraft:custom_data".gm4_audere_shamir.max_durability set value 59 -execute unless score $success gm4_ml_data matches 1.. store success score $success gm4_ml_data if items entity @s contents minecraft:wooden_hoe run data modify entity @s Item.components."minecraft:custom_data".gm4_audere_shamir.max_durability set value 59 -execute unless score $success gm4_ml_data matches 1.. store success score $success gm4_ml_data if items entity @s contents minecraft:wooden_axe run data modify entity @s Item.components."minecraft:custom_data".gm4_audere_shamir.max_durability set value 59 - -execute unless score $success gm4_ml_data matches 1.. store success score $success gm4_ml_data if items entity @s contents minecraft:golden_shovel run data modify entity @s Item.components."minecraft:custom_data".gm4_audere_shamir.max_durability set value 33 -execute unless score $success gm4_ml_data matches 1.. store success score $success gm4_ml_data if items entity @s contents minecraft:golden_pickaxe run data modify entity @s Item.components."minecraft:custom_data".gm4_audere_shamir.max_durability set value 33 -execute unless score $success gm4_ml_data matches 1.. store success score $success gm4_ml_data if items entity @s contents minecraft:golden_hoe run data modify entity @s Item.components."minecraft:custom_data".gm4_audere_shamir.max_durability set value 33 -execute unless score $success gm4_ml_data matches 1.. store success score $success gm4_ml_data if items entity @s contents minecraft:golden_axe run data modify entity @s Item.components."minecraft:custom_data".gm4_audere_shamir.max_durability set value 33 - -execute unless score $success gm4_ml_data matches 1.. store success score $success gm4_ml_data if items entity @s contents minecraft:shears run data modify entity @s Item.components."minecraft:custom_data".gm4_audere_shamir.max_durability set value 237 - -# reset fake player -scoreboard players reset $success gm4_ml_data diff --git a/gm4_audere_shamir/data/gm4_metallurgy/tags/function/apply_band.json b/gm4_audere_shamir/data/gm4_metallurgy/tags/function/apply_band.json deleted file mode 100644 index 977ecbaf1e..0000000000 --- a/gm4_audere_shamir/data/gm4_metallurgy/tags/function/apply_band.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "values": [ - "gm4_audere_shamir:store_maximum" - ] -} diff --git a/gm4_metallurgy/data/gm4_arborenda_shamir/function/player/modify_axe_durability.mcfunction b/gm4_metallurgy/data/gm4_arborenda_shamir/function/player/modify_axe_durability.mcfunction index 979b68e605..24d5cba6c8 100644 --- a/gm4_metallurgy/data/gm4_arborenda_shamir/function/player/modify_axe_durability.mcfunction +++ b/gm4_metallurgy/data/gm4_arborenda_shamir/function/player/modify_axe_durability.mcfunction @@ -3,10 +3,10 @@ # at @s # run from gm4_arborenda:player/chop -# get max damage for material type +# get max damage - 1 for material type execute if score @s gm4_use_axe_net matches 1.. run scoreboard players set $max_damage gm4_arb_data 2030 execute if score @s gm4_use_axe_dia matches 1.. run scoreboard players set $max_damage gm4_arb_data 1560 -execute if score @s gm4_use_axe_gol matches 1.. run scoreboard players set $max_damage gm4_arb_data 32 +execute if score @s gm4_use_axe_gol matches 1.. run scoreboard players set $max_damage gm4_arb_data 31 execute if score @s gm4_use_axe_iro matches 1.. run scoreboard players set $max_damage gm4_arb_data 249 execute if score @s gm4_use_axe_sto matches 1.. run scoreboard players set $max_damage gm4_arb_data 130 execute if score @s gm4_use_axe_woo matches 1.. run scoreboard players set $max_damage gm4_arb_data 58 diff --git a/gm4_metallurgy/data/gm4_moneo_shamir/function/active_tool.mcfunction b/gm4_metallurgy/data/gm4_moneo_shamir/function/active_tool.mcfunction index 3c8fb388ca..c8d6d0b407 100644 --- a/gm4_metallurgy/data/gm4_moneo_shamir/function/active_tool.mcfunction +++ b/gm4_metallurgy/data/gm4_moneo_shamir/function/active_tool.mcfunction @@ -16,5 +16,6 @@ execute if score $tool_max_damage gm4_ml_data matches 131 run function gm4_moneo execute if score $tool_max_damage gm4_ml_data matches 250 run function gm4_moneo_shamir:tools/materials/iron execute if score $tool_max_damage gm4_ml_data matches 1561 run function gm4_moneo_shamir:tools/materials/diamond execute if score $tool_max_damage gm4_ml_data matches 2031 run function gm4_moneo_shamir:tools/materials/netherite -execute if score $tool_max_damage gm4_ml_data matches 33 run function gm4_moneo_shamir:tools/materials/gold +# | gold used to be listed as 33 max damage, this is kept for compatibility with old items +execute if score $tool_max_damage gm4_ml_data matches 32..33 run function gm4_moneo_shamir:tools/materials/gold execute if score $tool_max_damage gm4_ml_data matches 237 run function gm4_moneo_shamir:tools/shears diff --git a/gm4_metallurgy/data/gm4_moneo_shamir/function/store_maximum.mcfunction b/gm4_metallurgy/data/gm4_moneo_shamir/function/store_maximum.mcfunction index 513e5ccb10..994af3a8ac 100644 --- a/gm4_metallurgy/data/gm4_moneo_shamir/function/store_maximum.mcfunction +++ b/gm4_metallurgy/data/gm4_moneo_shamir/function/store_maximum.mcfunction @@ -1,6 +1,7 @@ # run from #gm4_metallurgy:apply_band # @s = moneo tool item +# used by Audere Shamir as well execute if items entity @s contents minecraft:wooden_shovel run data modify entity @s Item.components."minecraft:custom_data".MaxDurability set value 59 execute if items entity @s contents minecraft:wooden_pickaxe run data modify entity @s Item.components."minecraft:custom_data".MaxDurability set value 59 execute if items entity @s contents minecraft:wooden_hoe run data modify entity @s Item.components."minecraft:custom_data".MaxDurability set value 59 @@ -26,10 +27,10 @@ execute if items entity @s contents minecraft:netherite_pickaxe run data modify execute if items entity @s contents minecraft:netherite_hoe run data modify entity @s Item.components."minecraft:custom_data".MaxDurability set value 2031 execute if items entity @s contents minecraft:netherite_axe run data modify entity @s Item.components."minecraft:custom_data".MaxDurability set value 2031 -execute if items entity @s contents minecraft:golden_shovel run data modify entity @s Item.components."minecraft:custom_data".MaxDurability set value 33 -execute if items entity @s contents minecraft:golden_pickaxe run data modify entity @s Item.components."minecraft:custom_data".MaxDurability set value 33 -execute if items entity @s contents minecraft:golden_hoe run data modify entity @s Item.components."minecraft:custom_data".MaxDurability set value 33 -execute if items entity @s contents minecraft:golden_axe run data modify entity @s Item.components."minecraft:custom_data".MaxDurability set value 33 +execute if items entity @s contents minecraft:golden_shovel run data modify entity @s Item.components."minecraft:custom_data".MaxDurability set value 32 +execute if items entity @s contents minecraft:golden_pickaxe run data modify entity @s Item.components."minecraft:custom_data".MaxDurability set value 32 +execute if items entity @s contents minecraft:golden_hoe run data modify entity @s Item.components."minecraft:custom_data".MaxDurability set value 32 +execute if items entity @s contents minecraft:golden_axe run data modify entity @s Item.components."minecraft:custom_data".MaxDurability set value 32 execute if items entity @s contents minecraft:shears run data modify entity @s Item.components."minecraft:custom_data".MaxDurability set value 237