Skip to content

Commit

Permalink
feat: Crafting recipes for toad hats
Browse files Browse the repository at this point in the history
  • Loading branch information
OrangeUtan committed Jul 3, 2021
1 parent 5e899ae commit 985b33c
Show file tree
Hide file tree
Showing 13 changed files with 108 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
{%- import 'advancements.json' as adv -%}
{{ adv.on_crafts_recipe("oran9eutan:hats/toad_blue", "oran9eutan:hats/event/recipe/toad_blue") }}
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
{%- import 'advancements.json' as adv -%}
{{ adv.on_crafts_recipe("oran9eutan:hats/toad_green", "oran9eutan:hats/event/recipe/toad_green") }}
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
{%- import 'advancements.json' as adv -%}
{{ adv.on_crafts_recipe("oran9eutan:hats/toad_red", "oran9eutan:hats/event/recipe/toad_red") }}
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
{%- import 'advancements.json' as adv -%}
{{ adv.on_crafts_recipe("oran9eutan:hats/toad_yellow", "oran9eutan:hats/event/recipe/toad_yellow") }}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
loot give @s loot oran9eutan:hats/hat/toad_blue
clear @s knowledge_book 1

# Reset
advancement revoke @s only oran9eutan:hats/event/recipe/toad_blue
recipe take @s oran9eutan:hats/toad_blue
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
loot give @s loot oran9eutan:hats/hat/toad_green
clear @s knowledge_book 1

# Reset
advancement revoke @s only oran9eutan:hats/event/recipe/toad_green
recipe take @s oran9eutan:hats/toad_green
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
loot give @s loot oran9eutan:hats/hat/toad_red
clear @s knowledge_book 1

# Reset
advancement revoke @s only oran9eutan:hats/event/recipe/toad_red
recipe take @s oran9eutan:hats/toad_red
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
loot give @s loot oran9eutan:hats/hat/toad_yellow
clear @s knowledge_book 1

# Reset
advancement revoke @s only oran9eutan:hats/event/recipe/toad_yellow
recipe take @s oran9eutan:hats/toad_yellow
15 changes: 15 additions & 0 deletions datapack/data/oran9eutan/recipes/hats/toad_blue.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"type": "minecraft:crafting_shapeless",
"ingredients": [
{
"item": "minecraft:mushroom_stem"
},
{
"item": "minecraft:blue_dye"
}
],
"result": {
"item": "minecraft:knowledge_book",
"count": 1
}
}
15 changes: 15 additions & 0 deletions datapack/data/oran9eutan/recipes/hats/toad_green.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"type": "minecraft:crafting_shapeless",
"ingredients": [
{
"item": "minecraft:mushroom_stem"
},
{
"item": "minecraft:lime_dye"
}
],
"result": {
"item": "minecraft:knowledge_book",
"count": 1
}
}
15 changes: 15 additions & 0 deletions datapack/data/oran9eutan/recipes/hats/toad_red.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"type": "minecraft:crafting_shapeless",
"ingredients": [
{
"item": "minecraft:mushroom_stem"
},
{
"item": "minecraft:red_dye"
}
],
"result": {
"item": "minecraft:knowledge_book",
"count": 1
}
}
15 changes: 15 additions & 0 deletions datapack/data/oran9eutan/recipes/hats/toad_yellow.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"type": "minecraft:crafting_shapeless",
"ingredients": [
{
"item": "minecraft:mushroom_stem"
},
{
"item": "minecraft:yellow_dye"
}
],
"result": {
"item": "minecraft:knowledge_book",
"count": 1
}
}
16 changes: 16 additions & 0 deletions hats/macros/advancements.json
Original file line number Diff line number Diff line change
Expand Up @@ -75,3 +75,19 @@
{{ require_any_hat(hats) }}
}
{%- endmacro %}

{%- macro on_crafts_recipe(recipe, callback) -%}
{
"criteria": {
"recipe": {
"trigger": "minecraft:recipe_unlocked",
"conditions": {
"recipe": "{{ recipe }}"
}
}
},
"rewards": {
"function": "{{ callback }}"
}
}
{%- endmacro %}

0 comments on commit 985b33c

Please sign in to comment.