Skip to content

Commit

Permalink
Merge Acacia Gum update (v1c-mc1.17-1.18.2)
Browse files Browse the repository at this point in the history
Acacia Gum update (v1c-mc1.17-1.18.2)
  • Loading branch information
daenvil authored Aug 25, 2022
2 parents 4f5ff42 + 7987cdf commit 376cc12
Show file tree
Hide file tree
Showing 55 changed files with 401 additions and 48 deletions.
7 changes: 4 additions & 3 deletions datapack/README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
# Daenvil's Vegancraft v1b (Full Datapack)
# Daenvil's Vegancraft v1c (Full Datapack) for Minecraft 1.17 - 1.18.2

This datapack is a merged version of the following datapacks:

- [Plant-based Foods v1](https://github.com/daenvil/vegancraft/wiki/Plant%E2%80%90based-Foods)
- [Plant-based Foods v1.0.1](https://github.com/daenvil/vegancraft/wiki/Plant%E2%80%90based-Foods)
- [Omnivorous Pets v1](https://github.com/daenvil/vegancraft/wiki/Omnivorous-Pets)
- [Acacia Gum v1](https://github.com/daenvil/vegancraft/wiki/Acacia-Gum)

Read more on [the wiki](https://github.com/daenvil/vegancraft/wiki).
Read more on [the wiki](https://github.com/daenvil/vegancraft/wiki).
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"rewards": {
"function": "dnv.acacia_gum:used_axe_on_acacia_bark"
},
"criteria": {
"used_axe_on_acacia_bark": {
"trigger": "minecraft:item_used_on_block",
"conditions": {
"location": {
"block": {
"tag": "dnv.core:acacia_bark"
}
},
"item": {
"tag": "dnv.core:axes"
}
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
"rewards": {
"function": "dnv.acacia_gum:used_axe_on_acacia_bark_fortune_1"
},
"criteria": {
"used_axe_on_acacia_bark": {
"trigger": "minecraft:item_used_on_block",
"conditions": {
"location": {
"block": {
"tag": "dnv.core:acacia_bark"
}
},
"item": {
"tag": "dnv.core:axes",
"enchantments": [{
"enchantment": "minecraft:fortune",
"levels": 1
}]
}
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
"rewards": {
"function": "dnv.acacia_gum:used_axe_on_acacia_bark_fortune_2"
},
"criteria": {
"used_axe_on_acacia_bark": {
"trigger": "minecraft:item_used_on_block",
"conditions": {
"location": {
"block": {
"tag": "dnv.core:acacia_bark"
}
},
"item": {
"tag": "dnv.core:axes",
"enchantments": [{
"enchantment": "minecraft:fortune",
"levels": 2
}]
}
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
"rewards": {
"function": "dnv.acacia_gum:used_axe_on_acacia_bark_fortune_3"
},
"criteria": {
"used_axe_on_acacia_bark": {
"trigger": "minecraft:item_used_on_block",
"conditions": {
"location": {
"block": {
"tag": "dnv.core:acacia_bark"
}
},
"item": {
"tag": "dnv.core:axes",
"enchantments": [{
"enchantment": "minecraft:fortune",
"levels": 3
}]
}
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Called by function dnv.acacia_gum:used_axe_on_acacia_bark
# @s = player who stripped acacia log/wood

scoreboard players set @s dnv.found_acacia 0
execute anchored eyes positioned ^ ^ ^ anchored feet run function dnv.acacia_gum:find_stripped_acacia_line
#execute if score @s dnv.found_acacia matches ..-61 run tellraw @s "[dnv.acacia_gum:debug_mode] Stripped acacia could not be found, trying a wider search..."
execute if score @s dnv.found_acacia matches ..-61 anchored eyes positioned ^ ^ ^1 anchored feet run function dnv.acacia_gum:find_stripped_acacia_wide
#execute if score @s dnv.found_acacia matches ..-121 run tellraw @s "[dnv.acacia_gum:debug_mode] Stripped acacia was not found."
execute if score @s dnv.found_acacia matches ..-121 run function dnv.acacia_gum:summon_acacia_gum
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Called by function dnv.acacia_gum:find_stripped_acacia or by itself
# @s = player who stripped acacia log or wood
# Finds the block that was just stripped
# Apparently the block doesn't convert into its stripped variant *after* this tick

execute if block ~ ~ ~ minecraft:acacia_log run function dnv.acacia_gum:summon_acacia_gum
execute if score @s dnv.found_acacia matches -60..0 if block ~ ~ ~ minecraft:acacia_wood run function dnv.acacia_gum:summon_acacia_gum
# If not found, repeat function in the next forward step towards where the player is facing:
execute if score @s dnv.found_acacia matches -60..0 run scoreboard players remove @s dnv.found_acacia 1
execute if score @s dnv.found_acacia matches -60..0 positioned ^ ^ ^.1 run function dnv.acacia_gum:find_stripped_acacia_line

# Objective dnv.found_acacia functions as both a tracker of how many steps were done (in negative numbers) and as confirmation of success (1)
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Called by function dnv.acacia_gum:find_stripped_acacia or by itself
# @s = player who stripped acacia log or wood
# Finds the block that was just stripped. This one searches in the blocks around the first search.
# Apparently the block doesn't convert into its stripped variant *after* this tick

execute if block ^1 ^ ^ minecraft:acacia_log positioned ^1 ^ ^ run function dnv.acacia_gum:summon_acacia_gum
execute if score @s dnv.found_acacia matches -120..-61 positioned ^1 ^ ^ if block ~ ~ ~ minecraft:acacia_wood run function dnv.acacia_gum:summon_acacia_gum
execute if score @s dnv.found_acacia matches -120..-61 positioned ^-1 ^ ^ if block ~ ~ ~ minecraft:acacia_log run function dnv.acacia_gum:summon_acacia_gum
execute if score @s dnv.found_acacia matches -120..-61 positioned ^-1 ^ ^ if block ~ ~ ~ minecraft:acacia_wood run function dnv.acacia_gum:summon_acacia_gum
execute if score @s dnv.found_acacia matches -120..-61 positioned ^ ^1 ^ if block ~ ~ ~ minecraft:acacia_log run function dnv.acacia_gum:summon_acacia_gum
execute if score @s dnv.found_acacia matches -120..-61 positioned ^ ^1 ^ if block ~ ~ ~ minecraft:acacia_wood run function dnv.acacia_gum:summon_acacia_gum
execute if score @s dnv.found_acacia matches -120..-61 positioned ^1 ^-1 ^ if block ~ ~ ~ minecraft:acacia_log run function dnv.acacia_gum:summon_acacia_gum
execute if score @s dnv.found_acacia matches -120..-61 positioned ^1 ^-1 ^ if block ~ ~ ~ minecraft:acacia_wood run function dnv.acacia_gum:summon_acacia_gum
execute if score @s dnv.found_acacia matches -120..-61 positioned ^1 ^1 ^ if block ~ ~ ~ minecraft:acacia_log run function dnv.acacia_gum:summon_acacia_gum
execute if score @s dnv.found_acacia matches -120..-61 positioned ^1 ^1 ^ if block ~ ~ ~ minecraft:acacia_wood run function dnv.acacia_gum:summon_acacia_gum
execute if score @s dnv.found_acacia matches -120..-61 positioned ^1 ^-1 ^ if block ~ ~ ~ minecraft:acacia_log run function dnv.acacia_gum:summon_acacia_gum
execute if score @s dnv.found_acacia matches -120..-61 positioned ^1 ^-1 ^ if block ~ ~ ~ minecraft:acacia_wood run function dnv.acacia_gum:summon_acacia_gum
execute if score @s dnv.found_acacia matches -120..-61 positioned ^-1 ^1 ^ if block ~ ~ ~ minecraft:acacia_log run function dnv.acacia_gum:summon_acacia_gum
execute if score @s dnv.found_acacia matches -120..-61 positioned ^-1 ^1 ^ if block ~ ~ ~ minecraft:acacia_wood run function dnv.acacia_gum:summon_acacia_gum
execute if score @s dnv.found_acacia matches -120..-61 positioned ^-1 ^-1 ^ if block ~ ~ ~ minecraft:acacia_log run function dnv.acacia_gum:summon_acacia_gum
execute if score @s dnv.found_acacia matches -120..-61 positioned ^-1 ^-1 ^ if block ~ ~ ~ minecraft:acacia_wood run function dnv.acacia_gum:summon_acacia_gum

# If not found, repeat function in the next forward step towards where the player is facing:
execute if score @s dnv.found_acacia matches -120..-61 run scoreboard players remove @s dnv.found_acacia 1
execute if score @s dnv.found_acacia matches -120..-61 positioned ^ ^ ^.1 run function dnv.acacia_gum:find_stripped_acacia_wide

# Objective dnv.found_acacia functions as both a tracker of how many steps were done (in negative numbers) and as confirmation of success (1)
1 change: 1 addition & 0 deletions datapack/data/dnv.acacia_gum/functions/load.mcfunction
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
scoreboard objectives add dnv.found_acacia dummy
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# Called by function dnv.acacia_gum:find_stripped_acacia(_wide)
# @s = player who stripped acacia log/wood
# position = stripped acacia log/wood (or player position, if not found)

scoreboard players set @s dnv.found_acacia 1
loot spawn ~ ~ ~ loot dnv.acacia_gum:drop

execute if score dnv.dummy dnv.vegancraft matches 1 run scoreboard players add @s dnv.vxp 40
execute if score dnv.dummy dnv.vegancraft matches 1 run function dnv.vegancraft:award_xp
execute if score dnv.dummy dnv.vegancraft matches 1 run advancement grant @s until dnv.vegancraft:acacia_gum/slime_ball
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
advancement revoke @s only dnv.acacia_gum:used_axe_on_acacia_bark

# Decide beforehand if gumball is going to drop, to avoid useless processing:
execute if predicate dnv.acacia_gum:drop_chance_no_fortune run function dnv.acacia_gum:find_stripped_acacia
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
advancement revoke @s only dnv.acacia_gum:used_axe_on_acacia_bark_fortune_1

# Decide beforehand if gumball is going to drop, to avoid useless processing:
execute if predicate dnv.acacia_gum:extra_drop_chance_fortune_1 run function dnv.acacia_gum:find_stripped_acacia
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
advancement revoke @s only dnv.acacia_gum:used_axe_on_acacia_bark_fortune_2

# Decide beforehand if gumball is going to drop, to avoid useless processing:
execute if predicate dnv.acacia_gum:extra_drop_chance_fortune_2 run function dnv.acacia_gum:find_stripped_acacia
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
advancement revoke @s only dnv.acacia_gum:used_axe_on_acacia_bark_fortune_3

# Decide beforehand if gumball is going to drop, to avoid useless processing:
execute if predicate dnv.acacia_gum:extra_drop_chance_fortune_3 run function dnv.acacia_gum:find_stripped_acacia
25 changes: 25 additions & 0 deletions datapack/data/dnv.acacia_gum/loot_tables/drop.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{
"type": "command",
"pools":[
{
"rolls": 1,
"entries":[
{
"type": "item",
"name": "minecraft:slime_ball",
"weight": 1,
"functions": [
{
"function": "set_name",
"name": {"translate":"dnv.acacia_gum.item.acacia_gumball", "italic":false}
},
{
"function": "set_nbt",
"tag": "{dnv.Vegan:1b,CustomModelData:9261005}"
}
]
}
]
}
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"condition": "minecraft:random_chance",
"chance": 0.25
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"condition": "minecraft:random_chance",
"chance": 0.25
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"condition": "minecraft:random_chance",
"chance": 0.5
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"condition": "minecraft:random_chance",
"chance": 0.75
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"function": "dnv.core:triggers/crafting_table_interaction"
},
"criteria": {
"cauldron_interaction": {
"crafting_table_interaction": {
"trigger": "minecraft:item_used_on_block",
"conditions": {
"location": {
Expand Down
6 changes: 6 additions & 0 deletions datapack/data/dnv.core/tags/blocks/acacia_bark.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"values": [
"minecraft:acacia_log",
"minecraft:acacia_wood"
]
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@
{
"id": "dnv.vegancraft:food/utility/crafting_table_interaction",
"required": false
},
{
"id": "dnv.vegancraft:utility/crafting_advancement",
"required": false
}
]
}
10 changes: 10 additions & 0 deletions datapack/data/dnv.core/tags/items/axes.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"values": [
"minecraft:wooden_axe",
"minecraft:stone_axe",
"minecraft:golden_axe",
"minecraft:iron_axe",
"minecraft:diamond_axe",
"minecraft:netherite_axe"
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"parent": "dnv.vegancraft:crafting",
"display": {
"icon": {
"item": "minecraft:slime_ball",
"nbt": "{CustomModelData:9261005}"
},
"title": "This tree is... sticky",
"frame": "task",
"description": [{"text":"Get gum from an acacia tree"}]
},
"criteria": {
"granted_by_function": {
"trigger": "minecraft:impossible"
}
}
}
18 changes: 18 additions & 0 deletions datapack/data/dnv.vegancraft/advancements/crafting.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"parent": "dnv.vegancraft:root",
"display": {
"icon": {
"item": "minecraft:crafting_table"
},
"title": "Ethical Crafting",
"frame": "goal",
"description": "Craft useful items without harming mobs",
"show_toast": false,
"announce_to_chat": false
},
"criteria": {
"granted_by_function": {
"trigger": "minecraft:impossible"
}
}
}
6 changes: 1 addition & 5 deletions datapack/data/dnv.vegancraft/functions/food/load.mcfunction
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,4 @@ scoreboard objectives add dnv.ate_nonvegan dummy
scoreboard objectives add dnv.ate_veganalt dummy
scoreboard objectives add dnv.vdiet_time minecraft.custom:play_time
scoreboard objectives add dnv.vdiet_time_d minecraft.custom:time_since_death
schedule function dnv.vegancraft:food/diet_score_check 20 replace
scoreboard objectives add dnv.vxp dummy
scoreboard objectives add dnv.vxp_int dummy
scoreboard objectives add dnv.100 dummy
scoreboard players set dnv.dummy dnv.100 100
schedule function dnv.vegancraft:food/diet_score_check 20 replace
4 changes: 4 additions & 0 deletions datapack/data/dnv.vegancraft/functions/load.mcfunction
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
scoreboard objectives add dnv.vxp dummy
scoreboard objectives add dnv.vxp_int dummy
scoreboard objectives add dnv.100 dummy
scoreboard players set dnv.dummy dnv.100 100
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Triggers when player interacts with a crafting table (#dnv.core:crafting_table_interaction)
# Just to grant the root advancements

advancement revoke @s only dnv.core:triggers/crafting_table_interaction
execute if score dnv.dummy dnv.vegancraft matches 1 run advancement grant @s until dnv.vegancraft:crafting
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Called on load by function dnv.core:check_version
# Throw a warning if current version is not supported, and clean up afterwards:

execute unless score @a[limit=1] dnv.game_version matches 2578..2975 run tellraw @a {"text":"[Vegancraft] WARNING: This datapack is intended for Minecraft 1.16.2-1.18.2, some features might not be working.","color":"red","hoverEvent":{"action":"show_text","value":"Download the appropiate version for your game version."}}
execute unless score @a[limit=1] dnv.game_version matches 2724..2975 run tellraw @a {"text":"[Vegancraft] WARNING: This datapack is intended for Minecraft 1.17-1.18.2, some features might not be working.","color":"red","hoverEvent":{"action":"show_text","value":"Download the appropiate version for your game version."}}
18 changes: 18 additions & 0 deletions datapack/data/global/advancements/dnv.acacia_gum.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"display": {
"title": "Acacia Gum",
"description": "Daenvil's Acacia Gum datapack (v1, for MC1.17+)",
"icon": {
"item": "minecraft:slime_ball",
"nbt": "{CustomModelData:9261005}"
},
"announce_to_chat": false,
"show_toast": false
},
"parent": "global:dnv.vegancraft",
"criteria": {
"trigger": {
"trigger": "minecraft:tick"
}
}
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"display": {
"title": "Plant-based Foods",
"description": "Daenvil's Plant-based Foods datapack (v1, for MC1.16.2+)",
"description": "Daenvil's Plant-based Foods datapack (v1.0.1, for MC1.16.2+)",
"icon": {
"item": "minecraft:pumpkin_pie"
},
Expand Down
Loading

0 comments on commit 376cc12

Please sign in to comment.