Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# @s = players holding an Cavotio tool
# at @s
# run from tick

effect give @s haste 1 255 true
effect give @s weakness 1 4 true

execute if score @s gm4_use_pick_net matches 1.. positioned ^ ^ ^3 as @e[type=item,distance=..3.5,nbt={Age:0s}] run kill @s
execute if score @s gm4_use_pick_dia matches 1.. positioned ^ ^ ^3 as @e[type=item,distance=..3.5,nbt={Age:0s}] run kill @s
execute if score @s gm4_use_pick_gol matches 1.. positioned ^ ^ ^3 as @e[type=item,distance=..3.5,nbt={Age:0s}] run kill @s
execute if score @s gm4_use_pick_iro matches 1.. positioned ^ ^ ^3 as @e[type=item,distance=..3.5,nbt={Age:0s}] run kill @s
execute if score @s gm4_use_pick_sto matches 1.. positioned ^ ^ ^3 as @e[type=item,distance=..3.5,nbt={Age:0s}] run kill @s
execute if score @s gm4_use_pick_woo matches 1.. positioned ^ ^ ^3 as @e[type=item,distance=..3.5,nbt={Age:0s}] run kill @s
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# @s = band is trying to apply to
# run from #gm4_metallurgy:check_item_validity

execute if entity @e[type=item,tag=gm4_ml_source,dx=0,nbt={Item:{tag:{gm4_metallurgy:{stored_shamir:"cavotio"}}}}] run function gm4_cavotio_shamir:mark_item_validity
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# adds pages to the guidebook
# @s = player who's updating their guidebook
# located at @s
# run from gm4_cavotio_shamir:guidebook/verify_module

data modify storage gm4_guidebook:temp insert set value ['["",{"text":"◀ ","color":"#4AA0C7","clickEvent":{"action":"change_page","value":"2"},"hoverEvent":{"action":"show_text","contents":[{"translate":"%1$s%3427655$s","with":[{"text":"Return to Table of Contents"},{"translate":"text.gm4.guidebook.return_to_table"}],"italic":true,"color":"gold"}]}},{"translate":"%1$s%3427655$s","with":[{"text":"Back"},{"translate":"text.gm4.guidebook.back"}],"color":"#4AA0C7","clickEvent":{"action":"change_page","value":"2"},"hoverEvent":{"action":"show_text","contents":[{"translate":"%1$s%3427655$s","with":[{"text":"Return to Table of Contents"},{"translate":"text.gm4.guidebook.return_to_table"}],"italic":true,"color":"gold"}]}},{"text":"\\n"},{"text":"☶ ","color":"#864BC7","bold":true,"clickEvent":{"action":"open_url","value":"https://wiki.gm4.co/wiki/Metallurgy/Cavotio_Shamir"},"hoverEvent":{"action":"show_text","contents":[{"translate":"%1$s%3427655$s","with":[{"text":"Open External Wiki"},{"translate":"text.gm4.guidebook.open_wiki"}],"italic":true,"color":"gold"}]}},{"translate":"%1$s%3427655$s","with":[{"text":"Wiki"},{"translate":"text.gm4.guidebook.wiki"}],"color":"#864BC7","clickEvent":{"action":"open_url","value":"https://wiki.gm4.co/wiki/Metallurgy/Cavotio_Shamir"},"hoverEvent":{"action":"show_text","contents":[{"translate":"%1$s%3427655$s","with":[{"text":"Open External Wiki"},{"translate":"text.gm4.guidebook.open_wiki"}],"italic":true,"color":"gold"}]}},{"text":"\\n\\n"},{"text":"Cavotio Shamir","underlined":true},{"text":"\\n"},{"translate":"%1$s%3427655$s","with":[{"text":"Cavotio buffs mining speed, as durability decreases."},{"translate":"text.gm4.guidebook.cavotio_shamir.1"}]}]','["",{"text":"???","hoverEvent":{"action":"show_text","contents":[{"translate":"%1$s%3427655$s","with":[{"text":"Undiscovered"},{"translate":"text.gm4.guidebook.undiscovered"}],"italic":true,"color":"red"}]}}]']

