1
0
Fork 0

Inital commit

This commit is contained in:
abtmtr 2025-08-27 20:49:18 -05:00
commit b5089257c5
1005 changed files with 23476 additions and 0 deletions

View file

@ -0,0 +1,5 @@
# check if item is a stem
summon minecraft:armor_stand ~ ~ ~ {Silent:1b,Invulnerable:1b,Marker:1b,Invisible:1b,Tags:["timber_item_check"]}
data modify entity @e[type=minecraft:armor_stand,tag=timber_item_check,distance=...1,sort=arbitrary,limit=1] equipment.mainhand set from entity @e[distance=...1,type=minecraft:item,sort=nearest,limit=1,nbt={Age:0s}] Item
execute if entity @e[type=minecraft:armor_stand,tag=timber_item_check,distance=...1,sort=arbitrary,limit=1,predicate=timber:item/stem] run function timber:algorithm/fungus/chop
kill @e[type=minecraft:armor_stand,tag=timber_item_check,distance=...1,sort=arbitrary,limit=1]

View file

@ -0,0 +1,5 @@
# check if item is in tag #minecraft:logs
summon minecraft:armor_stand ~ ~ ~ {Silent:1b,Invulnerable:1b,Marker:1b,Invisible:1b,Tags:["timber_item_check"]}
data modify entity @e[type=minecraft:armor_stand,tag=timber_item_check,distance=...1,sort=arbitrary,limit=1] equipment.mainhand set from entity @e[type=minecraft:item,distance=...1,sort=nearest,limit=1,nbt={Age:0s}] Item
execute if entity @e[type=minecraft:armor_stand,tag=timber_item_check,distance=...1,sort=arbitrary,limit=1,predicate=timber:item/log] run function timber:algorithm/tree/chop
kill @e[type=minecraft:armor_stand,tag=timber_item_check,distance=...1,sort=arbitrary,limit=1]

View file

@ -0,0 +1,25 @@
tellraw @s ["",{"text":"§m ","color":"dark_gray"}]
tellraw @s ["",{"text":" Timber Datapack"}]
tellraw @s ["",{"text":"§m ","color":"dark_gray"}]
tellraw @s ["",{"text":"The Timber Datapack allows you to instantly chop down a tree just by breaking one log with any axe."}]
tellraw @s ["",{"text":"By default, sneaking while breaking will not chop the tree."}]
tellraw @s [""]
tellraw @s ["",{"text":"Every player can use "},{"text":"/trigger TimberToggle","color":"blue","click_event":{"action":"suggest_command","command":"/trigger TimberToggle"}},{"text":" to individually turn the datapack on or off."}]
tellraw @s [""]
tellraw @s ["",{"text":"For in-depth description and manual "},{"text":"click here","color":"dark_green","click_event":{"action":"open_url","url":"https://www.planetminecraft.com/data-pack/timber-datapack/"}},{"text":"."}]
tellraw @s [""]
tellraw @s [""," ",{"text":"[click here to see the settings]","color":"gold","click_event":{"action":"run_command","command":"function timber:settings/settings1_click"}}]
tellraw @s ["",{"text":"§m ","color":"dark_gray"}]
function timber:settings/end_of_message

View file

