From 7018eb8ebae3f01f56af2a61a9c172eaf5e2abce Mon Sep 17 00:00:00 2001 From: runcows Date: Tue, 2 Dec 2025 20:52:08 +0900 Subject: [PATCH 1/4] Make moneo work for offhands shears --- .../function/shamir_in_hand.mcfunction | 1 + .../predicate/moneo_active_offhand.json | 13 +++++++++++++ .../function/active_tool_offhand.mcfunction | 11 +++++++++++ 3 files changed, 25 insertions(+) create mode 100644 gm4_metallurgy/data/gm4_metallurgy/predicate/moneo_active_offhand.json create mode 100644 gm4_metallurgy/data/gm4_moneo_shamir/function/active_tool_offhand.mcfunction diff --git a/gm4_metallurgy/data/gm4_metallurgy/function/shamir_in_hand.mcfunction b/gm4_metallurgy/data/gm4_metallurgy/function/shamir_in_hand.mcfunction index a891eae5f9..4bc5bf51ac 100644 --- a/gm4_metallurgy/data/gm4_metallurgy/function/shamir_in_hand.mcfunction +++ b/gm4_metallurgy/data/gm4_metallurgy/function/shamir_in_hand.mcfunction @@ -4,6 +4,7 @@ execute if predicate gm4_metallurgy:arborenda_active run function gm4_arborenda_shamir:active execute if predicate gm4_metallurgy:hypexperia_active run function gm4_hypexperia_shamir:active execute if predicate gm4_metallurgy:moneo_active run function gm4_moneo_shamir:active_tool +execute if predicate gm4_metallurgy:moneo_active_offhand run function gm4_moneo_shamir:active_tool_offhand execute if entity @s[scores={gm4_note_collect=1..},predicate=gm4_metallurgy:musical_active] run function gm4_musical_shamir:active execute if predicate gm4_metallurgy:sensus_active run function gm4_sensus_shamir:active execute if predicate gm4_metallurgy:infinitas_active run function gm4_infinitas_shamir:active diff --git a/gm4_metallurgy/data/gm4_metallurgy/predicate/moneo_active_offhand.json b/gm4_metallurgy/data/gm4_metallurgy/predicate/moneo_active_offhand.json new file mode 100644 index 0000000000..b20d5d99a9 --- /dev/null +++ b/gm4_metallurgy/data/gm4_metallurgy/predicate/moneo_active_offhand.json @@ -0,0 +1,13 @@ +{ + "condition": "minecraft:entity_properties", + "entity": "this", + "predicate": { + "equipment": { + "offhand": { + "predicates": { + "minecraft:custom_data": "{gm4_metallurgy:{has_shamir:1b,active_shamir:'moneo'}}" + } + } + } + } +} diff --git a/gm4_metallurgy/data/gm4_moneo_shamir/function/active_tool_offhand.mcfunction b/gm4_metallurgy/data/gm4_moneo_shamir/function/active_tool_offhand.mcfunction new file mode 100644 index 0000000000..13cebb696d --- /dev/null +++ b/gm4_metallurgy/data/gm4_moneo_shamir/function/active_tool_offhand.mcfunction @@ -0,0 +1,11 @@ +# @s = players holding a moneo tool +# run from shamir_in_hand + +scoreboard players set $tool_current_damage gm4_ml_data 0 +scoreboard players set $tool_max_damage gm4_ml_data 0 + +execute store result score $tool_current_damage gm4_ml_data run data get entity @s equipment.offhand.components."minecraft:damage" +execute store result score $tool_max_damage gm4_ml_data run data get entity @s equipment.offhand.components."minecraft:custom_data".MaxDurability + +# activate moneo +execute if score $tool_max_damage gm4_ml_data matches 237 run function gm4_moneo_shamir:tools/shears From 6c0e552d04a2d09f6963203030a53a15db01ce40 Mon Sep 17 00:00:00 2001 From: runcows Date: Wed, 3 Dec 2025 13:01:27 +0900 Subject: [PATCH 2/4] Offhand moneo for all >:D --- .../function/active_tool_offhand.mcfunction | 11 +++++++++++ .../function/update_netherite_offhand.mcfunction | 8 ++++++++ .../predicate/holding_netherite_offhand.json | 11 +++++++++++ 3 files changed, 30 insertions(+) create mode 100644 gm4_metallurgy/data/gm4_moneo_shamir/function/update_netherite_offhand.mcfunction create mode 100644 gm4_metallurgy/data/gm4_moneo_shamir/predicate/holding_netherite_offhand.json diff --git a/gm4_metallurgy/data/gm4_moneo_shamir/function/active_tool_offhand.mcfunction b/gm4_metallurgy/data/gm4_moneo_shamir/function/active_tool_offhand.mcfunction index 13cebb696d..a6ea3f54cc 100644 --- a/gm4_metallurgy/data/gm4_moneo_shamir/function/active_tool_offhand.mcfunction +++ b/gm4_metallurgy/data/gm4_moneo_shamir/function/active_tool_offhand.mcfunction @@ -7,5 +7,16 @@ scoreboard players set $tool_max_damage gm4_ml_data 0 execute store result score $tool_current_damage gm4_ml_data run data get entity @s equipment.offhand.components."minecraft:damage" execute store result score $tool_max_damage gm4_ml_data run data get entity @s equipment.offhand.components."minecraft:custom_data".MaxDurability +# update newly upgraded netherite gear +execute if score $tool_max_damage gm4_ml_data matches 1561 if predicate gm4_moneo_shamir:holding_netherite_offhand run function gm4_moneo_shamir:update_netherite_offhand + # activate moneo +execute if score $tool_max_damage gm4_ml_data matches 59 run function gm4_moneo_shamir:tools/materials/wood +execute if score $tool_max_damage gm4_ml_data matches 131 run function gm4_moneo_shamir:tools/materials/stone +execute if score $tool_max_damage gm4_ml_data matches 190 run function gm4_moneo_shamir:tools/materials/copper +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 +# | 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/update_netherite_offhand.mcfunction b/gm4_metallurgy/data/gm4_moneo_shamir/function/update_netherite_offhand.mcfunction new file mode 100644 index 0000000000..d60a994aa6 --- /dev/null +++ b/gm4_metallurgy/data/gm4_moneo_shamir/function/update_netherite_offhand.mcfunction @@ -0,0 +1,8 @@ +# @s = player holding a netherite moneo tool that has the wrong MaxDurability +# run from active_tool_offhand + +# item modifier +item modify entity @s weapon.offhand gm4_moneo_shamir:netherite_update + +# correctly set the max damage +scoreboard players set $tool_max_damage gm4_ml_data 2031 diff --git a/gm4_metallurgy/data/gm4_moneo_shamir/predicate/holding_netherite_offhand.json b/gm4_metallurgy/data/gm4_moneo_shamir/predicate/holding_netherite_offhand.json new file mode 100644 index 0000000000..038b8f064e --- /dev/null +++ b/gm4_metallurgy/data/gm4_moneo_shamir/predicate/holding_netherite_offhand.json @@ -0,0 +1,11 @@ +{ + "condition": "minecraft:entity_properties", + "entity": "this", + "predicate": { + "equipment": { + "offhand": { + "items": "#gm4_moneo_shamir:netherite_tools" + } + } + } +} From 1c56058f85fe0e4e49b9aa71a9a7b1cff1261828 Mon Sep 17 00:00:00 2001 From: runcows Date: Wed, 3 Dec 2025 13:45:45 +0900 Subject: [PATCH 3/4] Update relevant header comments with location --- .../data/gm4_metallurgy/function/shamir_in_hand.mcfunction | 1 + .../data/gm4_moneo_shamir/function/active_tool.mcfunction | 1 + .../gm4_moneo_shamir/function/active_tool_offhand.mcfunction | 1 + .../function/tools/materials/copper.mcfunction | 3 ++- .../function/tools/materials/diamond.mcfunction | 3 ++- .../gm4_moneo_shamir/function/tools/materials/gold.mcfunction | 3 ++- .../gm4_moneo_shamir/function/tools/materials/iron.mcfunction | 3 ++- .../function/tools/materials/netherite.mcfunction | 3 ++- .../gm4_moneo_shamir/function/tools/materials/stone.mcfunction | 3 ++- .../gm4_moneo_shamir/function/tools/materials/wood.mcfunction | 3 ++- .../data/gm4_moneo_shamir/function/tools/shears.mcfunction | 3 ++- .../data/gm4_moneo_shamir/function/update_netherite.mcfunction | 1 + .../function/update_netherite_offhand.mcfunction | 1 + 13 files changed, 21 insertions(+), 8 deletions(-) diff --git a/gm4_metallurgy/data/gm4_metallurgy/function/shamir_in_hand.mcfunction b/gm4_metallurgy/data/gm4_metallurgy/function/shamir_in_hand.mcfunction index 4bc5bf51ac..854801d545 100644 --- a/gm4_metallurgy/data/gm4_metallurgy/function/shamir_in_hand.mcfunction +++ b/gm4_metallurgy/data/gm4_metallurgy/function/shamir_in_hand.mcfunction @@ -1,4 +1,5 @@ # @s = player with an active shamir in their hands +# at @s # run from player execute if predicate gm4_metallurgy:arborenda_active run function gm4_arborenda_shamir:active 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 e8c439dc64..003eea2fbc 100644 --- a/gm4_metallurgy/data/gm4_moneo_shamir/function/active_tool.mcfunction +++ b/gm4_metallurgy/data/gm4_moneo_shamir/function/active_tool.mcfunction @@ -1,4 +1,5 @@ # @s = players holding a moneo tool +# at @s # run from shamir_in_hand scoreboard players set $tool_current_damage gm4_ml_data 0 diff --git a/gm4_metallurgy/data/gm4_moneo_shamir/function/active_tool_offhand.mcfunction b/gm4_metallurgy/data/gm4_moneo_shamir/function/active_tool_offhand.mcfunction index a6ea3f54cc..0d7eb4f9d3 100644 --- a/gm4_metallurgy/data/gm4_moneo_shamir/function/active_tool_offhand.mcfunction +++ b/gm4_metallurgy/data/gm4_moneo_shamir/function/active_tool_offhand.mcfunction @@ -1,4 +1,5 @@ # @s = players holding a moneo tool +# at @s # run from shamir_in_hand scoreboard players set $tool_current_damage gm4_ml_data 0 diff --git a/gm4_metallurgy/data/gm4_moneo_shamir/function/tools/materials/copper.mcfunction b/gm4_metallurgy/data/gm4_moneo_shamir/function/tools/materials/copper.mcfunction index dc57284f80..aabcc68445 100644 --- a/gm4_metallurgy/data/gm4_moneo_shamir/function/tools/materials/copper.mcfunction +++ b/gm4_metallurgy/data/gm4_moneo_shamir/function/tools/materials/copper.mcfunction @@ -1,5 +1,6 @@ -# run from active_tool # @s = player holding the moneo tool +# at @s +# run from active_tool scoreboard players operation $tool_max_damage gm4_ml_data -= $tool_current_damage gm4_ml_data diff --git a/gm4_metallurgy/data/gm4_moneo_shamir/function/tools/materials/diamond.mcfunction b/gm4_metallurgy/data/gm4_moneo_shamir/function/tools/materials/diamond.mcfunction index 7e81ae009e..99c8956653 100644 --- a/gm4_metallurgy/data/gm4_moneo_shamir/function/tools/materials/diamond.mcfunction +++ b/gm4_metallurgy/data/gm4_moneo_shamir/function/tools/materials/diamond.mcfunction @@ -1,5 +1,6 @@ -# run from active_tool # @s = player holding the moneo tool +# at @s +# run from active_tool scoreboard players operation $tool_max_damage gm4_ml_data -= $tool_current_damage gm4_ml_data diff --git a/gm4_metallurgy/data/gm4_moneo_shamir/function/tools/materials/gold.mcfunction b/gm4_metallurgy/data/gm4_moneo_shamir/function/tools/materials/gold.mcfunction index 1d8130710a..f98d8217ca 100644 --- a/gm4_metallurgy/data/gm4_moneo_shamir/function/tools/materials/gold.mcfunction +++ b/gm4_metallurgy/data/gm4_moneo_shamir/function/tools/materials/gold.mcfunction @@ -1,5 +1,6 @@ -# run from active_tool # @s = player holding the moneo tool +# at @s +# run from active_tool scoreboard players operation $tool_max_damage gm4_ml_data -= $tool_current_damage gm4_ml_data diff --git a/gm4_metallurgy/data/gm4_moneo_shamir/function/tools/materials/iron.mcfunction b/gm4_metallurgy/data/gm4_moneo_shamir/function/tools/materials/iron.mcfunction index 8b564f9c8d..dabbcccae4 100644 --- a/gm4_metallurgy/data/gm4_moneo_shamir/function/tools/materials/iron.mcfunction +++ b/gm4_metallurgy/data/gm4_moneo_shamir/function/tools/materials/iron.mcfunction @@ -1,5 +1,6 @@ -# run from active_tool # @s = player holding the moneo tool +# at @s +# run from active_tool scoreboard players operation $tool_max_damage gm4_ml_data -= $tool_current_damage gm4_ml_data diff --git a/gm4_metallurgy/data/gm4_moneo_shamir/function/tools/materials/netherite.mcfunction b/gm4_metallurgy/data/gm4_moneo_shamir/function/tools/materials/netherite.mcfunction index 7e81ae009e..99c8956653 100644 --- a/gm4_metallurgy/data/gm4_moneo_shamir/function/tools/materials/netherite.mcfunction +++ b/gm4_metallurgy/data/gm4_moneo_shamir/function/tools/materials/netherite.mcfunction @@ -1,5 +1,6 @@ -# run from active_tool # @s = player holding the moneo tool +# at @s +# run from active_tool scoreboard players operation $tool_max_damage gm4_ml_data -= $tool_current_damage gm4_ml_data diff --git a/gm4_metallurgy/data/gm4_moneo_shamir/function/tools/materials/stone.mcfunction b/gm4_metallurgy/data/gm4_moneo_shamir/function/tools/materials/stone.mcfunction index f7847068b4..7290d41ee6 100644 --- a/gm4_metallurgy/data/gm4_moneo_shamir/function/tools/materials/stone.mcfunction +++ b/gm4_metallurgy/data/gm4_moneo_shamir/function/tools/materials/stone.mcfunction @@ -1,5 +1,6 @@ -# run from active_tool # @s = player holding the moneo tool +# at @s +# run from active_tool scoreboard players operation $tool_max_damage gm4_ml_data -= $tool_current_damage gm4_ml_data diff --git a/gm4_metallurgy/data/gm4_moneo_shamir/function/tools/materials/wood.mcfunction b/gm4_metallurgy/data/gm4_moneo_shamir/function/tools/materials/wood.mcfunction index 7c806ae7ea..bf65f165be 100644 --- a/gm4_metallurgy/data/gm4_moneo_shamir/function/tools/materials/wood.mcfunction +++ b/gm4_metallurgy/data/gm4_moneo_shamir/function/tools/materials/wood.mcfunction @@ -1,5 +1,6 @@ -# run from active_tool # @s = player holding the moneo tool +# at @s +# run from active_tool scoreboard players operation $tool_max_damage gm4_ml_data -= $tool_current_damage gm4_ml_data diff --git a/gm4_metallurgy/data/gm4_moneo_shamir/function/tools/shears.mcfunction b/gm4_metallurgy/data/gm4_moneo_shamir/function/tools/shears.mcfunction index b876ef4914..93c8f61d18 100644 --- a/gm4_metallurgy/data/gm4_moneo_shamir/function/tools/shears.mcfunction +++ b/gm4_metallurgy/data/gm4_moneo_shamir/function/tools/shears.mcfunction @@ -1,5 +1,6 @@ -# run from active_tool # @s = player holding the moneo tool +# at @s +# run from active_tool scoreboard players operation $tool_max_damage gm4_ml_data -= $tool_current_damage gm4_ml_data diff --git a/gm4_metallurgy/data/gm4_moneo_shamir/function/update_netherite.mcfunction b/gm4_metallurgy/data/gm4_moneo_shamir/function/update_netherite.mcfunction index b7acf6376c..416c00f751 100644 --- a/gm4_metallurgy/data/gm4_moneo_shamir/function/update_netherite.mcfunction +++ b/gm4_metallurgy/data/gm4_moneo_shamir/function/update_netherite.mcfunction @@ -1,4 +1,5 @@ # @s = player holding a netherite moneo tool that has the wrong MaxDurability +# at @s # run from active_tool # item modifier diff --git a/gm4_metallurgy/data/gm4_moneo_shamir/function/update_netherite_offhand.mcfunction b/gm4_metallurgy/data/gm4_moneo_shamir/function/update_netherite_offhand.mcfunction index d60a994aa6..6629613f93 100644 --- a/gm4_metallurgy/data/gm4_moneo_shamir/function/update_netherite_offhand.mcfunction +++ b/gm4_metallurgy/data/gm4_moneo_shamir/function/update_netherite_offhand.mcfunction @@ -1,4 +1,5 @@ # @s = player holding a netherite moneo tool that has the wrong MaxDurability +# at @s # run from active_tool_offhand # item modifier From 2c488088deeecf037bc7b0cf712f99b3c02acc9d Mon Sep 17 00:00:00 2001 From: runcows Date: Wed, 3 Dec 2025 13:51:01 +0900 Subject: [PATCH 4/4] Actually update header comments properly --- .../gm4_moneo_shamir/function/tools/materials/copper.mcfunction | 2 +- .../function/tools/materials/diamond.mcfunction | 2 +- .../gm4_moneo_shamir/function/tools/materials/gold.mcfunction | 2 +- .../gm4_moneo_shamir/function/tools/materials/iron.mcfunction | 2 +- .../function/tools/materials/netherite.mcfunction | 2 +- .../gm4_moneo_shamir/function/tools/materials/stone.mcfunction | 2 +- .../gm4_moneo_shamir/function/tools/materials/wood.mcfunction | 2 +- .../data/gm4_moneo_shamir/function/tools/shears.mcfunction | 2 +- 8 files changed, 8 insertions(+), 8 deletions(-) diff --git a/gm4_metallurgy/data/gm4_moneo_shamir/function/tools/materials/copper.mcfunction b/gm4_metallurgy/data/gm4_moneo_shamir/function/tools/materials/copper.mcfunction index aabcc68445..2b64876d44 100644 --- a/gm4_metallurgy/data/gm4_moneo_shamir/function/tools/materials/copper.mcfunction +++ b/gm4_metallurgy/data/gm4_moneo_shamir/function/tools/materials/copper.mcfunction @@ -1,6 +1,6 @@ # @s = player holding the moneo tool # at @s -# run from active_tool +# run from active_tool and active_tool_offhand scoreboard players operation $tool_max_damage gm4_ml_data -= $tool_current_damage gm4_ml_data diff --git a/gm4_metallurgy/data/gm4_moneo_shamir/function/tools/materials/diamond.mcfunction b/gm4_metallurgy/data/gm4_moneo_shamir/function/tools/materials/diamond.mcfunction index 99c8956653..e1fa1fe314 100644 --- a/gm4_metallurgy/data/gm4_moneo_shamir/function/tools/materials/diamond.mcfunction +++ b/gm4_metallurgy/data/gm4_moneo_shamir/function/tools/materials/diamond.mcfunction @@ -1,6 +1,6 @@ # @s = player holding the moneo tool # at @s -# run from active_tool +# run from active_tool and active_tool_offhand scoreboard players operation $tool_max_damage gm4_ml_data -= $tool_current_damage gm4_ml_data diff --git a/gm4_metallurgy/data/gm4_moneo_shamir/function/tools/materials/gold.mcfunction b/gm4_metallurgy/data/gm4_moneo_shamir/function/tools/materials/gold.mcfunction index f98d8217ca..0dafda74b9 100644 --- a/gm4_metallurgy/data/gm4_moneo_shamir/function/tools/materials/gold.mcfunction +++ b/gm4_metallurgy/data/gm4_moneo_shamir/function/tools/materials/gold.mcfunction @@ -1,6 +1,6 @@ # @s = player holding the moneo tool # at @s -# run from active_tool +# run from active_tool and active_tool_offhand scoreboard players operation $tool_max_damage gm4_ml_data -= $tool_current_damage gm4_ml_data diff --git a/gm4_metallurgy/data/gm4_moneo_shamir/function/tools/materials/iron.mcfunction b/gm4_metallurgy/data/gm4_moneo_shamir/function/tools/materials/iron.mcfunction index dabbcccae4..ce8413d586 100644 --- a/gm4_metallurgy/data/gm4_moneo_shamir/function/tools/materials/iron.mcfunction +++ b/gm4_metallurgy/data/gm4_moneo_shamir/function/tools/materials/iron.mcfunction @@ -1,6 +1,6 @@ # @s = player holding the moneo tool # at @s -# run from active_tool +# run from active_tool and active_tool_offhand scoreboard players operation $tool_max_damage gm4_ml_data -= $tool_current_damage gm4_ml_data diff --git a/gm4_metallurgy/data/gm4_moneo_shamir/function/tools/materials/netherite.mcfunction b/gm4_metallurgy/data/gm4_moneo_shamir/function/tools/materials/netherite.mcfunction index 99c8956653..e1fa1fe314 100644 --- a/gm4_metallurgy/data/gm4_moneo_shamir/function/tools/materials/netherite.mcfunction +++ b/gm4_metallurgy/data/gm4_moneo_shamir/function/tools/materials/netherite.mcfunction @@ -1,6 +1,6 @@ # @s = player holding the moneo tool # at @s -# run from active_tool +# run from active_tool and active_tool_offhand scoreboard players operation $tool_max_damage gm4_ml_data -= $tool_current_damage gm4_ml_data diff --git a/gm4_metallurgy/data/gm4_moneo_shamir/function/tools/materials/stone.mcfunction b/gm4_metallurgy/data/gm4_moneo_shamir/function/tools/materials/stone.mcfunction index 7290d41ee6..c1b839a6b8 100644 --- a/gm4_metallurgy/data/gm4_moneo_shamir/function/tools/materials/stone.mcfunction +++ b/gm4_metallurgy/data/gm4_moneo_shamir/function/tools/materials/stone.mcfunction @@ -1,6 +1,6 @@ # @s = player holding the moneo tool # at @s -# run from active_tool +# run from active_tool and active_tool_offhand scoreboard players operation $tool_max_damage gm4_ml_data -= $tool_current_damage gm4_ml_data diff --git a/gm4_metallurgy/data/gm4_moneo_shamir/function/tools/materials/wood.mcfunction b/gm4_metallurgy/data/gm4_moneo_shamir/function/tools/materials/wood.mcfunction index bf65f165be..2830dbc072 100644 --- a/gm4_metallurgy/data/gm4_moneo_shamir/function/tools/materials/wood.mcfunction +++ b/gm4_metallurgy/data/gm4_moneo_shamir/function/tools/materials/wood.mcfunction @@ -1,6 +1,6 @@ # @s = player holding the moneo tool # at @s -# run from active_tool +# run from active_tool and active_tool_offhand scoreboard players operation $tool_max_damage gm4_ml_data -= $tool_current_damage gm4_ml_data diff --git a/gm4_metallurgy/data/gm4_moneo_shamir/function/tools/shears.mcfunction b/gm4_metallurgy/data/gm4_moneo_shamir/function/tools/shears.mcfunction index 93c8f61d18..242ac77fec 100644 --- a/gm4_metallurgy/data/gm4_moneo_shamir/function/tools/shears.mcfunction +++ b/gm4_metallurgy/data/gm4_moneo_shamir/function/tools/shears.mcfunction @@ -1,6 +1,6 @@ # @s = player holding the moneo tool # at @s -# run from active_tool +# run from active_tool and active_tool_offhand scoreboard players operation $tool_max_damage gm4_ml_data -= $tool_current_damage gm4_ml_data