# unlockable pages
execute if entity @s[advancements={gm4_guidebook:cavotio_shamir/page_1=true}] run data modify storage gm4_guidebook:temp insert[1] set value '["",{"translate":"%1$s%3427655$s","with":[{"text":"The Cavotio Shamir is found on Barium Bands. It can be placed onto tools.\\n\\nHigher levels of Haste are awarded for lower durability. The maximum level of Haste is IV, granted when the tool is at less than 3.66% durability."},{"translate":"text.gm4.guidebook.cavotio_shamir.2"}]}]'
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# tells the player that they discovered a page from this section
# @s = player who unlocked a guidebook page
# located at @s
# run from advancement gm4_guidebook:cavotio_shamir/page_<number>

tellraw @s ["",{"selector":"@s"},{"text":" "},{"translate":"%1$s%3427655$s","with":[{"text":"has discovered a guidebook page from"},{"translate":"%1$s%3427655$s","with":[{"translate":"text.gm4.guidebook.discovered"}]}]},{"text":" "},{"text":"[Cavotio Shamir]","color":"#4AA0C7","hoverEvent":{"action":"show_text","contents":[{"text":"Cavotio Shamir","color":"#4AA0C7"},{"text":"\n"},{"text":"Adds the shamir 'Cavotio' to metallurgy. Gain Haste with low durability tools.","italic":true,"color":"gray"}]}}]
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# checks if this is the next module to generate pages
# @s = player who's updating their guidebook
# located at @s
# run from #gm4_guidebook:add_pages

execute if data storage gm4_guidebook:temp module{id:"cavotio_shamir"} run function gm4_cavotio_shamir:guidebook/add_pages
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
scoreboard objectives add gm4_use_pick_net minecraft.used:minecraft.netherite_pickaxe
scoreboard objectives add gm4_use_pick_dia minecraft.used:minecraft.diamond_pickaxe
scoreboard objectives add gm4_use_pick_gol minecraft.used:minecraft.golden_pickaxe
scoreboard objectives add gm4_use_pick_iro minecraft.used:minecraft.iron_pickaxe
scoreboard objectives add gm4_use_pick_sto minecraft.used:minecraft.stone_pickaxe
scoreboard objectives add gm4_use_pick_woo minecraft.used:minecraft.wooden_pickaxe

execute unless score cavotio_shamir gm4_modules matches 1 run data modify storage gm4:log queue append value {type:"install",module:"Cavotio Shamir"}
scoreboard players set cavotio_shamir gm4_modules 1

# register shamir with lib_player_heads
execute unless data storage gm4_player_heads:register heads[{id:"gm4_cavotio_shamir:band/v0"}] run data modify storage gm4_player_heads:register heads append value {id:"gm4_cavotio_shamir:band/v0",name:"[Drop to Fix Item] gm4_cavotio_shamir:band",item:{gm4_metallurgy:{has_shamir:1b,stored_shamir:"cavotio",metal:{type:"thorium",amount:[12s],castable:1b},item:"obsidian_cast"},CustomModelData:3420123,display:{Name:'{"italic":false,"translate":"%1$s%3427655$s","with":["Obsidian Cast",{"translate":"item.gm4.metallurgy.obsidian_cast"}]}',Lore:['{"italic":false,"color":"#767676","translate":"%1$s%3427655$s","with":["Thorium Band",{"translate":"item.gm4.metallurgy.band","with":[{"translate":"item.gm4.metallurgy.thorium"}]}]}','{"italic":false,"color":"aqua","translate":"%1$s%3427655$s","with":["Shamir",{"translate":"item.gm4.metallurgy.shamir"}]}','{"italic":false,"color":"gray","translate":"%1$s%3427655$s","with":["Cavotio",{"translate":"item.gm4.shamir.cavotio"}]}']}}}

schedule function gm4_cavotio_shamir:tick 1t

# guidebook
execute if score gm4_guidebook load.status matches 1 run summon marker ~ 367.217754760584 ~ {CustomName:'"gm4_cavotio_shamir_guide"',Tags:["gm4_guide"],data:{type:"_expansion",base:"metallurgy",id:"cavotio_shamir",page_count:2,line_count:1,module_name:"Cavotio Shamir"}}