@ -0,0 +1,54 @@
tellraw @s ["",{"text":" "}]
tellraw @s ["",{"text":" "}]
tellraw @s ["",{"text":" "}]
tellraw @s ["",{"text":" "}]
tellraw @s ["",{"text":"§m ","color":"dark_gray"}]
tellraw @s ["",{"text":" Timber "},{"text":"/","color":"gray"},{"text":" Global Settings "},{"text":" < ","click_event":{"action":"run_command","command":"function timber:settings/settings1_click"}},{"text":"1/2"},{"text":" > ","click_event":{"action":"run_command","command":"function timber:settings/settings2_click"}}]
tellraw @s ["",{"text":"§m ","color":"dark_gray"}]
execute if score standing timber matches 1.. run tellraw @s ["",{"text":"[ ✔ ]","color":"green","click_event":{"action":"run_command","command":"function timber:settings/toggle/standing"}},{"text":" Works When Standing"}]
execute unless score standing timber matches 1.. run tellraw @s ["",{"text":"[ ❌ ]","color":"red","click_event":{"action":"run_command","command":"function timber:settings/toggle/standing"}},{"text":" Works When Standing"}]
execute if score sneaking timber matches 1.. run tellraw @s ["",{"text":"[ ✔ ]","color":"green","click_event":{"action":"run_command","command":"function timber:settings/toggle/sneaking"}},{"text":" Works When Sneaking"}]
execute unless score sneaking timber matches 1.. run tellraw @s ["",{"text":"[ ❌ ]","color":"red","click_event":{"action":"run_command","command":"function timber:settings/toggle/sneaking"}},{"text":" Works When Sneaking"}]
execute if score destroy_leaves timber matches 1.. run tellraw @s ["",{"text":"[ ✔ ]","color":"green","click_event":{"action":"run_command","command":"function timber:settings/toggle/destroy_leaves"}},{"text":" Destroy Leaves"}]
execute unless score destroy_leaves timber matches 1.. run tellraw @s ["",{"text":"[ ❌ ]","color":"red","click_event":{"action":"run_command","command":"function timber:settings/toggle/destroy_leaves"}},{"text":" Destroy Leaves"}]
execute if score plant_sapling timber matches 1.. run tellraw @s ["",{"text":"[ ✔ ]","color":"green","click_event":{"action":"run_command","command":"function timber:settings/toggle/plant_sapling"}},{"text":" Auto Plant Saplings","hover_event":{"action":"show_text","value":"All kind of saplings laying on the ground will get planted every 2 seconds."}}]
execute unless score plant_sapling timber matches 1.. run tellraw @s ["",{"text":"[ ❌ ]","color":"red","click_event":{"action":"run_command","command":"function timber:settings/toggle/plant_sapling"}},{"text":" Auto Plant Saplings","hover_event":{"action":"show_text","value":"All kind of saplings laying on the ground will get planted every 2 seconds."}}]
execute if score slow_chop timber matches 1.. run tellraw @s ["",{"text":"[ ✔ ]","color":"green","click_event":{"action":"run_command","command":"function timber:settings/toggle/slow_chop"}},{"text":" Chop Slowly","hover_event":{"action":"show_text","value":["",{"text":"The tree won't be chopped instantly anymore. Additional options to change the speed of the chopping process can be changed at the next page."},{"text":"\n\nThis option can increase performance.","color":"gray"}]}}]
execute unless score slow_chop timber matches 1.. unless score drop_loot timber matches 1.. run tellraw @s ["",{"text":"[ ❌ ]","color":"red","click_event":{"action":"run_command","command":"function timber:settings/toggle/slow_chop"}},{"text":" Chop Slowly","hover_event":{"action":"show_text","value":["",{"text":"The tree won't be chopped instantly anymore. Additional options to change the speed of the chopping process can be changed at the next page."},{"text":"\n\nThis option can increase performance.","color":"gray"}]}}]
execute unless score slow_chop timber matches 1.. if score drop_loot timber matches 1.. run tellraw @s ["",{"text":"[ ❌ ]","color":"#7F2B2B","hover_event":{"action":"show_text","value":"Can't be enabled when \"Drop Loot Straight into Inventory\" is enabled."}},{"text":" Chop Slowly","hover_event":{"action":"show_text","value":["",{"text":"The tree won't be chopped instantly anymore. Additional options to change the speed of the chopping process can be changed at the next page."},{"text":"\n\nThis option can increase performance.","color":"gray"}]}}]
execute if score chop_down timber matches 1.. run tellraw @s ["",{"text":"[ ✔ ]","color":"green","click_event":{"action":"run_command","command":"function timber:settings/toggle/chop_down"}},{"text":" Enable Chopping Down","hover_event":{"action":"show_text","value":"Normally when you cut a tree in the middle only the top part of the tree gets destroyed. But if this option is enabled the bottom part will get destroyed as well."}}]
execute unless score chop_down timber matches 1.. run tellraw @s ["",{"text":"[ ❌ ]","color":"red","click_event":{"action":"run_command","command":"function timber:settings/toggle/chop_down"}},{"text":" Enable Chopping Down","hover_event":{"action":"show_text","value":"Normally when you cut a tree in the middle only the top part of the tree gets destroyed. But if this option is enabled the bottom part will get destroyed as well."}}]
execute if score stop_chopping timber matches 1.. run tellraw @s ["",{"text":"[ ✔ ]","color":"green","click_event":{"action":"run_command","command":"function timber:settings/toggle/stop_chopping"}},{"text":" Stop Chopping Once Axe Breaks","hover_event":{"action":"show_text","value":"Stops the process of chopping the tree as soon as your axe doesn't have any durability left for the whole tree. When disabled, the tree will always be chopped finish."}}]
execute unless score stop_chopping timber matches 1.. if score wear_out timber matches 1.. run tellraw @s ["",{"text":"[ ❌ ]","color":"red","click_event":{"action":"run_command","command":"function timber:settings/toggle/stop_chopping"}},{"text":" Stop Chopping Once Axe Breaks","hover_event":{"action":"show_text","value":"Stops the process of chopping the tree as soon as your axe doesn't have any durability left for the whole tree. When disabled, the tree will always be chopped finish."}}]
execute unless score stop_chopping timber matches 1.. unless score wear_out timber matches 1.. run tellraw @s ["",{"text":"[ ❌ ]","color":"#7F2B2B","hover_event":{"action":"show_text","value":"Can't be enabled when \"Additionally Wear out Tool Depending on Tree Size\" is disabled."}},{"text":" Stop Chopping Once Axe Breaks","hover_event":{"action":"show_text","value":"Stops the process of chopping the tree as soon as your axe doesn't have any durability left for the whole tree. When disabled, the tree will always be chopped finish."}}]
execute if score wear_out timber matches 1.. unless score stop_chopping timber matches 1.. run tellraw @s ["",{"text":"[ ✔ ]","color":"green","click_event":{"action":"run_command","command":"function timber:settings/toggle/wear_out"}},{"text":" Additionally Wear out Tool Depending on Tree Size","hover_event":{"action":"show_text","value":"The tool's durability will get decreased by the amount of destroyed logs (or stems). When disabled, only one durability gets deducted."}}]
execute unless score wear_out timber matches 1.. run tellraw @s ["",{"text":"[ ❌ ]","color":"red","click_event":{"action":"run_command","command":"function timber:settings/toggle/wear_out"}},{"text":" Additionally Wear out Tool Depending on Tree Size","hover_event":{"action":"show_text","value":"The tool's durability will get decreased by the amount of destroyed logs (or stems). When disabled, only one durability gets deducted."}}]
execute if score wear_out timber matches 1.. if score stop_chopping timber matches 1.. run tellraw @s ["",{"text":"[ ✔ ]","color":"#2B7F2B","hover_event":{"action":"show_text","value":"Can't be disabled when \"Stop Chopping Once Axe Breaks\" is enabled."}},{"text":" Additionally Wear out Tool Depending on Tree Size","hover_event":{"action":"show_text","value":"The tool's durability will get decreased by the amount of destroyed logs (or stems). When disabled, only one durability gets deducted."}}]
execute if score drop_loot timber matches 1.. run tellraw @s ["",{"text":"[ ✔ ]","color":"green","click_event":{"action":"run_command","command":"function timber:settings/toggle/drop_loot"}},{"text":" Drop Loot Straight into Inventory","hover_event":{"action":"show_text","value":["",{"text":"Lets the dropped items of the tree teleport straight into your own inventory. As soon as you have a full inventory the loot gets dropped on the ground."},{"text":"\n\nThis option can increase performance.","color":"gray"}]}}]
execute unless score drop_loot timber matches 1.. unless score slow_chop timber matches 1.. run tellraw @s ["",{"text":"[ ❌ ]","color":"red","click_event":{"action":"run_command","command":"function timber:settings/toggle/drop_loot"}},{"text":" Drop Loot Straight into Inventory","hover_event":{"action":"show_text","value":["",{"text":"Lets the dropped items of the tree teleport straight into your own inventory. As soon as you have a full inventory the loot gets dropped on the ground."},{"text":"\n\nThis option can increase performance.","color":"gray"}]}}]
execute unless score drop_loot timber matches 1.. if score slow_chop timber matches 1.. run tellraw @s ["",{"text":"[ ❌ ]","color":"#7F2B2B","hover_event":{"action":"show_text","value":"Can't be enabled when \"Chop Slowly\" is enabled."}},{"text":" Drop Loot Straight into Inventory","hover_event":{"action":"show_text","value":["",{"text":"Lets the dropped items of the tree teleport straight into your own inventory. As soon as you have a full inventory the loot gets dropped on the ground."},{"text":"\n\nThis option can increase performance.","color":"gray"}]}}]
execute if score hunger timber matches 1.. run tellraw @s ["",{"text":"[ ✔ ]","color":"green","click_event":{"action":"run_command","command":"function timber:settings/toggle/hunger"}},{"text":" Give Additional Hunger Effect","hover_event":{"action":"show_text","value":"Gives a hunger effect for 1 second with the same level as the size of the chopped tree."}}]
execute unless score hunger timber matches 1.. run tellraw @s ["",{"text":"[ ❌ ]","color":"red","click_event":{"action":"run_command","command":"function timber:settings/toggle/hunger"}},{"text":" Give Additional Hunger Effect","hover_event":{"action":"show_text","value":"Gives a hunger effect for 1 second with the same level as the size of the chopped tree."}}]
execute if score stopsound timber matches 1.. run tellraw @s ["",{"text":"[ ✔ ]","color":"green","click_event":{"action":"run_command","command":"function timber:settings/toggle/stopsound"}},{"text":" Stop Loud Breaking Noises","hover_event":{"action":"show_text","value":["",{"text":"Suppresses loud breaking noises when chopping a tree."},{"text":"\n\nThis option is","color":"gray"},{"text":" experimental","color":"dark_red"},{"text":" because sometimes it still sounds loud for a fraction of a second.","color":"gray"}]}}]
execute unless score stopsound timber matches 1.. run tellraw @s ["",{"text":"[ ❌ ]","color":"red","click_event":{"action":"run_command","command":"function timber:settings/toggle/stopsound"}},{"text":" Stop Loud Breaking Noises","hover_event":{"action":"show_text","value":["",{"text":"Suppresses loud breaking noises when chopping a tree."},{"text":"\n\nThis option is","color":"gray"},{"text":" experimental","color":"dark_red"},{"text":" because sometimes it still sounds loud for a fraction of a second.","color":"gray"}]}}]
execute if score persistent timber matches 1.. run tellraw @s ["",{"text":"[ ✔ ]","color":"green","click_event":{"action":"run_command","command":"function timber:settings/toggle/persistent"}},{"text":" Destroy Player-Placed Trees","hover_event":{"action":"show_text","value":["",{"text":"Player-placed trees are trees made out of player-placed leaves (Look at leaf block with F3 debug screen: persistent = true)."},{"text":"\n\nUse it on your own risk!\nWhen enabled, this datapack can't differentiate between generated trees and player-placed trees anymore and therefore can potentially destroy your buildings.","color":"dark_red"}]}}]
execute unless score persistent timber matches 1.. run tellraw @s ["",{"text":"[ ❌ ]","color":"red","click_event":{"action":"run_command","command":"function timber:settings/toggle/persistent"}},{"text":" Destroy Player-Placed Trees","hover_event":{"action":"show_text","value":["",{"text":"Player-placed trees are trees made out of player-placed leaves (Look at leaf block with F3 debug screen: persistent = true)."},{"text":"\n\nUse it on your own risk!\nWhen enabled, this datapack can't differentiate between generated trees and player-placed trees anymore and therefore can potentially destroy your buildings.","color":"dark_red"}]}}]
tellraw @s ["",{"text":"§m ","color":"dark_gray"}]
function timber:settings/end_of_message

