-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
0352475
commit 317bb34
Showing
17 changed files
with
266 additions
and
6 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
{ | ||
"parent": "chaotic_crafting:root", | ||
"criteria": { | ||
"craft_book": { | ||
"trigger": "minecraft:inventory_changed", | ||
"conditions": { | ||
"items": [ | ||
{ | ||
"items": [ | ||
"minecraft:written_book" | ||
], | ||
"predicates": { | ||
"minecraft:written_book_content": { | ||
"title": "Chaos" | ||
} | ||
} | ||
} | ||
] | ||
} | ||
} | ||
}, | ||
"requirements": [ | ||
[ | ||
"craft_book" | ||
] | ||
], | ||
"rewards": { | ||
"function": "chaotic_crafting:craft_book" | ||
} | ||
} |
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,12 @@ | ||
{ | ||
"criteria": { | ||
"impossible": { | ||
"trigger": "minecraft:impossible" | ||
} | ||
}, | ||
"requirements": [ | ||
[ | ||
"impossible" | ||
] | ||
] | ||
} |
4 changes: 4 additions & 0 deletions
4
data/chaotic_crafting/function/book_commands/gen_workshop.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,4 @@ | ||
execute as @p[scores={cc_gen_workshop=1}] at @s run function chaotic_crafting:setup/spawn_workshop_stage1 | ||
|
||
scoreboard players set @s cc_gen_workshop 0 | ||
scoreboard players enable @s cc_gen_workshop |
4 changes: 4 additions & 0 deletions
4
data/chaotic_crafting/function/book_commands/reset.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,4 @@ | ||
execute as @p[scores={cc_reset=1}] at @s run function chaotic_crafting:reset | ||
|
||
scoreboard players set @s cc_reset 0 | ||
scoreboard players enable @s cc_reset |
4 changes: 4 additions & 0 deletions
4
data/chaotic_crafting/function/book_commands/start_game.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,4 @@ | ||
execute as @p[scores={cc_start_game=1}] at @s run function chaotic_crafting:start_game | ||
|
||
scoreboard players set @s cc_start_game 0 | ||
scoreboard players enable @s cc_start_game |
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,2 @@ | ||
tag @s add cc_craft_book | ||
advancement revoke @s only chaotic_crafting:book_crafting |
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
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 @@ | ||
loot give @s loot chaotic_crafting:book |
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,3 +1,6 @@ | ||
function chaotic_crafting:setup/setup_scoreboards | ||
function chaotic_crafting:setup/set_anchor | ||
|
||
scoreboard players enable * cc_gen_workshop | ||
scoreboard players enable * cc_start_game | ||
scoreboard players enable * cc_reset |
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,4 @@ | ||
execute store result score #cc_success cc_temp run clear @s minecraft:written_book[minecraft:written_book_content~{title:"Chaos"}] 1 | ||
execute if score #cc_success cc_temp matches 1.. run function chaotic_crafting:give_book | ||
|
||
tag @s remove cc_craft_book |
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
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
2 changes: 1 addition & 1 deletion
2
data/chaotic_crafting/function/setup/spawn_workshop_stage1.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 +1 @@ | ||
place template chaotic_crafting:stage1_v1 ~-48 ~-39 ~ none none | ||
place template chaotic_crafting:stage1_v2 ~-47 ~-39 ~-1 none none |
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
2 changes: 1 addition & 1 deletion
2
data/chaotic_crafting/function/util/give_config_book.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 +1 @@ | ||
give @p written_book{pages:['["",{"text":"Config\\n\\n"},{"text":"Start Game","bold":true,"color":"dark_green","clickEvent":{"action":"run_command","value":"/scoreboard players set $game_active cc_settings 1"}},{"text":"\\n\\n\\n","color":"reset"},{"text":"Reset","bold":true,"color":"dark_red","clickEvent":{"action":"run_command","value":"/scoreboard players set $game_active cc_settings 0"}}]'],title:"Config Book",author:Kestrel} | ||
give @p written_book[written_book_content={title:"Chaotic Crafting v0.2.0",author:"ItsKestrel",pages:['[{"text":"Chaotic Crafting\\n\\n"},{"text":"NOTE:","color":"red"},{"text":"Please read following pages before using these commands.\\n\\n"},{"text":"Generate Workshop","color":"dark_gray","clickEvent":{"action":"run_command","value":"/trigger cc_gen_workshop"}},{"text":"\\n\\n"},{"text":"Start Game","color":"dark_green","clickEvent":{"action":"run_command","value":"/trigger cc_start_game"}},{"text":"\\n\\n"},{"text":"Reset Game","color":"dark_red","clickEvent":{"action":"run_command","value":"/trigger cc_reset"}}]','[{"text":"Description","bold":true},{"text":"\\n\\nChaotic Crafting is a chaotic crafting mini-game. You must fulfil customer orders by harvesting the required resources and crafting the desired items.","bold":false}]','[{"text":"The Days","bold":true},{"text":"\\n\\nEach day, a set number of customers will arrive at the workshop and request an item. As you fulfil orders, the customers will pay you in emeralds. In between days, a merchant will appear to sell you items that may help you.","bold":false}]','[{"text":"Crafting","bold":true},{"text":"\\nCrafting tables are a bit different in Chaotic Crafting. The crafting tables are \\"interactive\\" and only produce 1 item at a time. To use them, place the resources in the grid on top of the table with right-click, and then hit (left-click) the table outside the grid to craft.","bold":false}]','[{"text":"Patience","bold":true},{"text":"\\n\\nWhenever a customer arrives to the workshop, they will begin to lose patience. After taking their order, the will receive a new set of patience. If any customer loses patience, your run will be over.","bold":false}]','[{"text":"The \\"Upgrades\\"","bold":true},{"text":"\\n\\nEvery 3 days, you will have to choose between 2 different upgrades. These can affect anything from customer behavior, to what kinds of items can be crafted.","bold":false}]','[{"text":"Setup","bold":true},{"text":"\\nUsing the commands at the start of this book, generate the starting workshop. This is a 48x48x48 structure, so make sure you have room for it.\\nSelect \\"Start Game\\" to initiate the game, then use the game UI to add each player.","bold":false},{"text":"\\n\\n -->"}]','"The number of players will affect the difficulty somewhat, but it is important that each player interacts with the UI. Then select \\"Start Day\\" to begin your first day!"']}] 1 |
31 changes: 31 additions & 0 deletions
31
data/chaotic_crafting/function/util/kill_all_markers.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,31 @@ | ||
kill @e[tag=cc_barrel_marker] | ||
kill @e[tag=cc_chest_marker] | ||
|
||
kill @e[tag=cc_acacia_log_pile] | ||
kill @e[tag=cc_birch_log_pile] | ||
kill @e[tag=cc_cherry_log_pile] | ||
kill @e[tag=cc_oak_log_pile] | ||
kill @e[tag=cc_mangrove_log_pile] | ||
|
||
kill @e[tag=cc_coal_deposit] | ||
kill @e[tag=cc_stone_pile] | ||
kill @e[tag=iron_node] | ||
kill @e[tag=gold_node] | ||
kill @e[tag=diamond_node] | ||
|
||
kill @e[tag=cc_customer_rally] | ||
kill @e[tag=cc_customer_spawn] | ||
|
||
kill @e[tag=cc_menu_item_1_marker] | ||
kill @e[tag=cc_menu_item_2_marker] | ||
kill @e[tag=cc_menu_item_3_marker] | ||
kill @e[tag=cc_menu_item] | ||
|
||
kill @e[tag=cc_merchant] | ||
kill @e[tag=cc_merchant_spawn] | ||
kill @e[tag=cc_seat_1] | ||
|
||
kill @e[tag=cc_trade_data] | ||
kill @e[tag=cc_upgrade_data] | ||
|
||
kill @e[tag=slot_marker] |
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,139 @@ | ||
{ | ||
"pools": [ | ||
{ | ||
"rolls": 1, | ||
"entries": [ | ||
{ | ||
"type": "minecraft:item", | ||
"name": "minecraft:written_book", | ||
"functions": [ | ||
{ | ||
"function": "minecraft:set_components", | ||
"components": { | ||
"minecraft:written_book_content": { | ||
"title": "Chaotic Crafting V0.2.0", | ||
"author": "ItsKestrel" | ||
}, | ||
"minecraft:custom_data": { | ||
"datapack": "chaotic_crafting" | ||
} | ||
} | ||
}, | ||
{ | ||
"function": "minecraft:set_written_book_pages", | ||
"pages": [ | ||
[ | ||
{ | ||
"text":"Chaotic Crafting\n\n" | ||
}, | ||
{ | ||
"text":"NOTE: ","color":"red" | ||
}, | ||
{ | ||
"text":"Please read following pages before using these commands.\n\n" | ||
}, | ||
{ | ||
"text":"[Generate Workshop]", | ||
"color":"dark_gray", | ||
"clickEvent": { | ||
"action":"run_command", | ||
"value":"/trigger cc_gen_workshop set 1" | ||
}, | ||
"hoverEvent": { | ||
"action": "show_text", | ||
"contents": [ | ||
{ | ||
"text": "Generates a 48x48x48 structure! Make sure you have room!", | ||
"color": "yellow" | ||
} | ||
] | ||
} | ||
}, | ||
{ | ||
"text":"\n\n" | ||
}, | ||
{ | ||
"text":"[Start Game]", | ||
"color":"dark_green", | ||
"clickEvent": { | ||
"action":"run_command","value":"/trigger cc_start_game set 1" | ||
} | ||
}, | ||
{ | ||
"text":"\n\n" | ||
}, | ||
{ | ||
"text":"[Reset Game]", | ||
"color":"dark_red", | ||
"clickEvent": { | ||
"action":"run_command","value":"/trigger cc_reset set 1" | ||
}, | ||
"hoverEvent": { | ||
"action": "show_text", | ||
"contents": [ | ||
{ | ||
"text": "Resets the entire game. Your workshop will be overwritten! Use after failing a run.", | ||
"color": "yellow" | ||
} | ||
] | ||
} | ||
} | ||
], | ||
[ | ||
{ | ||
"text":"Description", | ||
"bold":true | ||
}, | ||
{ | ||
"text":"\n\nChaotic Crafting is a chaotic mini-game where you must fulfill customer orders by harvesting the required resources and crafting the desired items.", | ||
"bold":false | ||
} | ||
], | ||
[ | ||
{ | ||
"text":"Crafting", | ||
"bold":true | ||
}, | ||
{ | ||
"text":"\n\nThe crafting tables in this game are \"interactive\" and only produce 1 item at a time. To use them, place items in the grid on top of the table with right-click, then hit (left-click) the table outside the grid to craft.", | ||
"bold":false | ||
} | ||
], | ||
[ | ||
{ | ||
"text":"The \"Upgrades\"", | ||
"bold":true | ||
}, | ||
{ | ||
"text":"\n\nEvery 3 days, you will have a choice between 2 upgrades. These can affect anything from customer behavior, to what kinds of items can be crafted. They usually make the game more difficult, but come with some positive effects as well.", | ||
"bold":false | ||
} | ||
], | ||
[ | ||
{ | ||
"text":"Setup", | ||
"bold":true | ||
}, | ||
{ | ||
"text":"\n\nUsing the commands at the start of this book, generate the starting workshop. This is a 48x48x48 structure, so make sure you have room for it.\nSelect \"Start Game\" to initiate the game, then use the game UI to add each player.", | ||
"bold":false | ||
}, | ||
{ | ||
"text":"\n (cont. ->)", | ||
"bold":false | ||
} | ||
], | ||
[ | ||
{ | ||
"text": "The number of players will affect the difficulty somewhat, but it is important that each player interacts with the UI. Then select \"Start Day\" to begin your first day!" | ||
} | ||
] | ||
], | ||
"mode": "replace_all" | ||
} | ||
] | ||
} | ||
] | ||
} | ||
] | ||
} |