#$moduleUpdateList
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
execute if score gm4 load.status matches 1 if score gm4_metallurgy load.status matches 1 run scoreboard players set gm4_cavotio_shamir load.status 1
execute unless score gm4 load.status matches 1 run data modify storage gm4:log queue append value {type:"missing",module:"Cavotio Shamir",require:"Gamemode 4"}
execute unless score gm4_metallurgy load.status matches 1 run data modify storage gm4:log queue append value {type:"missing",module:"Cavotio Shamir",require:"Metallurgy"}

execute if score gm4_cavotio_shamir load.status matches 1 run function gm4_cavotio_shamir:init
execute unless score gm4_cavotio_shamir load.status matches 1 run schedule clear gm4_cavotio_shamir:main
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# @s = band is trying to apply to
# run from check_item_validity

execute unless score valid_item gm4_ml_data matches 1 store success score valid_item gm4_ml_data if entity @s[nbt={Item:{id:"minecraft:wooden_pickaxe"}}]
execute unless score valid_item gm4_ml_data matches 1 store success score valid_item gm4_ml_data if entity @s[nbt={Item:{id:"minecraft:stone_pickaxe"}}]
execute unless score valid_item gm4_ml_data matches 1 store success score valid_item gm4_ml_data if entity @s[nbt={Item:{id:"minecraft:iron_pickaxe"}}]
execute unless score valid_item gm4_ml_data matches 1 store success score valid_item gm4_ml_data if entity @s[nbt={Item:{id:"minecraft:golden_pickaxe"}}]
execute unless score valid_item gm4_ml_data matches 1 store success score valid_item gm4_ml_data if entity @s[nbt={Item:{id:"minecraft:diamond_pickaxe"}}]
execute unless score valid_item gm4_ml_data matches 1 store success score valid_item gm4_ml_data if entity @s[nbt={Item:{id:"minecraft:netherite_pickaxe"}}]
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# @s = a mould with matching metal inside
# run from metallurgy:casting/summon_band/barium via #gm4_metallurgy:summon_band/barium

loot spawn ~ ~ ~ loot gm4_cavotio_shamir:band
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
execute as @a[gamemode=!spectator,predicate=gm4_cavotio_shamir:holding_cavotio] at @s run function gm4_cavotio_shamir:active_tool

scoreboard players reset @a gm4_use_pick_net
scoreboard players reset @a gm4_use_pick_dia
scoreboard players reset @a gm4_use_pick_gol
scoreboard players reset @a gm4_use_pick_iro
scoreboard players reset @a gm4_use_pick_sto
scoreboard players reset @a gm4_use_pick_woo