View file

@ -0,0 +1,52 @@
tellraw @s ["",{"text":" "}]
tellraw @s ["",{"text":" "}]
tellraw @s ["",{"text":" "}]
tellraw @s ["",{"text":" "}]
tellraw @s ["",{"text":"§m ","color":"dark_gray"}]
tellraw @s ["",{"text":" Timber "},{"text":"/","color":"gray"},{"text":" Global Settings "},{"text":" < ","click_event":{"action":"run_command","command":"function timber:settings/settings1_click"}},{"text":"2/2"},{"text":" > ","click_event":{"action":"run_command","command":"function timber:settings/settings2_click"}}]
tellraw @s ["",{"text":"§m ","color":"dark_gray"}]
execute if score wooden_axe timber matches 1.. run tellraw @s ["",{"text":"[ ✔ ]","color":"green","click_event":{"action":"run_command","command":"function timber:settings/toggle/wooden_axe"}},{"text":" Enable Wooden Axe"}]
execute unless score wooden_axe timber matches 1.. run tellraw @s ["",{"text":"[ ❌ ]","color":"red","click_event":{"action":"run_command","command":"function timber:settings/toggle/wooden_axe"}},{"text":" Enable Wooden Axe"}]
execute if score stone_axe timber matches 1.. run tellraw @s ["",{"text":"[ ✔ ]","color":"green","click_event":{"action":"run_command","command":"function timber:settings/toggle/stone_axe"}},{"text":" Enable Stone Axe"}]
execute unless score stone_axe timber matches 1.. run tellraw @s ["",{"text":"[ ❌ ]","color":"red","click_event":{"action":"run_command","command":"function timber:settings/toggle/stone_axe"}},{"text":" Enable Stone Axe"}]
execute if score iron_axe timber matches 1.. run tellraw @s ["",{"text":"[ ✔ ]","color":"green","click_event":{"action":"run_command","command":"function timber:settings/toggle/iron_axe"}},{"text":" Enable Iron Axe"}]
execute unless score iron_axe timber matches 1.. run tellraw @s ["",{"text":"[ ❌ ]","color":"red","click_event":{"action":"run_command","command":"function timber:settings/toggle/iron_axe"}},{"text":" Enable Iron Axe"}]
execute if score golden_axe timber matches 1.. run tellraw @s ["",{"text":"[ ✔ ]","color":"green","click_event":{"action":"run_command","command":"function timber:settings/toggle/golden_axe"}},{"text":" Enable Golden Axe"}]
execute unless score golden_axe timber matches 1.. run tellraw @s ["",{"text":"[ ❌ ]","color":"red","click_event":{"action":"run_command","command":"function timber:settings/toggle/golden_axe"}},{"text":" Enable Golden Axe"}]
execute if score diamond_axe timber matches 1.. run tellraw @s ["",{"text":"[ ✔ ]","color":"green","click_event":{"action":"run_command","command":"function timber:settings/toggle/diamond_axe"}},{"text":" Enable Diamond Axe"}]
execute unless score diamond_axe timber matches 1.. run tellraw @s ["",{"text":"[ ❌ ]","color":"red","click_event":{"action":"run_command","command":"function timber:settings/toggle/diamond_axe"}},{"text":" Enable Diamond Axe"}]
execute if score netherite_axe timber matches 1.. run tellraw @s ["",{"text":"[ ✔ ]","color":"green","click_event":{"action":"run_command","command":"function timber:settings/toggle/netherite_axe"}},{"text":" Enable Netherite Axe"}]
execute unless score netherite_axe timber matches 1.. run tellraw @s ["",{"text":"[ ❌ ]","color":"red","click_event":{"action":"run_command","command":"function timber:settings/toggle/netherite_axe"}},{"text":" Enable Netherite Axe"}]
execute if score chop_trees timber matches 1.. run tellraw @s ["",{"text":"[ ✔ ]","color":"green","click_event":{"action":"run_command","command":"function timber:settings/toggle/chop_trees"}},{"text":" Chop Trees","hover_event":{"action":"show_text","value":"All kind of trees will get chopped."}}]
execute unless score chop_trees timber matches 1.. run tellraw @s ["",{"text":"[ ❌ ]","color":"red","click_event":{"action":"run_command","command":"function timber:settings/toggle/chop_trees"}},{"text":" Chop Trees","hover_event":{"action":"show_text","value":"All kind of trees will get chopped."}}]
execute if score chop_fungi timber matches 1.. run tellraw @s ["",{"text":"[ ✔ ]","color":"green","click_event":{"action":"run_command","command":"function timber:settings/toggle/chop_fungi"}},{"text":" Chop Fungi","hover_event":{"action":"show_text","value":["",{"text":"Huge fungi (nether trees) as well as huge mushrooms will get chopped."},{"text":"\n\nUse it on your own risk!\nWhen enabled, this datapack can't differentiate between generated fungi and player-placed fungi and therefore can potentially destroy your buildings.","color":"dark_red"}]}}]
execute unless score chop_fungi timber matches 1.. run tellraw @s ["",{"text":"[ ❌ ]","color":"red","click_event":{"action":"run_command","command":"function timber:settings/toggle/chop_fungi"}},{"text":" Chop Fungi","hover_event":{"action":"show_text","value":["",{"text":"Huge fungi (nether trees) as well as huge mushrooms will get chopped."},{"text":"\n\nUse it on your own risk!\nWhen enabled, this datapack can't differentiate between generated fungi and player-placed fungi and therefore can potentially destroy your buildings.","color":"dark_red"}]}}]
execute if score blocks_per_chop timber matches 1 if score slow_chop timber matches 1.. run tellraw @s ["",{"text":"[ ✎ ]","color":"gray","click_event":{"action":"suggest_command","command":"/scoreboard players set blocks_per_chop timber "},"hover_event":{"action":"show_text","value":"Default: 1"}},{"text":" Set Amount of Destroyed Blocks per Chop"},{"text":" (Current: ","color":"gray"},{"score":{"name":"blocks_per_chop","objective":"timber"},"color":"gray"},{"text":")","color":"gray"}]
execute unless score blocks_per_chop timber matches 1 if score slow_chop timber matches 1.. run tellraw @s ["",{"text":"[ ✎ ]","color":"gray","click_event":{"action":"suggest_command","command":"/scoreboard players set blocks_per_chop timber "},"hover_event":{"action":"show_text","value":"Default: 1"}},{"text":" Set Amount of Destroyed Blocks per Chop"},{"text":" (Current: ","color":"gray"},{"score":{"name":"blocks_per_chop","objective":"timber"},"color":"gray"},{"text":")","color":"gray"}]
execute unless score slow_chop timber matches 1.. run tellraw @s ["",{"text":"[ ✎ ]","color":"dark_gray","hover_event":{"action":"show_text","value":"Not active when \"Chop Slowly\" is disabled."}},{"text":" Set Amount of Destroyed Blocks per Chop"}]
execute if score time_between_chops timber matches 1 if score slow_chop timber matches 1.. run tellraw @s ["",{"text":"[ ✎ ]","color":"gray","click_event":{"action":"suggest_command","command":"/scoreboard players set time_between_chops timber "},"hover_event":{"action":"show_text","value":"Default: 1"}},{"text":" Set Time in Ticks Between Chops"},{"text":" (Current: ","color":"gray"},{"score":{"name":"time_between_chops","objective":"timber"},"color":"gray"},{"text":")","color":"gray"}]
execute unless score time_between_chops timber matches 1 if score slow_chop timber matches 1.. run tellraw @s ["",{"text":"[ ✎ ]","color":"gray","click_event":{"action":"suggest_command","command":"/scoreboard players set time_between_chops timber "},"hover_event":{"action":"show_text","value":"Default: 1"}},{"text":" Set Time in Ticks Between Chops"},{"text":" (Current: ","color":"gray"},{"score":{"name":"time_between_chops","objective":"timber"},"color":"gray"},{"text":")","color":"gray"}]
execute unless score slow_chop timber matches 1.. run tellraw @s ["",{"text":"[ ✎ ]","color":"dark_gray","hover_event":{"action":"show_text","value":"Not active when \"Chop Slowly\" is disabled."}},{"text":" Set Time in Ticks Between Chops"}]
execute if score max_tree_size timber matches 555 run tellraw @s ["",{"text":"[ ✎ ]","color":"gray","click_event":{"action":"suggest_command","command":"/scoreboard players set max_tree_size timber "},"hover_event":{"action":"show_text","value":"Default: 555"}},{"text":" Set Max. Tree Size","hover_event":{"action":"show_text","value":"Trees bigger than this set value won't get further processed."}},{"text":" (Current: ","color":"gray"},{"score":{"name":"max_tree_size","objective":"timber"},"color":"gray"},{"text":")","color":"gray"}]
execute unless score max_tree_size timber matches 555 run tellraw @s ["",{"text":"[ ✎ ]","color":"gray","click_event":{"action":"suggest_command","command":"/scoreboard players set max_tree_size timber "},"hover_event":{"action":"show_text","value":"Default: 555"}},{"text":" Set Max. Tree Size","hover_event":{"action":"show_text","value":"Trees bigger than this set value won't get further processed."}},{"text":" (Current: ","color":"gray"},{"score":{"name":"max_tree_size","objective":"timber"},"color":"gray"},{"text":")","color":"gray"}]
execute if score min_leaves_found timber matches 5 run tellraw @s ["",{"text":"[ ✎ ]","color":"gray","click_event":{"action":"suggest_command","command":"/scoreboard players set min_leaves_found timber "},"hover_event":{"action":"show_text","value":"Default: 5"}},{"text":" Set Min. Leaves to Valid a Tree","hover_event":{"action":"show_text","value":"This datapack considers a tree only if it has this set value amount of naturally generated leaves at its trunk.\nFungi will get checked by the amount of cap blocks and additionally a 3×3 big cross on top of the stem."}},{"text":" (Current: ","color":"gray"},{"score":{"name":"min_leaves_found","objective":"timber"},"color":"gray"},{"text":")","color":"gray"}]
execute unless score min_leaves_found timber matches 5 run tellraw @s ["",{"text":"[ ✎ ]","color":"gray","click_event":{"action":"suggest_command","command":"/scoreboard players set min_leaves_found timber "},"hover_event":{"action":"show_text","value":"Default: 5"}},{"text":" Set Min. Leaves to Valid a Tree","hover_event":{"action":"show_text","value":"This datapack considers a tree only if it has this set value amount of naturally generated leaves at its trunk.\nFungi will get checked by the amount of cap blocks and additionally a 3×3 big cross on top of the stem."}},{"text":" (Current: ","color":"gray"},{"score":{"name":"min_leaves_found","objective":"timber"},"color":"gray"},{"text":")","color":"gray"}]
tellraw @s ["",{"text":"§m ","color":"dark_gray"}]
function timber:settings/end_of_message

View file

@ -0,0 +1,44 @@
# when full inventory fix
execute if score drop_loot timber matches 1.. store result score inventory timber run data get entity @s Inventory
# destroy blocks
# mark blocks that need to be destroyed
tag @e[type=minecraft:marker,tag=timber_log] add timber_destroy
tag @e[type=minecraft:marker,tag=timber_leaf] add timber_destroy
tag @e[type=minecraft:marker,tag=timber_stem] add timber_destroy
tag @e[type=minecraft:marker,tag=timber_cap] add timber_destroy
# api
execute unless score slow_chop timber matches 1.. at @e[type=minecraft:marker,tag=timber_log] run function #timber:api/break_log
execute unless score slow_chop timber matches 1.. at @e[type=minecraft:marker,tag=timber_leaf] run function #timber:api/break_leaf
execute unless score slow_chop timber matches 1.. at @e[type=minecraft:marker,tag=timber_stem] run function #timber:api/break_stem
execute unless score slow_chop timber matches 1.. at @e[type=minecraft:marker,tag=timber_cap] run function #timber:api/break_cap
# loot
execute unless score slow_chop timber matches 1.. unless score drop_loot timber matches 1.. at @e[type=minecraft:marker,tag=timber_destroy] run loot spawn ~ ~ ~ mine ~ ~ ~ mainhand
execute unless score slow_chop timber matches 1.. if score drop_loot timber matches 1.. unless score inventory timber matches 36.. at @e[type=minecraft:marker,tag=timber_destroy] run loot give @s mine ~ ~ ~ mainhand
execute unless score slow_chop timber matches 1.. if score drop_loot timber matches 1.. if score inventory timber matches 36.. at @e[type=minecraft:marker,tag=timber_destroy] run loot spawn ~ ~ ~ mine ~ ~ ~ mainhand
# destroy animation
gamerule doTileDrops false
execute unless score slow_chop timber matches 1.. at @e[type=minecraft:marker,tag=timber_destroy] run setblock ~ ~ ~ minecraft:air destroy
gamerule doTileDrops true
# remove destroy marker
execute unless score slow_chop timber matches 1.. run kill @e[type=minecraft:marker,tag=timber_destroy]
# stop sound
execute if score stopsound timber matches 1.. as @a[distance=..20,tag=!global.ignore.gui] run function timber:utils/stopsound
# save tool for slow chopping process
execute if score slow_chop timber matches 1.. at @e[type=minecraft:marker,tag=timber_tree,tag=!timber_slow_chop,distance=..7,sort=arbitrary,limit=1] run summon minecraft:armor_stand ~ 0 ~ {Silent:1b,Invulnerable:1b,Marker:1b,Invisible:1b,Tags:["timber_tool"],Rotation:[45f],Pose:{RightArm:[0f,270f,0f]}}
execute if score slow_chop timber matches 1.. at @e[type=minecraft:marker,tag=timber_tree,tag=!timber_slow_chop,distance=..7,sort=arbitrary,limit=1] run data modify entity @e[type=minecraft:armor_stand,tag=timber_tool,y=0,distance=...1,sort=arbitrary,limit=1] equipment.mainhand merge from entity @s SelectedItem
execute if score slow_chop timber matches 1.. run tag @e[type=minecraft:marker,tag=timber_tree,tag=!timber_slow_chop,distance=..7,sort=arbitrary,limit=1] add timber_slow_chop
# tp hand-broken loot into inventory
execute if score drop_loot timber matches 1.. unless score inventory timber matches 36.. at @e[type=minecraft:marker,tag=timber_tree,tag=!timber_slow_chop,distance=..7,sort=arbitrary,limit=1] run function timber:utils/tp_item
# wear out tool
execute if score wear_out timber matches 1.. unless score unbreakable timber matches 1 run function timber:tool/wear_out
# break axe if worn out
execute if score wear_out timber matches 1.. unless score unbreakable timber matches 1 run function timber:tool/worn_out
# give hunger effect
execute if score hunger timber matches 1.. run function timber:utils/hunger

View file

@ -0,0 +1,38 @@
{
"display": {
"icon": {
"id": "minecraft:player_head",
"components": {
"minecraft:profile": {
"properties": [
{
"name": "textures",
"value": "eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvMTg1YzMzNWM1MjVjZGFkY2Q4MmU4MDA4MzU1N2M2OTYzMGRmYjlhMWVkZjU5OTc0YzdmNjU4ZGI1MWEwYTFkOSJ9fX0="
}
]
}
}
},
"title": "Vanilla Tweaks",
"frame": "challenge",
"description": [
"",
{
"text": "All loaded Vanilla Tweaks data packs\n",
"color": "gold"
},
{
"text": "vanillatweaks.net",
"color": "yellow"
}
],
"background": "minecraft:block/black_concrete",
"show_toast": false,
"announce_to_chat": false
},
"criteria": {
"tick": {
"trigger": "minecraft:tick"
}
}
}