-
-
Notifications
You must be signed in to change notification settings - Fork 58
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implement Crafting Recipe for Bottled Magicol
- Loading branch information
Showing
12 changed files
with
310 additions
and
39 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
21 changes: 21 additions & 0 deletions
21
...rons/data/gm4_zauber_cauldrons/functions/recipes/magicol/bottled/select_bottle.mcfunction
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
# @s = magicol zauber cauldron with water bottle and prismarine crystals inside | ||
# at center of block | ||
# run from cauldron/recipe_checks | ||
|
||
# set expected fullness for these recipes | ||
scoreboard players set $expected_item_amount gm4_zc_fullness 3 | ||
|
||
# set sip level returned when crafting multi-sips, in case another module messed with these presets | ||
execute if score $has_soul_fire_heatsource gm4_zc_data matches 1.. run data modify storage gm4_zauber_cauldrons:blueprint/item/multi_sip gm4_zauber_cauldrons.bottle set value {sips:9,size:9,multi_use:1b} | ||
|
||
# select bottle type | ||
# called functions are generated via beet from templates | ||
# generated with the help of bolt | ||
for bottle_data in ctx.meta['potion_bottles']: | ||
execute unless score $recipe_success gm4_zc_data matches 1.. if data storage gm4_zauber_cauldrons:temp/cauldron/ingredients items[{Count:1b,tag:{gm4_zauber_cauldrons:{item:bottle_data['item_id']}}}] run function f"gm4_zauber_cauldrons:recipes/magicol/bottled/{bottle_data['bottle']}/select_color" | ||
|
||
# use water or powder snow and play sound once a recipe ran | ||
execute if score $recipe_success gm4_zc_data matches 1 run function gm4_zauber_cauldrons:recipes/magicol/bottled/use_cauldron | ||
|
||
# reset fake players | ||
scoreboard players reset $expected_item_amount gm4_zc_fullness |
16 changes: 16 additions & 0 deletions
16
...drons/data/gm4_zauber_cauldrons/functions/recipes/magicol/bottled/use_cauldron.mcfunction
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
# @s = boiling zauber cauldron with recipe inside | ||
# at @s (center of block) | ||
# run from recipes/magicol/bottled/select_bottle | ||
|
||
# calculate amount of vexes to spawn | ||
execute if score @s gm4_zc_fullness > $expected_item_amount gm4_zc_fullness run function gm4_zauber_cauldrons:cauldron/structure/use_extra_items | ||
|
||
# make items in cauldron pickup-able instantly | ||
execute align xyz as @e[type=item,dx=0,dy=0,dz=0] run data modify entity @s PickupDelay set value 0s | ||
|
||
# sounds and visuals | ||
playsound minecraft:block.brewing_stand.brew block @a[distance=..16] ~ ~ ~ 0.6 0.66 | ||
|
||
# consume liquid | ||
scoreboard players remove @s gm4_zc_liquid_level 1 | ||
execute align xyz run function gm4_zauber_cauldrons:cauldron/liquid/update/from_score |
5 changes: 4 additions & 1 deletion
5
...ber_cauldrons/data/gm4_zauber_cauldrons/functions/recipes/magicol/use_cauldron.mcfunction
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,13 @@ | ||
# @s = boiling zauber cauldron with recipe inside | ||
# at @s (center of block) | ||
# run from recipes/armor/zauber_armor | ||
# run from recipes/magicol/select_color | ||
|
||
# calculate amount of vexes to spawn | ||
execute if score @s gm4_zc_fullness > $expected_item_amount gm4_zc_fullness run function gm4_zauber_cauldrons:cauldron/structure/use_extra_items | ||
|
||
# update cauldron liquid | ||
execute align xyz run function gm4_zauber_cauldrons:cauldron/liquid/update/from_score | ||
|
||
# sounds and visuals | ||
particle entity_effect ~ ~.4 ~ .1 .1 .1 1 10 | ||
playsound entity.player.levelup block @a[distance=..16] ~ ~ ~ 1 1.5 |
14 changes: 14 additions & 0 deletions
14
...ns/data/gm4_zauber_cauldrons/templates/functions/magicol/craft_bottled_magicol.mcfunction
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
# @s = heated {{color}} magicol zauber cauldron with bottled {{color}} magicol recipe inside | ||
# at @s (center of block) | ||
# run from recipes/magicol/bottled/{{bottle}}/{{color}}/select_weather_modifier | ||
|
||
# templates/functions/magicol/craft_bottled_magicol.mcfunction | ||
|
||
# remove ingredients | ||
execute align xyz run kill @e[type=item,dx=0,dy=0,dz=0] | ||
|
||
# summon item | ||
loot spawn ~ ~.2 ~ loot gm4_zauber_cauldrons:items/bottled_magicol/{{bottle}}/{{color}}/{{weather_modifier}} | ||
|
||
# set flag | ||
scoreboard players set $recipe_success gm4_zc_data 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
11 changes: 11 additions & 0 deletions
11
...r_cauldrons/data/gm4_zauber_cauldrons/templates/functions/magicol/select_color.mcfunction
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
# @s = heated magicol zauber cauldron with bottled magicol recipe inside | ||
# at @s (center of block) | ||
# run from recipes/magicol/bottled/select_bottle | ||
|
||
# templates/functions/magicol/select_color.mcfunction | ||
|
||
# check which color of bottled magicol to craft | ||
# called functions are generated via beet from templates | ||
# generated with the help of bolt | ||
for color_data in ctx.meta['magicol_colors']: | ||
execute unless score $recipe_success gm4_zc_data matches 1.. if data storage gm4_zauber_cauldrons:temp/cauldron/ingredients liquid.magicol{color:color_data['color']} run function f"gm4_zauber_cauldrons:recipes/magicol/bottled/{{bottle}}/{color_data['color']}/select_weather_modifier" |
11 changes: 11 additions & 0 deletions
11
.../data/gm4_zauber_cauldrons/templates/functions/magicol/select_weather_modifier.mcfunction
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
# @s = heated magicol zauber cauldron with bottled magicol recipe inside | ||
# at @s (center of block) | ||
# run from recipes/magicol/bottled/select_bottle | ||
|
||
# templates/functions/magicol/select_weather_modifier.mcfunction | ||
|
||
# check which weather modifier to use | ||
# called functions are generated via beet from templates | ||
# generated with the help of bolt | ||
for modifier_data in ctx.meta['weather_modifiers']: | ||
execute unless score $recipe_success gm4_zc_data matches 1.. if data storage gm4_zauber_cauldrons:temp/cauldron/ingredients items[{Count:1b,tag:{gm4_zauber_cauldrons:{item:modifier_data['item_id']}}}] run function f"gm4_zauber_cauldrons:recipes/magicol/bottled/{{bottle}}/{{color}}/{modifier_data['modifier']}" |
167 changes: 167 additions & 0 deletions
167
gm4_zauber_cauldrons/data/gm4_zauber_cauldrons/templates/loot_tables/bottled_magicol.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,167 @@ | ||
{ | ||
"pools": [ | ||
{ | ||
"rolls": 1, | ||
"entries": [ | ||
{ | ||
"type": "minecraft:item", | ||
"name": "{{bottle_item_id}}", | ||
"functions": [ | ||
{ | ||
"function": "minecraft:set_nbt", | ||
"tag": "{gm4_zauber_cauldrons:{item:\"bottled_magicol\",color:\"{{color}}\",weather_modifier:\"{{weather_modifier}}\",bottle:{multi_use:0}},HideFlags:32,CustomPotionColor:{{particle_color}},CustomModelData:{{bottle_custom_model_data}}}" | ||
}, | ||
{ | ||
"function": "minecraft:set_name", | ||
"name": { | ||
"translate": "item.gm4.zauber_cauldrons.bottled_magicol.{{translate_name}}", | ||
"fallback": "{{translate_fallback}}", | ||
"italic": false | ||
} | ||
}, | ||
{ | ||
"function": "minecraft:set_name", | ||
"entity": "this", | ||
"name": { | ||
"translate": "item.gm4.zauber_cauldrons.multi_use_bottle.bottled_magicol.{{translate_name}}", | ||
"fallback": "{{soulution_translate_fallback}}", | ||
"italic": false | ||
}, | ||
"conditions": [ | ||
{ | ||
"condition": "minecraft:value_check", | ||
"value": { | ||
"type": "minecraft:score", | ||
"target": { | ||
"type": "minecraft:fixed", | ||
"name": "$has_soul_fire_heatsource" | ||
}, | ||
"score": "gm4_zc_data" | ||
}, | ||
"range": 1 | ||
} | ||
] | ||
}, | ||
{ | ||
"function": "minecraft:copy_nbt", | ||
"source": { | ||
"type": "minecraft:storage", | ||
"source": "gm4_zauber_cauldrons:blueprint/item/multi_sip" | ||
}, | ||
"ops": [ | ||
{ | ||
"source": "gm4_zauber_cauldrons.bottle", | ||
"target": "gm4_zauber_cauldrons.bottle", | ||
"op": "replace" | ||
} | ||
], | ||
"conditions": [ | ||
{ | ||
"condition": "minecraft:value_check", | ||
"value": { | ||
"type": "minecraft:score", | ||
"target": { | ||
"type": "minecraft:fixed", | ||
"name": "$has_soul_fire_heatsource" | ||
}, | ||
"score": "gm4_zc_data" | ||
}, | ||
"range": 1 | ||
} | ||
] | ||
}, | ||
{ | ||
"function": "minecraft:set_nbt", | ||
"tag": "{CustomModelData:{{soulution_bottle_custom_model_data}}}", | ||
"conditions": [ | ||
{ | ||
"condition": "minecraft:value_check", | ||
"value": { | ||
"type": "minecraft:score", | ||
"target": { | ||
"type": "minecraft:fixed", | ||
"name": "$has_soul_fire_heatsource" | ||
}, | ||
"score": "gm4_zc_data" | ||
}, | ||
"range": 1 | ||
} | ||
] | ||
}, | ||
{ | ||
"function": "minecraft:set_lore", | ||
"entity": "this", | ||
"lore": [ | ||
[ | ||
{ | ||
"nbt": "gm4_zauber_cauldrons.bottle.sips", | ||
"storage": "gm4_zauber_cauldrons:blueprint/item/multi_sip", | ||
"color": "gray", | ||
"italic": false | ||
}, | ||
{ | ||
"text": "/", | ||
"color": "gray", | ||
"italic": false | ||
}, | ||
{ | ||
"nbt": "gm4_zauber_cauldrons.bottle.size", | ||
"storage": "gm4_zauber_cauldrons:blueprint/item/multi_sip", | ||
"color": "gray", | ||
"italic": false | ||
}, | ||
{ | ||
"text": " ", | ||
"color": "gray", | ||
"italic": false | ||
}, | ||
{ | ||
"translate": "item.gm4.zauber_cauldrons.multi_use_bottle.lore.{{sips_translate_name}}", | ||
"fallback": "{{sips_translate_fallback}}", | ||
"color": "gray", | ||
"italic": false | ||
} | ||
] | ||
], | ||
"replace": false, | ||
"conditions": [ | ||
{ | ||
"condition": "minecraft:value_check", | ||
"value": { | ||
"type": "minecraft:score", | ||
"target": { | ||
"type": "minecraft:fixed", | ||
"name": "$has_soul_fire_heatsource" | ||
}, | ||
"score": "gm4_zc_data" | ||
}, | ||
"range": 1 | ||
} | ||
] | ||
}, | ||
{ | ||
"function": "minecraft:set_lore", | ||
"lore": [ | ||
{ | ||
"text": "" | ||
}, | ||
{ | ||
"translate": "potion.whenDrank", | ||
"color": "dark_purple", | ||
"italic": false | ||
}, | ||
{ | ||
"translate": "item.gm4.zauber_cauldrons.bottled_magicol.tint.{{color}}", | ||
"fallback": "{{color_translate_fallback}}", | ||
"color": "blue", | ||
"italic": false | ||
} | ||
], | ||
"replace": false | ||
} | ||
] | ||
} | ||
] | ||
} | ||
] | ||
} |
Oops, something went wrong.