schedule function gm4_cavotio_shamir:tick 1t
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
[
{
"function": "minecraft:set_attributes",
"modifiers": [
{
"attribute": "minecraft:generic.attack_speed",
"name": "gm4_cavotio",
"amount": -0.9,
"operation": "multiply_base",
"slot": "mainhand"
}
]
}
]
36 changes: 36 additions & 0 deletions gm4_cavotio_shamir/data/gm4_cavotio_shamir/loot_tables/band.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
{
"pools": [
{
"rolls": 1,
"entries": [
{
"type": "minecraft:loot_table",
"name": "gm4_metallurgy:thorium_band",
"functions": [
{
"function": "minecraft:set_nbt",
"tag": "{CustomModelData:3420120,SkullOwner:{Name:\"[Drop to Fix Item] gm4_cavotio_shamir:band/v0\"},gm4_metallurgy:{stored_shamir:\"cavotio\"}}"
},
{
"function": "minecraft:set_lore",
"replace": false,
"lore": [
{
"translate": "%1$s%3427655$s",
"with": [
"Cavotio",
{
"translate": "item.gm4.shamir.cavotio"
}
],
"italic": false,
"color": "gray"
}
]
}
]
}
]
}
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"condition": "minecraft:entity_properties",
"entity": "this",
"predicate": {
"equipment": {
"mainhand": {
"tag": "gm4_cavotio_shamir:tools",
"nbt": "{gm4_metallurgy:{has_shamir:1b,active_shamir:'cavotio'}}"
}
}
}
}
28 changes: 28 additions & 0 deletions gm4_cavotio_shamir/data/gm4_cavotio_shamir/tags/items/tools.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
{
"values": [
"minecraft:netherite_shovel",
"minecraft:netherite_pickaxe",
"minecraft:netherite_hoe",
"minecraft:netherite_axe",
"minecraft:golden_shovel",
"minecraft:golden_pickaxe",
"minecraft:golden_hoe",
"minecraft:golden_axe",
"minecraft:diamond_shovel",
"minecraft:diamond_pickaxe",
"minecraft:diamond_hoe",
"minecraft:diamond_axe",
"minecraft:iron_shovel",
"minecraft:iron_pickaxe",
"minecraft:iron_hoe",
"minecraft:iron_axe",
"minecraft:stone_shovel",
"minecraft:stone_pickaxe",
"minecraft:stone_hoe",
"minecraft:stone_axe",
"minecraft:wooden_shovel",
"minecraft:wooden_pickaxe",
"minecraft:wooden_hoe",
"minecraft:wooden_axe"
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
{
"display": {
"icon": {
"item": "minecraft:anvil",
"nbt": "{CustomModelData:3420120}"
},
"title": {
"text": "Check your guidebook!",
"color": "#4AA0C7",
"italic": true
},
"description": "Cavotio Shamir",
"frame": "goal",
"show_toast": true,
"announce_to_chat": false,
"hidden": true
},
"parent": "gm4_guidebook:metallurgy/page_6",
"criteria": {
"requirement": {
"trigger": "minecraft:inventory_changed",
"conditions": {
"player": [
{
"condition": "minecraft:inverted",
"term": {
"condition": "minecraft:entity_properties",
"entity": "this",
"predicate": {
"player": {
"gamemode": "spectator"
}
}
}
},
{
"condition": "minecraft:value_check",
"value": {
"type": "minecraft:score",
"target": {
"type": "minecraft:fixed",
"name": "gm4_guidebook"
},
"score": "load.status"
},
"range": 1
},
{
"condition": "minecraft:value_check",
"value": {
"type": "minecraft:score",
"target": {
"type": "minecraft:fixed",
"name": "gm4_cavotio_shamir"
},
"score": "load.status"
},
"range": 1
}
],
"items": [
{
"nbt": "{gm4_metallurgy:{has_shamir:1b,active_shamir:'cavotio'}}"
}
]
}
}
},
"rewards": {
"function": "gm4_cavotio_shamir:guidebook/unlock_page"
}
}
7 changes: 7 additions & 0 deletions gm4_cavotio_shamir/data/gm4_guidebook/advancements/root.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"criteria": {
"requirement": {
"trigger": "minecraft:impossible"
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"values": [
"gm4_cavotio_shamir:guidebook/verify_module"
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"values": []
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"values": [
"gm4_cavotio_shamir:check_item_validity"
]
}


Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"values":[
"gm4_cavotio_shamir:summon_band"
]
}


Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"values": [
{ "id": "#load:gm4_metallurgy", "required": false },
"gm4_cavotio_shamir:load"
]
}
5 changes: 5 additions & 0 deletions gm4_cavotio_shamir/data/load/tags/functions/load.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"values": [
"#load:gm4_cavotio_shamir"
]
}
40 changes: 40 additions & 0 deletions gm4_cavotio_shamir/pack.mcmeta
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
{
"pack": {
"pack_format": 8,
"description": [
"Cavotio Shamir",
"\n",
{
"text": "Gamemode 4 for 1.17",
"color": "#4AA0C7"
}
]
},
"module_name": "Cavotio Shamir",
"module_id": "cavotio_shamir",
"hidden": false,
"site_description": "Adds the shamir 'Cavotio' to metallurgy. Gain Haste with low durability tools.",
"site_categories": [
"Metallurgy"
],
"video_link": "",
"wiki_link": "https://wiki.gm4.co/wiki/Metallurgy/Cavotio_Shamir",
"required_modules": [
"metallurgy"
],
"recommended_modules": [],
"credits": {
"Creator": [
[
"Kattacka",
""
]
],
"Icon Design": [
[
"BluePsychoRanger",
"https://twitter.com/BluPsychoRanger"
]
]
}
}
Binary file added gm4_cavotio_shamir/pack.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading