diff --git a/.github/resources/help.png b/.github/resources/help.png index f11ce6c..0ce8279 100644 Binary files a/.github/resources/help.png and b/.github/resources/help.png differ diff --git a/.github/resources/settings1.png b/.github/resources/settings1.png index 8593fa8..f94389b 100644 Binary files a/.github/resources/settings1.png and b/.github/resources/settings1.png differ diff --git a/.github/resources/settings2.png b/.github/resources/settings2.png index c0f0467..ae4e97e 100644 Binary files a/.github/resources/settings2.png and b/.github/resources/settings2.png differ diff --git a/.github/scripts/setup-test-server.sh b/.github/scripts/setup-test-server.sh new file mode 100644 index 0000000..1365bad --- /dev/null +++ b/.github/scripts/setup-test-server.sh @@ -0,0 +1,37 @@ +#!/usr/bin/env bash +# Sets up a Fabric server with Fabric API and PackTest for the given Minecraft version in the current directory. +# Exit code 3 means the tooling is not available for that version (yet), any other non-zero code is a real error. +set -euo pipefail + +MC="$1" +UA="Moggla/Timber-Datapack CI" + +# prints the download url of the newest release of a Modrinth project for $MC, or nothing if there is none +modrinth_url() { + curl -fsSL -A "$UA" -G "https://api.modrinth.com/v2/project/$1/version" \ + --data-urlencode "game_versions=[\"$MC\"]" \ + --data-urlencode 'loaders=["fabric"]' \ + | jq -r '[.[] | select(.version_type == "release")][0].files[0].url // empty' +} + +FABRIC_API=$(modrinth_url fabric-api) +PACKTEST=$(modrinth_url packtest) +LOADER=$(curl -fsSL https://meta.fabricmc.net/v2/versions/loader | jq -r '[.[] | select(.stable)][0].version') +INSTALLER=$(curl -fsSL https://meta.fabricmc.net/v2/versions/installer | jq -r '[.[] | select(.stable)][0].version') +# the meta api answers unknown versions with an error or an empty list +SERVER=$(curl -sSL "https://meta.fabricmc.net/v2/versions/loader/$MC" | jq -r 'if type == "array" and length > 0 then "yes" else empty end' 2>/dev/null || true) + +MISSING="" +[ -n "$SERVER" ] || MISSING="$MISSING Fabric server," +[ -n "$FABRIC_API" ] || MISSING="$MISSING Fabric API," +[ -n "$PACKTEST" ] || MISSING="$MISSING PackTest," +if [ -n "$MISSING" ]; then + echo "Not available for Minecraft $MC yet:${MISSING%,}" >&2 + exit 3 +fi + +mkdir -p mods +curl -fsSL -o server.jar "https://meta.fabricmc.net/v2/versions/loader/$MC/$LOADER/$INSTALLER/server/jar" +curl -fsSL -o mods/fabric-api.jar "$FABRIC_API" +curl -fsSL -o mods/packtest.jar "$PACKTEST" +echo "eula=true" > eula.txt diff --git a/.github/workflows/latest.yml b/.github/workflows/latest.yml new file mode 100644 index 0000000..3d99483 --- /dev/null +++ b/.github/workflows/latest.yml @@ -0,0 +1,109 @@ +name: Latest Minecraft + +# Checks whether the datapack works on a Minecraft release newer than the ones in the test matrix +# and opens an issue with the result, so that nobody has to look at the runs. +# Not a required check: Fabric, Fabric API and PackTest usually lag a few days behind a new release. +on: + schedule: + - cron: "0 6 * * 1" + workflow_dispatch: + +permissions: + contents: read + issues: write + +jobs: + latest: + name: Latest Minecraft release + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - name: Find latest release + id: version + run: | + MANIFEST=$(curl -fsSL https://piston-meta.mojang.com/mc/game/version_manifest_v2.json) + MC=$(jq -r '.latest.release' <<< "$MANIFEST") + URL=$(jq -r --arg id "$MC" '.versions[] | select(.id == $id) | .url' <<< "$MANIFEST") + JAVA=$(curl -fsSL "$URL" | jq -r '.javaVersion.majorVersion') + + # highest version that the test matrix already covers + SUPPORTED=$(sed -n 's/.*minecraft: "\([^"]*\)".*/\1/p' .github/workflows/test.yml | sort -V | tail -n 1) + + echo "mc=$MC" >> "$GITHUB_OUTPUT" + echo "java=$JAVA" >> "$GITHUB_OUTPUT" + if [ "$MC" != "$SUPPORTED" ] && [ "$(printf '%s\n%s\n' "$SUPPORTED" "$MC" | sort -V | tail -n 1)" = "$MC" ]; then + echo "newer=true" >> "$GITHUB_OUTPUT" + echo "Latest Minecraft release $MC is newer than the supported $SUPPORTED (Java $JAVA)" + else + echo "newer=false" >> "$GITHUB_OUTPUT" + echo "Latest Minecraft release $MC is already covered by the test matrix (highest: $SUPPORTED)." | tee -a "$GITHUB_STEP_SUMMARY" + fi + + - uses: actions/setup-java@v4 + if: steps.version.outputs.newer == 'true' + with: + distribution: temurin + java-version: ${{ steps.version.outputs.java }} + + - name: Set up Fabric server, Fabric API and PackTest + id: setup + if: steps.version.outputs.newer == 'true' + run: | + set +e + bash .github/scripts/setup-test-server.sh "${{ steps.version.outputs.mc }}" + CODE=$? + if [ $CODE -eq 3 ]; then + echo "ready=false" >> "$GITHUB_OUTPUT" + echo "Minecraft ${{ steps.version.outputs.mc }} can't be tested yet, the test tooling isn't available for it. Trying again next time." | tee -a "$GITHUB_STEP_SUMMARY" + exit 0 + fi + [ $CODE -eq 0 ] || exit $CODE + echo "ready=true" >> "$GITHUB_OUTPUT" + + - name: Install datapacks + if: steps.setup.outputs.ready == 'true' + run: | + mkdir -p world/datapacks/timber world/datapacks/timber_test + cp -r data pack.mcmeta 121 world/datapacks/timber/ + cp -r tests/. world/datapacks/timber_test/ + + - name: Run tests + id: tests + if: steps.setup.outputs.ready == 'true' + continue-on-error: true + run: java -Xmx2G -Dpacktest.auto -Dpacktest.auto.annotations -jar server.jar nogui + + - name: Open an issue with the result + if: steps.setup.outputs.ready == 'true' + env: + GH_TOKEN: ${{ github.token }} + MC: ${{ steps.version.outputs.mc }} + OUTCOME: ${{ steps.tests.outcome }} + RUN_URL: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }} + run: | + if [ "$OUTCOME" = "success" ]; then + TITLE="Minecraft $MC works with the datapack" + BODY="The tests pass on Minecraft $MC ([run]($RUN_URL)). + + To support it: + - bump \`max_format\` in \`pack.mcmeta\` + - add \`$MC\` to the matrix in \`.github/workflows/test.yml\` + - release the update" + else + TITLE="Minecraft $MC breaks the datapack" + BODY="The tests fail on Minecraft $MC ([run]($RUN_URL)). See the annotations of the run for the failed tests." + fi + + # closed issues count too, so a handled version doesn't get reported again + EXISTING=$(gh issue list --state all --search "\"$TITLE\" in:title" --json title --jq "[.[] | select(.title == \"$TITLE\")] | length") + if [ "$EXISTING" -gt 0 ]; then + echo "Issue \"$TITLE\" already exists." | tee -a "$GITHUB_STEP_SUMMARY" + else + gh issue create --title "$TITLE" --body "$BODY" --label "CI/CD" + echo "Opened issue \"$TITLE\"." | tee -a "$GITHUB_STEP_SUMMARY" + fi + + - name: Fail if the tests failed + if: steps.tests.outcome == 'failure' + run: exit 1 diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 0000000..64bbc6d --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,48 @@ +name: Test + +on: + pull_request: + push: + branches: [main] + +jobs: + test: + name: Minecraft ${{ matrix.minecraft }} + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + include: + - minecraft: "26.1.2" + java: "25" + - minecraft: "26.3" + java: "25" + steps: + - uses: actions/checkout@v4 + + - uses: actions/setup-java@v4 + with: + distribution: temurin + java-version: ${{ matrix.java }} + + - name: Set up Fabric server, Fabric API and PackTest + run: bash .github/scripts/setup-test-server.sh "${{ matrix.minecraft }}" + + - name: Install datapacks + run: | + mkdir -p world/datapacks/timber world/datapacks/timber_test + cp -r data pack.mcmeta 121 world/datapacks/timber/ + cp -r tests/. world/datapacks/timber_test/ + + - name: Run tests + run: java -Xmx2G -Dpacktest.auto -Dpacktest.auto.annotations -jar server.jar nogui + + # single check to require in the branch ruleset, so changing the matrix doesn't need a ruleset update + test-result: + name: Test result + needs: test + if: always() + runs-on: ubuntu-latest + steps: + - name: Fail if any test job failed or was cancelled + run: test "${{ needs.test.result }}" = "success" diff --git a/18-26/data/minecraft/loot_tables/blocks/mushroom_stem.json b/18-26/data/minecraft/loot_tables/blocks/mushroom_stem.json deleted file mode 100644 index 4de3d97..0000000 --- a/18-26/data/minecraft/loot_tables/blocks/mushroom_stem.json +++ /dev/null @@ -1,52 +0,0 @@ -{ - "type": "minecraft:block", - "pools": [ - { - "rolls": 1, - "entries": [ - { - "type": "minecraft:item", - "name": "minecraft:mushroom_stem" - } - ], - "conditions": [ - { - "condition": "minecraft:match_tool", - "predicate": { - "enchantments": [ - { - "enchantment": "minecraft:silk_touch", - "levels": { - "min": 1 - } - } - ] - } - } - ] - }, - { - "rolls": 1, - "entries": [ - { - "type": "minecraft:item", - "name": "minecraft:knowledge_book", - "functions": [ - { - "function": "minecraft:set_nbt", - "tag": "{Tags:[timber_location]}" - } - ], - "conditions": [ - { - "condition": "minecraft:match_tool", - "predicate": { - "tag": "timber:axes" - } - } - ] - } - ] - } - ] -} \ No newline at end of file diff --git a/18-26/data/timber/functions/autoplant/plant.mcfunction b/18-26/data/timber/functions/autoplant/plant.mcfunction deleted file mode 100644 index a9bcf97..0000000 --- a/18-26/data/timber/functions/autoplant/plant.mcfunction +++ /dev/null @@ -1,17 +0,0 @@ -# replace item-sapling with block-sapling (special case for mud, because fallingblock get destroyed. 0.125 is the height when you sink into the mud) -execute unless block ~ ~ ~ minecraft:air run summon marker ~ ~ ~ {Tags:["timber_mud","global.ignore"]} -execute unless block ~ ~ ~ minecraft:air run schedule function timber:autoplant/mud_fix 1t -execute unless block ~ ~ ~ minecraft:air run setblock ~ ~ ~ minecraft:muddy_mangrove_roots -summon minecraft:falling_block ~ ~0.125 ~ {BlockState:{Name:"minecraft:barrier"},Time:1,DropItem:0b,Tags:["timber_item_to_block"]} -execute positioned ~ ~0.125 ~ run data modify entity @e[type=minecraft:falling_block,tag=timber_item_to_block,distance=...1,sort=arbitrary,limit=1] BlockState.Name set from entity @s Item.id - -# on stacks -1 -execute store result score @s timber run data get entity @s Item.Count -scoreboard players remove @s timber 1 -execute store result entity @s Item.Count byte 1 run scoreboard players get @s timber -scoreboard players reset @s timber -# cheap custom server fix -execute if score not_vanilla timber matches 1 run kill @s - -# sapling will be checked every time -tag @s remove timber_checked \ No newline at end of file diff --git a/18-26/data/timber/functions/init.mcfunction b/18-26/data/timber/functions/init.mcfunction deleted file mode 100644 index dd644cf..0000000 --- a/18-26/data/timber/functions/init.mcfunction +++ /dev/null @@ -1,38 +0,0 @@ -# longer maxCommandChainLength -gamerule maxCommandChainLength 1000000000 - -# create scoreboards -scoreboard objectives add timber_w_axe minecraft.used:minecraft.wooden_axe -scoreboard objectives add timber_s_axe minecraft.used:minecraft.stone_axe -scoreboard objectives add timber_i_axe minecraft.used:minecraft.iron_axe -scoreboard objectives add timber_g_axe minecraft.used:minecraft.golden_axe -scoreboard objectives add timber_d_axe minecraft.used:minecraft.diamond_axe -scoreboard objectives add timber_n_axe minecraft.used:minecraft.netherite_axe -scoreboard objectives add timber dummy -scoreboard objectives add TimberToggle trigger {"text":"Timber Toggle","color":"#724E21"} -scoreboard objectives add timber_disabled dummy -scoreboard objectives add timber_prsistent dummy - -# non-overriding default values -function timber:settings/default_values -scoreboard players set running timber 0 - -# start optional loops -execute if score plant_sapling timber matches 1.. run function timber:autoplant/loop -execute if score slow_chop timber matches 1.. run function timber:slow_chop/loop - -# check loottable compatibility of mushroom stem -setblock ~ 255 ~ minecraft:chest -setblock ~ 255 ~1 minecraft:mushroom_stem -loot insert ~ 255 ~ mine ~ 255 ~1 minecraft:diamond_axe -execute unless data block ~ 255 ~ Items[{id:"minecraft:knowledge_book"}] run tellraw @a[tag=!noTimberWarning] ["",{"text":"Timber Datapack Warning: ","color":"red"},{"text":"Incompatibility with the mushroom_stem loottable of another datapack!"}] -fill ~-1 255 ~-1 ~1 255 ~1 minecraft:air -execute store result score doTileDrops timber run gamerule doTileDrops -execute if score doTileDrops timber matches 0 run tellraw @a[tag=!noTimberWarning] ["",{"text":"Timber Datapack Warning: ","color":"red"},{"text":"This datapack only works when gamerule doTileDrops is set to true!"}] - -# Getting the game version and checking if it is compatible with the datapack https://minecraft.fandom.com/wiki/Data_version -execute store result score game_version timber run data get entity @r DataVersion -execute if score game_version timber matches ..3442 run tellraw @a[tag=!noTimberWarning] ["",{"text":"Timber Datapack Warning: ","color":"red"},{"text":"This datapack is not compatible with all the versions before 1.20!"}] - -# Checking if the server uses a different jar from the vanilla one -function timber:utils/check_server \ No newline at end of file diff --git a/18-26/data/timber/functions/run.mcfunction b/18-26/data/timber/functions/run.mcfunction deleted file mode 100644 index 3466cdd..0000000 --- a/18-26/data/timber/functions/run.mcfunction +++ /dev/null @@ -1,46 +0,0 @@ -# reset -scoreboard players set leaves_found timber 0 -scoreboard players set tree_size timber 0 -scoreboard players set tree_type timber 0 - -# load settings to other scoreboard (leaves persistent) -execute unless score persistent timber matches 1.. run scoreboard players set @s timber_prsistent 0 -execute if score persistent timber matches 1.. run scoreboard players set @s timber_prsistent 1 - -# search last broken item (place of tree) and set a marker (limit=1 removed, because carpet on log breaks this) -execute at @e[type=minecraft:item,distance=..7,nbt={Age:0s}] run summon marker ~ ~ ~ {Tags:["timber_tree","global.ignore"]} - -# Enchantments randomizer -scoreboard players set unbreaking timber 0 -execute if entity @s[nbt={SelectedItem:{tag:{Enchantments:[{id:"minecraft:unbreaking",lvl:1s}]}}}] run scoreboard players set unbreaking timber 1 -execute if entity @s[nbt={SelectedItem:{tag:{Enchantments:[{id:"minecraft:unbreaking",lvl:2s}]}}}] run scoreboard players set unbreaking timber 2 -execute if entity @s[nbt={SelectedItem:{tag:{Enchantments:[{id:"minecraft:unbreaking",lvl:3s}]}}}] run scoreboard players set unbreaking timber 3 - -# get durability -function timber:tool/durability_get - -# scan through tree - # tree (limit=1,sort=arbitrary removed, because carpet on log breaks this) - execute if score chop_trees timber matches 1.. at @e[type=minecraft:marker,tag=timber_tree,tag=!timber_slow_chop,distance=..7] run function timber:algorithm/tree/run - execute store result score leaves_found timber if entity @e[type=minecraft:marker,tag=timber_leaves_found] - # if tree is valid - execute if score leaves_found timber >= min_leaves_found timber unless score tree_size timber matches 0 run scoreboard players set tree_type timber 1 - - # fungi (only if not tree already) - execute if score tree_type timber matches 0 if score chop_fungi timber matches 1.. run function timber:run_fungi - -# if tree or fungi is valid (tree = 1 | fungus = 2) -execute unless score tree_type timber matches 0 if score tree_size timber <= max_tree_size timber run function timber:validated - -# remove markers -execute if score chop_fungi timber matches 1.. run kill @e[type=minecraft:item,nbt={Item:{tag:{Tags:[timber_location]}}}] -execute if score chop_fungi timber matches 1.. run clear @s knowledge_book{Tags:[timber_location]} -kill @e[type=minecraft:marker,tag=timber_tree,tag=!timber_slow_chop] -kill @e[type=minecraft:marker,tag=timber_log,tag=!timber_destroy] -kill @e[type=minecraft:marker,tag=timber_leaf,tag=!timber_destroy] -kill @e[type=minecraft:marker,tag=timber_root,tag=!timber_destroy] -kill @e[type=minecraft:marker,tag=timber_stem,tag=!timber_destroy] -kill @e[type=minecraft:marker,tag=timber_cap,tag=!timber_destroy] -kill @e[type=minecraft:marker,tag=timber_leaves_found] -kill @e[type=minecraft:marker,tag=timber_leaf_distance] -kill @e[type=minecraft:marker,tag=timber_other_stem] \ No newline at end of file diff --git a/18-26/data/timber/functions/slow_chop/destroy_loop.mcfunction b/18-26/data/timber/functions/slow_chop/destroy_loop.mcfunction deleted file mode 100644 index 97282b3..0000000 --- a/18-26/data/timber/functions/slow_chop/destroy_loop.mcfunction +++ /dev/null @@ -1,25 +0,0 @@ -# loop -$schedule function timber:slow_chop/loop $(time_between_chops)t replace - -# api -$execute at @e[type=minecraft:marker,tag=timber_slow_chop] as @e[type=minecraft:marker,tag=timber_destroy,sort=nearest,limit=$(blocks_per_chop)] at @s run function timber:slow_chop/api - -# destroy n block -$execute at @e[type=minecraft:marker,tag=timber_slow_chop] as @e[type=minecraft:armor_stand,tag=timber_tool,y=-64,distance=...1,sort=arbitrary,limit=1] at @e[type=minecraft:marker,tag=timber_destroy,sort=nearest,limit=$(blocks_per_chop)] run loot spawn ~ ~ ~ mine ~ ~ ~ mainhand - -# destroy animation (doTileDrops can be changed, because datapack wouldn't get to this point otherwise) -gamerule doTileDrops false -$execute at @e[type=minecraft:marker,tag=timber_slow_chop] at @e[type=minecraft:marker,tag=timber_destroy,sort=nearest,limit=$(blocks_per_chop)] run setblock ~ ~ ~ minecraft:air destroy -gamerule doTileDrops true - -# stop sound -$execute at @e[type=minecraft:marker,tag=timber_slow_chop] if score stopsound timber matches 1.. at @e[type=minecraft:marker,tag=timber_destroy,sort=nearest,limit=$(blocks_per_chop)] as @a[distance=..20,tag=!global.ignore.gui] run function timber:utils/stopsound - -# delete location item -$execute at @e[type=minecraft:marker,tag=timber_slow_chop] at @e[type=minecraft:marker,tag=timber_destroy,sort=nearest,limit=$(blocks_per_chop)] run kill @e[type=minecraft:item,distance=..1,nbt={Item:{tag:{Tags:["timber_location"]}}}] - -# remove marker of processed blocks -$execute at @e[type=minecraft:marker,tag=timber_slow_chop] run kill @e[type=minecraft:marker,tag=timber_destroy,sort=nearest,limit=$(blocks_per_chop)] - -# delete tree markers after chopping -execute unless entity @e[type=minecraft:marker,tag=timber_destroy] run function timber:slow_chop/delete_markers \ No newline at end of file diff --git a/18-26/data/timber/functions/tool/wear_out.mcfunction b/18-26/data/timber/functions/tool/wear_out.mcfunction deleted file mode 100644 index d6b6e58..0000000 --- a/18-26/data/timber/functions/tool/wear_out.mcfunction +++ /dev/null @@ -1,3 +0,0 @@ -# wear out tool -execute store result storage timber:temp durability int 1 run scoreboard players get durability timber -item modify entity @s weapon.mainhand timber:wear_out \ No newline at end of file diff --git a/18-26/data/timber/functions/used_axe.mcfunction b/18-26/data/timber/functions/used_axe.mcfunction deleted file mode 100644 index 744ef4b..0000000 --- a/18-26/data/timber/functions/used_axe.mcfunction +++ /dev/null @@ -1,18 +0,0 @@ -# is this axe enabled? -execute unless score @s timber_disabled matches 1.. if score @s timber_w_axe matches 1.. if score wooden_axe timber matches 1.. run function timber:sneaking -execute unless score @s timber_disabled matches 1.. if score @s timber_s_axe matches 1.. if score stone_axe timber matches 1.. run function timber:sneaking -execute unless score @s timber_disabled matches 1.. if score @s timber_i_axe matches 1.. if score iron_axe timber matches 1.. run function timber:sneaking -execute unless score @s timber_disabled matches 1.. if score @s timber_g_axe matches 1.. if score golden_axe timber matches 1.. run function timber:sneaking -execute unless score @s timber_disabled matches 1.. if score @s timber_d_axe matches 1.. if score diamond_axe timber matches 1.. run function timber:sneaking -execute unless score @s timber_disabled matches 1.. if score @s timber_n_axe matches 1.. if score netherite_axe timber matches 1.. run function timber:sneaking - -# remove mushroom_stem marker -kill @e[type=minecraft:item,distance=..7,nbt={Item:{tag:{Tags:[timber_location]}}}] - -# reset scores -scoreboard players set @s timber_w_axe 0 -scoreboard players set @s timber_s_axe 0 -scoreboard players set @s timber_i_axe 0 -scoreboard players set @s timber_g_axe 0 -scoreboard players set @s timber_d_axe 0 -scoreboard players set @s timber_n_axe 0 \ No newline at end of file diff --git a/18-26/data/timber/item_modifiers/wear_out.json b/18-26/data/timber/item_modifiers/wear_out.json deleted file mode 100644 index 605acf8..0000000 --- a/18-26/data/timber/item_modifiers/wear_out.json +++ /dev/null @@ -1,16 +0,0 @@ -[ - { - "function": "minecraft:copy_nbt", - "source": { - "type": "minecraft:storage", - "source": "timber:temp" - }, - "ops": [ - { - "source": "durability", - "target": "Damage", - "op": "replace" - } - ] - } -] \ No newline at end of file diff --git a/18-26/data/timber/predicates/block/cap.json b/18-26/data/timber/predicates/block/cap.json deleted file mode 100644 index 2e456e1..0000000 --- a/18-26/data/timber/predicates/block/cap.json +++ /dev/null @@ -1,37 +0,0 @@ -{ - "condition": "minecraft:any_of", - "terms": [ - { - "condition": "minecraft:location_check", - "predicate": { - "block": { - "tag": "minecraft:wart_blocks" - } - } - }, - { - "condition": "minecraft:location_check", - "predicate": { - "block": { - "blocks": ["minecraft:shroomlight"] - } - } - }, - { - "condition": "minecraft:location_check", - "predicate": { - "block": { - "blocks": ["minecraft:brown_mushroom_block"] - } - } - }, - { - "condition": "minecraft:location_check", - "predicate": { - "block": { - "blocks": ["minecraft:red_mushroom_block"] - } - } - } - ] -} \ No newline at end of file diff --git a/18-26/data/timber/predicates/block/leaf.json b/18-26/data/timber/predicates/block/leaf.json deleted file mode 100644 index 86425b5..0000000 --- a/18-26/data/timber/predicates/block/leaf.json +++ /dev/null @@ -1,26 +0,0 @@ -{ - "condition": "minecraft:any_of", - "terms": [ - { - "condition": "minecraft:location_check", - "predicate": { - "block": { - "tag": "minecraft:leaves" - } - } - }, - { - "condition": "minecraft:location_check", - "predicate": { - "block": { - "blocks": [ - "minecraft:mangrove_propagule" - ], - "state": { - "hanging": "true" - } - } - } - } - ] -} diff --git a/18-26/data/timber/predicates/block/log.json b/18-26/data/timber/predicates/block/log.json deleted file mode 100644 index 759b71c..0000000 --- a/18-26/data/timber/predicates/block/log.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "condition": "minecraft:location_check", - "predicate": { - "block": { - "tag": "minecraft:logs" - } - } -} diff --git a/18-26/data/timber/predicates/block/stem.json b/18-26/data/timber/predicates/block/stem.json deleted file mode 100644 index a6b9e8e..0000000 --- a/18-26/data/timber/predicates/block/stem.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "condition": "minecraft:any_of", - "terms": [ - { - "condition": "minecraft:location_check", - "predicate": { - "block": { - "tag": "minecraft:logs" - } - } - }, - { - "condition": "minecraft:location_check", - "predicate": { - "block": { - "blocks": ["minecraft:mushroom_stem"] - } - } - } - ] -} \ No newline at end of file diff --git a/18-26/data/timber/predicates/item/log.json b/18-26/data/timber/predicates/item/log.json deleted file mode 100644 index 941fb0b..0000000 --- a/18-26/data/timber/predicates/item/log.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "condition": "minecraft:entity_properties", - "entity": "this", - "predicate": { - "equipment": { - "mainhand": { - "tag": "minecraft:logs" - } - } - } -} \ No newline at end of file diff --git a/18-26/data/timber/predicates/item/root.json b/18-26/data/timber/predicates/item/root.json deleted file mode 100644 index 3fd61cd..0000000 --- a/18-26/data/timber/predicates/item/root.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "condition": "minecraft:entity_properties", - "entity": "this", - "predicate": { - "equipment": { - "mainhand": { - "items": [ - "minecraft:mangrove_roots" - ] - } - } - } -} - \ No newline at end of file diff --git a/18-26/data/timber/predicates/item/sapling.json b/18-26/data/timber/predicates/item/sapling.json deleted file mode 100644 index ab208e0..0000000 --- a/18-26/data/timber/predicates/item/sapling.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "condition": "minecraft:entity_properties", - "entity": "this", - "predicate": { - "equipment": { - "mainhand": { - "tag": "minecraft:saplings" - } - } - } -} \ No newline at end of file diff --git a/18-26/data/timber/predicates/item/stem.json b/18-26/data/timber/predicates/item/stem.json deleted file mode 100644 index 5d8c572..0000000 --- a/18-26/data/timber/predicates/item/stem.json +++ /dev/null @@ -1,39 +0,0 @@ -{ - "condition": "minecraft:any_of", - "terms": [ - { - "condition": "minecraft:entity_properties", - "entity": "this", - "predicate": { - "equipment": { - "mainhand": { - "tag": "minecraft:logs" - } - } - } - }, - { - "condition": "minecraft:entity_properties", - "entity": "this", - "predicate": { - "equipment": { - "mainhand": { - "items": ["minecraft:mushroom_stem"] - } - } - } - }, - { - "condition": "minecraft:entity_properties", - "entity": "this", - "predicate": { - "equipment": { - "mainhand": { - "items": ["minecraft:knowledge_book"], - "nbt": "{Tags:[timber_location]}" - } - } - } - } - ] -} \ No newline at end of file diff --git a/18-26/data/timber/predicates/used_axe.json b/18-26/data/timber/predicates/used_axe.json deleted file mode 100644 index 1639a11..0000000 --- a/18-26/data/timber/predicates/used_axe.json +++ /dev/null @@ -1,65 +0,0 @@ -{ - "condition": "minecraft:any_of", - "terms": [ - { - "condition": "minecraft:entity_scores", - "entity": "this", - "scores": { - "timber_w_axe": { - "min": 1, - "max": 2147483647 - } - } - }, - { - "condition": "minecraft:entity_scores", - "entity": "this", - "scores": { - "timber_s_axe": { - "min": 1, - "max": 2147483647 - } - } - }, - { - "condition": "minecraft:entity_scores", - "entity": "this", - "scores": { - "timber_i_axe": { - "min": 1, - "max": 2147483647 - } - } - }, - { - "condition": "minecraft:entity_scores", - "entity": "this", - "scores": { - "timber_g_axe": { - "min": 1, - "max": 2147483647 - } - } - }, - { - "condition": "minecraft:entity_scores", - "entity": "this", - "scores": { - "timber_d_axe": { - "min": 1, - "max": 2147483647 - } - } - }, - { - "condition": "minecraft:entity_scores", - "entity": "this", - "scores": { - "timber_n_axe": { - "min": 1, - "max": 2147483647 - } - } - } - ] -} \ No newline at end of file diff --git a/18-26/data/timber/tags/functions/api/break_cap.json b/18-26/data/timber/tags/functions/api/break_cap.json deleted file mode 100644 index ab3fce9..0000000 --- a/18-26/data/timber/tags/functions/api/break_cap.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "values":[ - ] -} \ No newline at end of file diff --git a/18-26/data/timber/tags/functions/api/break_leaf.json b/18-26/data/timber/tags/functions/api/break_leaf.json deleted file mode 100644 index ab3fce9..0000000 --- a/18-26/data/timber/tags/functions/api/break_leaf.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "values":[ - ] -} \ No newline at end of file diff --git a/18-26/data/timber/tags/functions/api/break_log.json b/18-26/data/timber/tags/functions/api/break_log.json deleted file mode 100644 index ab3fce9..0000000 --- a/18-26/data/timber/tags/functions/api/break_log.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "values":[ - ] -} \ No newline at end of file diff --git a/18-26/data/timber/tags/functions/api/break_root.json b/18-26/data/timber/tags/functions/api/break_root.json deleted file mode 100644 index ab3fce9..0000000 --- a/18-26/data/timber/tags/functions/api/break_root.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "values":[ - ] -} \ No newline at end of file diff --git a/18-26/data/timber/tags/functions/api/break_stem.json b/18-26/data/timber/tags/functions/api/break_stem.json deleted file mode 100644 index ab3fce9..0000000 --- a/18-26/data/timber/tags/functions/api/break_stem.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "values":[ - ] -} \ No newline at end of file diff --git a/18-26/data/timber/tags/items/axes.json b/18-26/data/timber/tags/items/axes.json deleted file mode 100644 index c496215..0000000 --- a/18-26/data/timber/tags/items/axes.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "values":[ - "minecraft:wooden_axe", - "minecraft:stone_axe", - "minecraft:iron_axe", - "minecraft:golden_axe", - "minecraft:diamond_axe", - "minecraft:netherite_axe" - ] -} \ No newline at end of file diff --git a/18-41/data/minecraft/loot_tables/blocks/mushroom_stem.json b/18-41/data/minecraft/loot_tables/blocks/mushroom_stem.json deleted file mode 100644 index efe0d2b..0000000 --- a/18-41/data/minecraft/loot_tables/blocks/mushroom_stem.json +++ /dev/null @@ -1,51 +0,0 @@ -{ - "type": "minecraft:block", - "pools": [ - { - "rolls": 1, - "entries": [ - { - "type": "minecraft:item", - "name": "minecraft:mushroom_stem" - } - ], - "conditions": [ - { - "condition": "minecraft:match_tool", - "predicate": { - "components": { - "minecraft:enchantments": { - "levels": { - "minecraft:silk_touch": 1 - } - } - } - } - } - ] - }, - { - "rolls": 1, - "entries": [ - { - "type": "minecraft:item", - "name": "minecraft:knowledge_book", - "functions": [ - { - "function": "minecraft:set_custom_data", - "tag": "{Tags:[\"timber_location\"]}" - } - ], - "conditions": [ - { - "condition": "minecraft:match_tool", - "predicate": { - "items": "#timber:axes" - } - } - ] - } - ] - } - ] -} \ No newline at end of file diff --git a/18-41/data/minecraft/tags/functions/load.json b/18-41/data/minecraft/tags/functions/load.json deleted file mode 100644 index 420a05c..0000000 --- a/18-41/data/minecraft/tags/functions/load.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "values": [ - "timber:init", - "timber:main" - ] -} diff --git a/18-41/data/timber/functions/algorithm/fungus/chop.mcfunction b/18-41/data/timber/functions/algorithm/fungus/chop.mcfunction deleted file mode 100644 index 1308490..0000000 --- a/18-41/data/timber/functions/algorithm/fungus/chop.mcfunction +++ /dev/null @@ -1,31 +0,0 @@ -# resets -scoreboard players set durability_okay timber 1 - -# keep track of tree size -scoreboard players add tree_size timber 1 - -# wear out tool -function timber:tool/durability_count - -# tool durability check -execute if score stop_chopping timber matches 1.. run function timber:tool/durability_check - -##### if on top -execute positioned ~ ~1 ~ unless predicate timber:block/stem run function timber:algorithm/fungus/validate_cap -# mark cap that have been checked -execute positioned ~ ~ ~1 unless entity @e[type=minecraft:marker,tag=timber_leaves_found,distance=...1,sort=nearest,limit=1] if predicate timber:block/cap run summon marker ~ ~ ~ {Tags:["timber_leaves_found"]} -execute positioned ~ ~ ~-1 unless entity @e[type=minecraft:marker,tag=timber_leaves_found,distance=...1,sort=nearest,limit=1] if predicate timber:block/cap run summon marker ~ ~ ~ {Tags:["timber_leaves_found"]} -execute positioned ~1 ~ ~ unless entity @e[type=minecraft:marker,tag=timber_leaves_found,distance=...1,sort=nearest,limit=1] if predicate timber:block/cap run summon marker ~ ~ ~ {Tags:["timber_leaves_found"]} -execute positioned ~-1 ~ ~ unless entity @e[type=minecraft:marker,tag=timber_leaves_found,distance=...1,sort=nearest,limit=1] if predicate timber:block/cap run summon marker ~ ~ ~ {Tags:["timber_leaves_found"]} -execute positioned ~ ~1 ~ unless entity @e[type=minecraft:marker,tag=timber_leaves_found,distance=...1,sort=nearest,limit=1] if predicate timber:block/cap run summon marker ~ ~ ~ {Tags:["timber_leaves_found"]} -execute positioned ~ ~-1 ~ unless entity @e[type=minecraft:marker,tag=timber_leaves_found,distance=...1,sort=nearest,limit=1] if predicate timber:block/cap run summon marker ~ ~ ~ {Tags:["timber_leaves_found"]} - -# mark block that will get destroyed -execute if score durability_okay timber matches 1.. if score tree_size timber < max_tree_size timber run summon marker ~ ~ ~ {Tags:["timber_stem"]} - -# search for next stem -execute if score durability_okay timber matches 1.. if score tree_size timber < max_tree_size timber run function timber:algorithm/fungus/search - -# destroy cap (always) -execute run scoreboard players set leaf_distance timber 0 -function timber:algorithm/fungus/leaves/search \ No newline at end of file diff --git a/18-41/data/timber/functions/algorithm/fungus/leaves/destroy.mcfunction b/18-41/data/timber/functions/algorithm/fungus/leaves/destroy.mcfunction deleted file mode 100644 index e5389ec..0000000 --- a/18-41/data/timber/functions/algorithm/fungus/leaves/destroy.mcfunction +++ /dev/null @@ -1,3 +0,0 @@ -execute if score leaf_distance timber <= max_tree_size timber run summon marker ~ ~ ~ {Tags:["timber_cap"]} - -execute if score leaf_distance timber <= max_tree_size timber run function timber:algorithm/fungus/leaves/search \ No newline at end of file diff --git a/18-41/data/timber/functions/algorithm/fungus/leaves/find_other_stems.mcfunction b/18-41/data/timber/functions/algorithm/fungus/leaves/find_other_stems.mcfunction deleted file mode 100644 index 899a15c..0000000 --- a/18-41/data/timber/functions/algorithm/fungus/leaves/find_other_stems.mcfunction +++ /dev/null @@ -1,7 +0,0 @@ -# find other stems -execute at @e[type=minecraft:marker,tag=timber_cap] positioned ~ ~ ~1 if predicate timber:block/stem unless entity @e[type=minecraft:marker,tag=timber_stem,distance=...1,sort=arbitrary,limit=1] unless entity @e[type=minecraft:marker,tag=timber_other_stem,distance=...1,sort=arbitrary,limit=1] run summon marker ~ ~ ~ {Tags:["timber_other_stem"]} -execute at @e[type=minecraft:marker,tag=timber_cap] positioned ~ ~ ~-1 if predicate timber:block/stem unless entity @e[type=minecraft:marker,tag=timber_stem,distance=...1,sort=arbitrary,limit=1] unless entity @e[type=minecraft:marker,tag=timber_other_stem,distance=...1,sort=arbitrary,limit=1] run summon marker ~ ~ ~ {Tags:["timber_other_stem"]} -execute at @e[type=minecraft:marker,tag=timber_cap] positioned ~1 ~ ~ if predicate timber:block/stem unless entity @e[type=minecraft:marker,tag=timber_stem,distance=...1,sort=arbitrary,limit=1] unless entity @e[type=minecraft:marker,tag=timber_other_stem,distance=...1,sort=arbitrary,limit=1] run summon marker ~ ~ ~ {Tags:["timber_other_stem"]} -execute at @e[type=minecraft:marker,tag=timber_cap] positioned ~-1 ~ ~ if predicate timber:block/stem unless entity @e[type=minecraft:marker,tag=timber_stem,distance=...1,sort=arbitrary,limit=1] unless entity @e[type=minecraft:marker,tag=timber_other_stem,distance=...1,sort=arbitrary,limit=1] run summon marker ~ ~ ~ {Tags:["timber_other_stem"]} -execute at @e[type=minecraft:marker,tag=timber_cap] positioned ~ ~1 ~ if predicate timber:block/stem unless entity @e[type=minecraft:marker,tag=timber_stem,distance=...1,sort=arbitrary,limit=1] unless entity @e[type=minecraft:marker,tag=timber_other_stem,distance=...1,sort=arbitrary,limit=1] run summon marker ~ ~ ~ {Tags:["timber_other_stem"]} -execute at @e[type=minecraft:marker,tag=timber_cap] positioned ~ ~-1 ~ if predicate timber:block/stem unless entity @e[type=minecraft:marker,tag=timber_stem,distance=...1,sort=arbitrary,limit=1] unless entity @e[type=minecraft:marker,tag=timber_other_stem,distance=...1,sort=arbitrary,limit=1] run summon marker ~ ~ ~ {Tags:["timber_other_stem"]} \ No newline at end of file diff --git a/18-41/data/timber/functions/algorithm/fungus/leaves/search.mcfunction b/18-41/data/timber/functions/algorithm/fungus/leaves/search.mcfunction deleted file mode 100644 index d2a0e7f..0000000 --- a/18-41/data/timber/functions/algorithm/fungus/leaves/search.mcfunction +++ /dev/null @@ -1,18 +0,0 @@ -scoreboard players add leaf_distance timber 1 -# search for next cap -execute positioned ~ ~ ~1 unless entity @e[type=minecraft:marker,tag=timber_cap,distance=...1,sort=arbitrary,limit=1] if predicate timber:block/cap run function timber:algorithm/fungus/leaves/destroy -execute positioned ~ ~ ~-1 unless entity @e[type=minecraft:marker,tag=timber_cap,distance=...1,sort=arbitrary,limit=1] if predicate timber:block/cap run function timber:algorithm/fungus/leaves/destroy -execute positioned ~1 ~ ~ unless entity @e[type=minecraft:marker,tag=timber_cap,distance=...1,sort=arbitrary,limit=1] if predicate timber:block/cap run function timber:algorithm/fungus/leaves/destroy -execute positioned ~-1 ~ ~ unless entity @e[type=minecraft:marker,tag=timber_cap,distance=...1,sort=arbitrary,limit=1] if predicate timber:block/cap run function timber:algorithm/fungus/leaves/destroy -execute positioned ~ ~1 ~ unless entity @e[type=minecraft:marker,tag=timber_cap,distance=...1,sort=arbitrary,limit=1] if predicate timber:block/cap run function timber:algorithm/fungus/leaves/destroy -execute positioned ~ ~-1 ~ unless entity @e[type=minecraft:marker,tag=timber_cap,distance=...1,sort=arbitrary,limit=1] if predicate timber:block/cap run function timber:algorithm/fungus/leaves/destroy - -execute positioned ~ ~-1 ~1 unless entity @e[type=minecraft:marker,tag=timber_cap,distance=...1,sort=arbitrary,limit=1] if predicate timber:block/cap run function timber:algorithm/fungus/leaves/destroy -execute positioned ~ ~-1 ~-1 unless entity @e[type=minecraft:marker,tag=timber_cap,distance=...1,sort=arbitrary,limit=1] if predicate timber:block/cap run function timber:algorithm/fungus/leaves/destroy -execute positioned ~1 ~-1 ~ unless entity @e[type=minecraft:marker,tag=timber_cap,distance=...1,sort=arbitrary,limit=1] if predicate timber:block/cap run function timber:algorithm/fungus/leaves/destroy -execute positioned ~-1 ~-1 ~ unless entity @e[type=minecraft:marker,tag=timber_cap,distance=...1,sort=arbitrary,limit=1] if predicate timber:block/cap run function timber:algorithm/fungus/leaves/destroy - -execute positioned ~1 ~-1 ~1 unless entity @e[type=minecraft:marker,tag=timber_cap,distance=...1,sort=arbitrary,limit=1] if predicate timber:block/cap run function timber:algorithm/fungus/leaves/destroy -execute positioned ~-1 ~-1 ~-1 unless entity @e[type=minecraft:marker,tag=timber_cap,distance=...1,sort=arbitrary,limit=1] if predicate timber:block/cap run function timber:algorithm/fungus/leaves/destroy -execute positioned ~1 ~-1 ~-1 unless entity @e[type=minecraft:marker,tag=timber_cap,distance=...1,sort=arbitrary,limit=1] if predicate timber:block/cap run function timber:algorithm/fungus/leaves/destroy -execute positioned ~-1 ~-1 ~1 unless entity @e[type=minecraft:marker,tag=timber_cap,distance=...1,sort=arbitrary,limit=1] if predicate timber:block/cap run function timber:algorithm/fungus/leaves/destroy \ No newline at end of file diff --git a/18-41/data/timber/functions/algorithm/fungus/run.mcfunction b/18-41/data/timber/functions/algorithm/fungus/run.mcfunction deleted file mode 100644 index 6db2dbe..0000000 --- a/18-41/data/timber/functions/algorithm/fungus/run.mcfunction +++ /dev/null @@ -1,5 +0,0 @@ -# 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] HandItems[0] 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] \ No newline at end of file diff --git a/18-41/data/timber/functions/algorithm/fungus/search.mcfunction b/18-41/data/timber/functions/algorithm/fungus/search.mcfunction deleted file mode 100644 index 07e10c9..0000000 --- a/18-41/data/timber/functions/algorithm/fungus/search.mcfunction +++ /dev/null @@ -1,24 +0,0 @@ -# search for next log -execute positioned ~ ~1 ~ if predicate timber:block/stem unless entity @e[type=minecraft:marker,tag=timber_stem,distance=...1,sort=arbitrary,limit=1] run function timber:algorithm/fungus/chop -execute positioned ~ ~1 ~1 if predicate timber:block/stem unless entity @e[type=minecraft:marker,tag=timber_stem,distance=...1,sort=arbitrary,limit=1] run function timber:algorithm/fungus/chop -execute positioned ~ ~1 ~-1 if predicate timber:block/stem unless entity @e[type=minecraft:marker,tag=timber_stem,distance=...1,sort=arbitrary,limit=1] run function timber:algorithm/fungus/chop -execute positioned ~1 ~1 ~ if predicate timber:block/stem unless entity @e[type=minecraft:marker,tag=timber_stem,distance=...1,sort=arbitrary,limit=1] run function timber:algorithm/fungus/chop -execute positioned ~1 ~1 ~1 if predicate timber:block/stem unless entity @e[type=minecraft:marker,tag=timber_stem,distance=...1,sort=arbitrary,limit=1] run function timber:algorithm/fungus/chop -execute positioned ~1 ~1 ~-1 if predicate timber:block/stem unless entity @e[type=minecraft:marker,tag=timber_stem,distance=...1,sort=arbitrary,limit=1] run function timber:algorithm/fungus/chop -execute positioned ~-1 ~1 ~ if predicate timber:block/stem unless entity @e[type=minecraft:marker,tag=timber_stem,distance=...1,sort=arbitrary,limit=1] run function timber:algorithm/fungus/chop -execute positioned ~-1 ~1 ~1 if predicate timber:block/stem unless entity @e[type=minecraft:marker,tag=timber_stem,distance=...1,sort=arbitrary,limit=1] run function timber:algorithm/fungus/chop -execute positioned ~-1 ~1 ~-1 if predicate timber:block/stem unless entity @e[type=minecraft:marker,tag=timber_stem,distance=...1,sort=arbitrary,limit=1] run function timber:algorithm/fungus/chop - -execute positioned ~ ~ ~1 if predicate timber:block/stem unless entity @e[type=minecraft:marker,tag=timber_stem,distance=...1,sort=arbitrary,limit=1] run function timber:algorithm/fungus/chop -execute positioned ~ ~ ~-1 if predicate timber:block/stem unless entity @e[type=minecraft:marker,tag=timber_stem,distance=...1,sort=arbitrary,limit=1] run function timber:algorithm/fungus/chop -execute positioned ~1 ~ ~ if predicate timber:block/stem unless entity @e[type=minecraft:marker,tag=timber_stem,distance=...1,sort=arbitrary,limit=1] run function timber:algorithm/fungus/chop -execute positioned ~1 ~ ~1 if predicate timber:block/stem unless entity @e[type=minecraft:marker,tag=timber_stem,distance=...1,sort=arbitrary,limit=1] run function timber:algorithm/fungus/chop -execute positioned ~1 ~ ~-1 if predicate timber:block/stem unless entity @e[type=minecraft:marker,tag=timber_stem,distance=...1,sort=arbitrary,limit=1] run function timber:algorithm/fungus/chop -execute positioned ~-1 ~ ~ if predicate timber:block/stem unless entity @e[type=minecraft:marker,tag=timber_stem,distance=...1,sort=arbitrary,limit=1] run function timber:algorithm/fungus/chop -execute positioned ~-1 ~ ~1 if predicate timber:block/stem unless entity @e[type=minecraft:marker,tag=timber_stem,distance=...1,sort=arbitrary,limit=1] run function timber:algorithm/fungus/chop -execute positioned ~-1 ~ ~-1 if predicate timber:block/stem unless entity @e[type=minecraft:marker,tag=timber_stem,distance=...1,sort=arbitrary,limit=1] run function timber:algorithm/fungus/chop - -execute positioned ~ ~2 ~ if predicate timber:block/stem unless entity @e[type=minecraft:marker,tag=timber_stem,distance=...1,sort=arbitrary,limit=1] run function timber:algorithm/fungus/chop - -# search for next log downwards -execute if score chop_down timber matches 1.. run function timber:algorithm/fungus/search_down \ No newline at end of file diff --git a/18-41/data/timber/functions/algorithm/fungus/search_down.mcfunction b/18-41/data/timber/functions/algorithm/fungus/search_down.mcfunction deleted file mode 100644 index a9edfb2..0000000 --- a/18-41/data/timber/functions/algorithm/fungus/search_down.mcfunction +++ /dev/null @@ -1,10 +0,0 @@ -# search for next log downwards -execute positioned ~ ~-1 ~ if predicate timber:block/stem unless entity @e[type=minecraft:marker,tag=timber_stem,distance=...1,sort=arbitrary,limit=1] run function timber:algorithm/fungus/chop -execute positioned ~ ~-1 ~1 if predicate timber:block/stem unless entity @e[type=minecraft:marker,tag=timber_stem,distance=...1,sort=arbitrary,limit=1] run function timber:algorithm/fungus/chop -execute positioned ~ ~-1 ~-1 if predicate timber:block/stem unless entity @e[type=minecraft:marker,tag=timber_stem,distance=...1,sort=arbitrary,limit=1] run function timber:algorithm/fungus/chop -execute positioned ~1 ~-1 ~ if predicate timber:block/stem unless entity @e[type=minecraft:marker,tag=timber_stem,distance=...1,sort=arbitrary,limit=1] run function timber:algorithm/fungus/chop -execute positioned ~1 ~-1 ~1 if predicate timber:block/stem unless entity @e[type=minecraft:marker,tag=timber_stem,distance=...1,sort=arbitrary,limit=1] run function timber:algorithm/fungus/chop -execute positioned ~1 ~-1 ~-1 if predicate timber:block/stem unless entity @e[type=minecraft:marker,tag=timber_stem,distance=...1,sort=arbitrary,limit=1] run function timber:algorithm/fungus/chop -execute positioned ~-1 ~-1 ~ if predicate timber:block/stem unless entity @e[type=minecraft:marker,tag=timber_stem,distance=...1,sort=arbitrary,limit=1] run function timber:algorithm/fungus/chop -execute positioned ~-1 ~-1 ~1 if predicate timber:block/stem unless entity @e[type=minecraft:marker,tag=timber_stem,distance=...1,sort=arbitrary,limit=1] run function timber:algorithm/fungus/chop -execute positioned ~-1 ~-1 ~-1 if predicate timber:block/stem unless entity @e[type=minecraft:marker,tag=timber_stem,distance=...1,sort=arbitrary,limit=1] run function timber:algorithm/fungus/chop \ No newline at end of file diff --git a/18-41/data/timber/functions/algorithm/fungus/validate_cap.mcfunction b/18-41/data/timber/functions/algorithm/fungus/validate_cap.mcfunction deleted file mode 100644 index e41d9b6..0000000 --- a/18-41/data/timber/functions/algorithm/fungus/validate_cap.mcfunction +++ /dev/null @@ -1,6 +0,0 @@ -# mark leaf that have been checked -execute positioned ~ ~ ~1 unless entity @e[type=minecraft:marker,tag=timber_leaves_found,distance=...1,sort=nearest,limit=1] if predicate timber:block/cap run summon marker ~ ~ ~ {Tags:["timber_leaves_found"]} -execute positioned ~ ~ ~-1 unless entity @e[type=minecraft:marker,tag=timber_leaves_found,distance=...1,sort=nearest,limit=1] if predicate timber:block/cap run summon marker ~ ~ ~ {Tags:["timber_leaves_found"]} -execute positioned ~1 ~ ~ unless entity @e[type=minecraft:marker,tag=timber_leaves_found,distance=...1,sort=nearest,limit=1] if predicate timber:block/cap run summon marker ~ ~ ~ {Tags:["timber_leaves_found"]} -execute positioned ~-1 ~ ~ unless entity @e[type=minecraft:marker,tag=timber_leaves_found,distance=...1,sort=nearest,limit=1] if predicate timber:block/cap run summon marker ~ ~ ~ {Tags:["timber_leaves_found"]} -execute positioned ~ ~ ~ unless entity @e[type=minecraft:marker,tag=timber_leaves_found,distance=...1,sort=nearest,limit=1] if predicate timber:block/cap run summon marker ~ ~ ~ {Tags:["timber_leaves_found"]} \ No newline at end of file diff --git a/18-41/data/timber/functions/algorithm/tree/chop.mcfunction b/18-41/data/timber/functions/algorithm/tree/chop.mcfunction deleted file mode 100644 index f3c591f..0000000 --- a/18-41/data/timber/functions/algorithm/tree/chop.mcfunction +++ /dev/null @@ -1,29 +0,0 @@ -# resets -scoreboard players set durability_okay timber 1 - -# keep track of tree size -scoreboard players add tree_size timber 1 - -# wear out tool -function timber:tool/durability_count - -# tool durability check -execute if score stop_chopping timber matches 1.. unless score unbreakable timber matches 1 run function timber:tool/durability_check - -# mark leaf that have been checked -execute positioned ~ ~ ~1 unless entity @e[type=minecraft:marker,tag=timber_leaves_found,distance=...1,sort=nearest,limit=1] if predicate timber:block/leaf run summon marker ~ ~ ~ {Tags:["timber_leaves_found"]} -execute positioned ~ ~ ~-1 unless entity @e[type=minecraft:marker,tag=timber_leaves_found,distance=...1,sort=nearest,limit=1] if predicate timber:block/leaf run summon marker ~ ~ ~ {Tags:["timber_leaves_found"]} -execute positioned ~1 ~ ~ unless entity @e[type=minecraft:marker,tag=timber_leaves_found,distance=...1,sort=nearest,limit=1] if predicate timber:block/leaf run summon marker ~ ~ ~ {Tags:["timber_leaves_found"]} -execute positioned ~-1 ~ ~ unless entity @e[type=minecraft:marker,tag=timber_leaves_found,distance=...1,sort=nearest,limit=1] if predicate timber:block/leaf run summon marker ~ ~ ~ {Tags:["timber_leaves_found"]} -execute positioned ~ ~1 ~ unless entity @e[type=minecraft:marker,tag=timber_leaves_found,distance=...1,sort=nearest,limit=1] if predicate timber:block/leaf run summon marker ~ ~ ~ {Tags:["timber_leaves_found"]} -execute positioned ~ ~-1 ~ unless entity @e[type=minecraft:marker,tag=timber_leaves_found,distance=...1,sort=nearest,limit=1] if predicate timber:block/leaf run summon marker ~ ~ ~ {Tags:["timber_leaves_found"]} - -# mark block that will get destroyed -execute if score durability_okay timber matches 1.. if score tree_size timber < max_tree_size timber run summon marker ~ ~ ~ {Tags:["timber_log"]} - -# search for next log/root -execute if score durability_okay timber matches 1.. if score tree_size timber < max_tree_size timber run function timber:algorithm/tree/search_1 - -# destroy leaves -execute if score destroy_leaves timber matches 1.. run scoreboard players set leaf_distance timber 0 -execute if score destroy_leaves timber matches 1.. run function timber:algorithm/tree/leaves/search \ No newline at end of file diff --git a/18-41/data/timber/functions/algorithm/tree/chop_roots.mcfunction b/18-41/data/timber/functions/algorithm/tree/chop_roots.mcfunction deleted file mode 100644 index 0b57e1e..0000000 --- a/18-41/data/timber/functions/algorithm/tree/chop_roots.mcfunction +++ /dev/null @@ -1,17 +0,0 @@ -# resets -scoreboard players set durability_okay timber 1 - -# keep track of tree size -scoreboard players add tree_size timber 1 - -# wear out tool -function timber:tool/durability_count - -# tool durability check -execute if score stop_chopping timber matches 1.. unless score unbreakable timber matches 1 run function timber:tool/durability_check - -# mark block that will get destroyed -execute if score durability_okay timber matches 1.. if score tree_size timber < max_tree_size timber run summon marker ~ ~ ~ {Tags:["timber_root"]} - -# search for next log/root -execute if score durability_okay timber matches 1.. if score tree_size timber < max_tree_size timber run function timber:algorithm/tree/search_1 \ No newline at end of file diff --git a/18-41/data/timber/functions/algorithm/tree/leaves/destroy.mcfunction b/18-41/data/timber/functions/algorithm/tree/leaves/destroy.mcfunction deleted file mode 100644 index 500641f..0000000 --- a/18-41/data/timber/functions/algorithm/tree/leaves/destroy.mcfunction +++ /dev/null @@ -1,8 +0,0 @@ -# get leaf distance (in score leaf_distance timber) -function timber:algorithm/tree/leaves/get_distance - -# decide if leaf is closer to the current tree then mark it so that it will get destroyed -execute if score leaf_distance_old timber < leaf_distance timber run summon marker ~ ~ ~ {Tags:["timber_leaf"]} - -# search for next leaf -execute if score leaf_distance_old timber < leaf_distance timber run function timber:algorithm/tree/leaves/search \ No newline at end of file diff --git a/18-41/data/timber/functions/algorithm/tree/leaves/get_distance.mcfunction b/18-41/data/timber/functions/algorithm/tree/leaves/get_distance.mcfunction deleted file mode 100644 index ece384e..0000000 --- a/18-41/data/timber/functions/algorithm/tree/leaves/get_distance.mcfunction +++ /dev/null @@ -1,17 +0,0 @@ -scoreboard players set leaf_distance timber 0 -execute if block ~ ~ ~ #minecraft:leaves[distance=1] run scoreboard players set leaf_distance timber 1 -execute if block ~ ~ ~ #minecraft:leaves[distance=2] run scoreboard players set leaf_distance timber 2 -execute if block ~ ~ ~ #minecraft:leaves[distance=3] run scoreboard players set leaf_distance timber 3 -execute if block ~ ~ ~ #minecraft:leaves[distance=4] run scoreboard players set leaf_distance timber 4 -execute if block ~ ~ ~ #minecraft:leaves[distance=5] run scoreboard players set leaf_distance timber 5 -execute if block ~ ~ ~ #minecraft:leaves[distance=6] run scoreboard players set leaf_distance timber 6 -execute if block ~ ~ ~ #minecraft:leaves[distance=7] run scoreboard players set leaf_distance timber 7 -execute if block ~ ~ ~ #minecraft:leaves[distance=8] run scoreboard players set leaf_distance timber 8 -execute if block ~ ~ ~ #minecraft:leaves[distance=9] run scoreboard players set leaf_distance timber 9 -execute if block ~ ~ ~ #minecraft:leaves[distance=10] run scoreboard players set leaf_distance timber 10 -execute if block ~ ~ ~ #minecraft:leaves[distance=11] run scoreboard players set leaf_distance timber 11 -execute if block ~ ~ ~ #minecraft:leaves[distance=12] run scoreboard players set leaf_distance timber 12 -execute if block ~ ~ ~ #minecraft:leaves[distance=13] run scoreboard players set leaf_distance timber 13 -execute if block ~ ~ ~ #minecraft:leaves[distance=14] run scoreboard players set leaf_distance timber 14 -# always destroy mangrove sapling -execute if block ~ ~ ~ minecraft:mangrove_propagule run scoreboard players set leaf_distance timber 15 \ No newline at end of file diff --git a/18-41/data/timber/functions/algorithm/tree/leaves/search.mcfunction b/18-41/data/timber/functions/algorithm/tree/leaves/search.mcfunction deleted file mode 100644 index 13bbd5e..0000000 --- a/18-41/data/timber/functions/algorithm/tree/leaves/search.mcfunction +++ /dev/null @@ -1,17 +0,0 @@ -# save leaves distance tag at its position -summon marker ~ ~ ~ {Tags:["timber_leaf_distance"]} -scoreboard players operation @e[type=minecraft:marker,tag=timber_leaf_distance,distance=...1,sort=arbitrary,limit=1] timber = leaf_distance timber - -# load leaves distance tag and search for next leaf -scoreboard players operation leaf_distance_old timber = @e[type=minecraft:marker,tag=timber_leaf_distance,distance=...1,sort=arbitrary,limit=1] timber -execute positioned ~ ~ ~1 unless entity @e[type=minecraft:marker,tag=timber_leaf_distance,distance=...1,sort=arbitrary,limit=1] if predicate timber:block/leaf run function timber:algorithm/tree/leaves/destroy -scoreboard players operation leaf_distance_old timber = @e[type=minecraft:marker,tag=timber_leaf_distance,distance=...1,sort=arbitrary,limit=1] timber -execute positioned ~ ~ ~-1 unless entity @e[type=minecraft:marker,tag=timber_leaf_distance,distance=...1,sort=arbitrary,limit=1] if predicate timber:block/leaf run function timber:algorithm/tree/leaves/destroy -scoreboard players operation leaf_distance_old timber = @e[type=minecraft:marker,tag=timber_leaf_distance,distance=...1,sort=arbitrary,limit=1] timber -execute positioned ~1 ~ ~ unless entity @e[type=minecraft:marker,tag=timber_leaf_distance,distance=...1,sort=arbitrary,limit=1] if predicate timber:block/leaf run function timber:algorithm/tree/leaves/destroy -scoreboard players operation leaf_distance_old timber = @e[type=minecraft:marker,tag=timber_leaf_distance,distance=...1,sort=arbitrary,limit=1] timber -execute positioned ~-1 ~ ~ unless entity @e[type=minecraft:marker,tag=timber_leaf_distance,distance=...1,sort=arbitrary,limit=1] if predicate timber:block/leaf run function timber:algorithm/tree/leaves/destroy -scoreboard players operation leaf_distance_old timber = @e[type=minecraft:marker,tag=timber_leaf_distance,distance=...1,sort=arbitrary,limit=1] timber -execute positioned ~ ~1 ~ unless entity @e[type=minecraft:marker,tag=timber_leaf_distance,distance=...1,sort=arbitrary,limit=1] if predicate timber:block/leaf run function timber:algorithm/tree/leaves/destroy -scoreboard players operation leaf_distance_old timber = @e[type=minecraft:marker,tag=timber_leaf_distance,distance=...1,sort=arbitrary,limit=1] timber -execute positioned ~ ~-1 ~ unless entity @e[type=minecraft:marker,tag=timber_leaf_distance,distance=...1,sort=arbitrary,limit=1] if predicate timber:block/leaf run function timber:algorithm/tree/leaves/destroy \ No newline at end of file diff --git a/18-41/data/timber/functions/algorithm/tree/run.mcfunction b/18-41/data/timber/functions/algorithm/tree/run.mcfunction deleted file mode 100644 index 172c583..0000000 --- a/18-41/data/timber/functions/algorithm/tree/run.mcfunction +++ /dev/null @@ -1,6 +0,0 @@ -# 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] HandItems[0] 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 -execute if score start_chop_on_root timber matches 1.. if entity @e[type=minecraft:armor_stand,tag=timber_item_check,distance=...1,sort=arbitrary,limit=1,predicate=timber:item/root] run function timber:algorithm/tree/chop_roots -kill @e[type=minecraft:armor_stand,tag=timber_item_check,distance=...1,sort=arbitrary,limit=1] diff --git a/18-41/data/timber/functions/algorithm/tree/search_1.mcfunction b/18-41/data/timber/functions/algorithm/tree/search_1.mcfunction deleted file mode 100644 index 020d7eb..0000000 --- a/18-41/data/timber/functions/algorithm/tree/search_1.mcfunction +++ /dev/null @@ -1,24 +0,0 @@ -# search for next log -execute positioned ~ ~1 ~ run function timber:algorithm/tree/search_2 -execute positioned ~ ~1 ~1 run function timber:algorithm/tree/search_2 -execute positioned ~ ~1 ~-1 run function timber:algorithm/tree/search_2 -execute positioned ~1 ~1 ~ run function timber:algorithm/tree/search_2 -execute positioned ~1 ~1 ~1 run function timber:algorithm/tree/search_2 -execute positioned ~1 ~1 ~-1 run function timber:algorithm/tree/search_2 -execute positioned ~-1 ~1 ~ run function timber:algorithm/tree/search_2 -execute positioned ~-1 ~1 ~1 run function timber:algorithm/tree/search_2 -execute positioned ~-1 ~1 ~-1 run function timber:algorithm/tree/search_2 - -execute positioned ~ ~ ~1 run function timber:algorithm/tree/search_2 -execute positioned ~ ~ ~-1 run function timber:algorithm/tree/search_2 -execute positioned ~1 ~ ~ run function timber:algorithm/tree/search_2 -execute positioned ~1 ~ ~1 run function timber:algorithm/tree/search_2 -execute positioned ~1 ~ ~-1 run function timber:algorithm/tree/search_2 -execute positioned ~-1 ~ ~ run function timber:algorithm/tree/search_2 -execute positioned ~-1 ~ ~1 run function timber:algorithm/tree/search_2 -execute positioned ~-1 ~ ~-1 run function timber:algorithm/tree/search_2 - -# search for next log downwards -execute if score chop_down timber matches 1.. run function timber:algorithm/tree/search_down -# search for roots downwards -execute unless score chop_down timber matches 1.. if score destroy_roots timber matches 1.. if entity @e[type=minecraft:marker,tag=timber_root,distance=...1,sort=arbitrary,limit=1] run function timber:algorithm/tree/search_down diff --git a/18-41/data/timber/functions/algorithm/tree/search_2.mcfunction b/18-41/data/timber/functions/algorithm/tree/search_2.mcfunction deleted file mode 100644 index 7f48c20..0000000 --- a/18-41/data/timber/functions/algorithm/tree/search_2.mcfunction +++ /dev/null @@ -1,4 +0,0 @@ -# if log -execute if predicate timber:block/log unless entity @e[type=minecraft:marker,tag=timber_log,distance=...1,sort=arbitrary,limit=1] run function timber:algorithm/tree/chop -# if root -execute if block ~ ~ ~ minecraft:mangrove_roots unless entity @e[type=minecraft:marker,tag=timber_root,distance=...1,sort=arbitrary,limit=1] run function timber:algorithm/tree/chop_roots diff --git a/18-41/data/timber/functions/algorithm/tree/search_down.mcfunction b/18-41/data/timber/functions/algorithm/tree/search_down.mcfunction deleted file mode 100644 index aee97f5..0000000 --- a/18-41/data/timber/functions/algorithm/tree/search_down.mcfunction +++ /dev/null @@ -1,10 +0,0 @@ -# search for next log downwards -execute positioned ~ ~-1 ~ run function timber:algorithm/tree/search_2 -execute positioned ~ ~-1 ~1 run function timber:algorithm/tree/search_2 -execute positioned ~ ~-1 ~-1 run function timber:algorithm/tree/search_2 -execute positioned ~1 ~-1 ~ run function timber:algorithm/tree/search_2 -execute positioned ~1 ~-1 ~1 run function timber:algorithm/tree/search_2 -execute positioned ~1 ~-1 ~-1 run function timber:algorithm/tree/search_2 -execute positioned ~-1 ~-1 ~ run function timber:algorithm/tree/search_2 -execute positioned ~-1 ~-1 ~1 run function timber:algorithm/tree/search_2 -execute positioned ~-1 ~-1 ~-1 run function timber:algorithm/tree/search_2 \ No newline at end of file diff --git a/18-41/data/timber/functions/autoplant/loop.mcfunction b/18-41/data/timber/functions/autoplant/loop.mcfunction deleted file mode 100644 index f765e10..0000000 --- a/18-41/data/timber/functions/autoplant/loop.mcfunction +++ /dev/null @@ -1,5 +0,0 @@ -# Loop -execute if score plant_sapling timber matches 1.. run schedule function timber:autoplant/loop 2s replace - -# plant sapling process -execute as @e[type=minecraft:item,tag=!timber_checked,tag=!global.ignore,tag=!global.ignore.kill,sort=random,limit=20,nbt={OnGround:1b}] at @s if block ~ ~-0.5 ~ #minecraft:dirt if block ~ ~0.5 ~ minecraft:air at @s run function timber:autoplant/validate \ No newline at end of file diff --git a/18-41/data/timber/functions/autoplant/mud_fix.mcfunction b/18-41/data/timber/functions/autoplant/mud_fix.mcfunction deleted file mode 100644 index cffee47..0000000 --- a/18-41/data/timber/functions/autoplant/mud_fix.mcfunction +++ /dev/null @@ -1,2 +0,0 @@ -execute at @e[type=minecraft:marker,tag=timber_mud] run setblock ~ ~ ~ minecraft:mud -kill @e[type=minecraft:marker,tag=timber_mud] \ No newline at end of file diff --git a/18-41/data/timber/functions/autoplant/plant.mcfunction b/18-41/data/timber/functions/autoplant/plant.mcfunction deleted file mode 100644 index d701739..0000000 --- a/18-41/data/timber/functions/autoplant/plant.mcfunction +++ /dev/null @@ -1,18 +0,0 @@ -# replace item-sapling with block-sapling (special case for mud, because fallingblock get destroyed. 0.125 is the height when you sink into the mud) -execute unless block ~ ~ ~ minecraft:air run summon marker ~ ~ ~ {Tags:["timber_mud","global.ignore"]} -execute unless block ~ ~ ~ minecraft:air run schedule function timber:autoplant/mud_fix 1t -execute unless block ~ ~ ~ minecraft:air run setblock ~ ~ ~ minecraft:muddy_mangrove_roots -summon minecraft:falling_block ~ ~0.125 ~ {BlockState:{Name:"minecraft:barrier"},Time:1,DropItem:0b,Tags:["timber_item_to_block"]} -execute positioned ~ ~0.125 ~ run data modify entity @e[type=minecraft:falling_block,tag=timber_item_to_block,distance=...1,sort=arbitrary,limit=1] BlockState.Name set from entity @s Item.id - -# on stacks -1 -execute store result score @s timber run data get entity @s Item.count -scoreboard players remove @s timber 1 -execute if score @s timber matches ..0 run kill @s -execute if score @s timber matches 1.. store result entity @s Item.count byte 1 run scoreboard players get @s timber -scoreboard players reset @s timber -# cheap custom server fix -execute if score not_vanilla timber matches 1 run kill @s - -# sapling will be checked every time -tag @s remove timber_checked \ No newline at end of file diff --git a/18-41/data/timber/functions/autoplant/validate.mcfunction b/18-41/data/timber/functions/autoplant/validate.mcfunction deleted file mode 100644 index e84bccf..0000000 --- a/18-41/data/timber/functions/autoplant/validate.mcfunction +++ /dev/null @@ -1,8 +0,0 @@ -# don't check items twice (except saplings, look in plant.mcfunction) -tag @s add timber_checked - -# check if item is in tag #minecraft:sapling -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] HandItems[0] set from entity @s Item -execute if entity @e[type=minecraft:armor_stand,tag=timber_item_check,distance=...1,sort=arbitrary,limit=1,predicate=timber:item/sapling] run function timber:autoplant/plant -kill @e[type=minecraft:armor_stand,tag=timber_item_check,distance=...1,sort=arbitrary,limit=1] \ No newline at end of file diff --git a/18-41/data/timber/functions/help.mcfunction b/18-41/data/timber/functions/help.mcfunction deleted file mode 100644 index 8f04f36..0000000 --- a/18-41/data/timber/functions/help.mcfunction +++ /dev/null @@ -1,25 +0,0 @@ -tellraw @s ["",{"text":"\u00A7m ","color":"dark_gray"}] - -tellraw @s ["",{"text":" Timber Datapack"}] - -tellraw @s ["",{"text":"\u00A7m ","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","clickEvent":{"action":"suggest_command","value":"/trigger TimberToggle"}},{"text":" to individually turn the datapack on or off."}] - -tellraw @s [""] - -tellraw @s [""," ",{"text":"[click here to check for new updates]","color":"green","clickEvent":{"action":"open_url","value":"https://github.com/Moggla/Timber-Datapack/releases"}}] - -tellraw @s [""] - -tellraw @s [""," ",{"text":"[click here to see the settings]","color":"gold","clickEvent":{"action":"run_command","value":"/function timber:settings/settings1_click"}}] - -tellraw @s ["",{"text":"\u00A7m ","color":"dark_gray"}] - -function timber:settings/end_of_message \ No newline at end of file diff --git a/18-41/data/timber/functions/init.mcfunction b/18-41/data/timber/functions/init.mcfunction deleted file mode 100644 index 1d2cbf0..0000000 --- a/18-41/data/timber/functions/init.mcfunction +++ /dev/null @@ -1,39 +0,0 @@ -# longer maxCommandChainLength -gamerule maxCommandChainLength 1000000000 - -# create scoreboards -scoreboard objectives add timber_w_axe minecraft.used:minecraft.wooden_axe -scoreboard objectives add timber_s_axe minecraft.used:minecraft.stone_axe -scoreboard objectives add timber_i_axe minecraft.used:minecraft.iron_axe -scoreboard objectives add timber_g_axe minecraft.used:minecraft.golden_axe -scoreboard objectives add timber_d_axe minecraft.used:minecraft.diamond_axe -scoreboard objectives add timber_n_axe minecraft.used:minecraft.netherite_axe -scoreboard objectives add timber dummy -scoreboard objectives add TimberToggle trigger {"text":"Timber Toggle","color":"#724E21"} -scoreboard objectives add timber_disabled dummy -scoreboard objectives add timber_prsistent dummy - -# non-overriding default values -function timber:settings/default_values -function timber:tool/durability_max -scoreboard players set running timber 0 - -# start optional loops -execute if score plant_sapling timber matches 1.. run function timber:autoplant/loop -execute if score slow_chop timber matches 1.. run function timber:slow_chop/loop - -# check loottable compatibility of mushroom stem -setblock ~ 255 ~ minecraft:chest -setblock ~ 255 ~1 minecraft:mushroom_stem -loot insert ~ 255 ~ mine ~ 255 ~1 minecraft:diamond_axe -execute unless data block ~ 255 ~ Items[{id:"minecraft:knowledge_book",components:{"minecraft:custom_data":{Tags:["timber_location"]}}}] run tellraw @a[tag=!noTimberWarning] ["",{"text":"Timber Datapack Warning: ","color":"red"},{"text":"Incompatibility with the mushroom_stem loottable of another datapack!"}] -fill ~-1 255 ~-1 ~1 255 ~1 minecraft:air -execute store result score doTileDrops timber run gamerule doTileDrops -execute if score doTileDrops timber matches 0 run tellraw @a[tag=!noTimberWarning] ["",{"text":"Timber Datapack Warning: ","color":"red"},{"text":"This datapack only works when gamerule doTileDrops is set to true!"}] - -# Getting the game version and checking if it is compatible with the datapack https://minecraft.fandom.com/wiki/Data_version -execute store result score game_version timber run data get entity @r DataVersion -execute if score game_version timber matches ..3442 run tellraw @a[tag=!noTimberWarning] ["",{"text":"Timber Datapack Warning: ","color":"red"},{"text":"This datapack is not compatible with all the versions before 1.20!"}] - -# Checking if the server uses a different jar from the vanilla one -function timber:utils/check_server \ No newline at end of file diff --git a/18-41/data/timber/functions/main.mcfunction b/18-41/data/timber/functions/main.mcfunction deleted file mode 100644 index 02ef309..0000000 --- a/18-41/data/timber/functions/main.mcfunction +++ /dev/null @@ -1,11 +0,0 @@ -# loop (not in minecraft:tick in order to stop it after uninstall) -schedule function timber:main 1t - -# if any kind of axe is used -execute as @a[predicate=timber:used_axe,tag=!global.ignore] at @s run function timber:utils/check_max_command_chain_length - -# toggle timber datapack per player -execute as @a[scores={TimberToggle=1..},tag=!global.ignore] run function timber:settings/toggle/timber - -# reset -scoreboard players enable @a TimberToggle \ No newline at end of file diff --git a/18-41/data/timber/functions/run.mcfunction b/18-41/data/timber/functions/run.mcfunction deleted file mode 100644 index 23149f8..0000000 --- a/18-41/data/timber/functions/run.mcfunction +++ /dev/null @@ -1,46 +0,0 @@ -# reset -scoreboard players set leaves_found timber 0 -scoreboard players set tree_size timber 0 -scoreboard players set tree_type timber 0 - -# load settings to other scoreboard (leaves persistent) -execute unless score persistent timber matches 1.. run scoreboard players set @s timber_prsistent 0 -execute if score persistent timber matches 1.. run scoreboard players set @s timber_prsistent 1 - -# search last broken item (place of tree) and set a marker (limit=1 removed, because carpet on log breaks this) -execute at @e[type=minecraft:item,distance=..7,nbt={Age:0s}] run summon marker ~ ~ ~ {Tags:["timber_tree","global.ignore"]} - -# Enchantments randomizer -scoreboard players set unbreaking timber 0 -execute if entity @s[nbt={SelectedItem:{components:{"minecraft:enchantments":{levels:{"minecraft:unbreaking": 1}}}}}] run scoreboard players set unbreaking timber 1 -execute if entity @s[nbt={SelectedItem:{components:{"minecraft:enchantments":{levels:{"minecraft:unbreaking": 2}}}}}] run scoreboard players set unbreaking timber 2 -execute if entity @s[nbt={SelectedItem:{components:{"minecraft:enchantments":{levels:{"minecraft:unbreaking": 3}}}}}] run scoreboard players set unbreaking timber 3 - -# get durability -function timber:tool/durability_get - -# scan through tree - # tree (limit=1,sort=arbitrary removed, because carpet on log breaks this) - execute if score chop_trees timber matches 1.. at @e[type=minecraft:marker,tag=timber_tree,tag=!timber_slow_chop,distance=..7] run function timber:algorithm/tree/run - execute store result score leaves_found timber if entity @e[type=minecraft:marker,tag=timber_leaves_found] - # if tree is valid - execute if score leaves_found timber >= min_leaves_found timber unless score tree_size timber matches 0 run scoreboard players set tree_type timber 1 - - # fungi (only if not tree already) - execute if score tree_type timber matches 0 if score chop_fungi timber matches 1.. run function timber:run_fungi - -# if tree or fungi is valid (tree = 1 | fungus = 2) -execute unless score tree_type timber matches 0 if score tree_size timber <= max_tree_size timber run function timber:validated - -# remove markers -execute if score chop_fungi timber matches 1.. run kill @e[type=minecraft:item,nbt={Item:{components:{"minecraft:custom_data":{Tags:["timber_location"]}}}}] -execute if score chop_fungi timber matches 1.. run clear @s knowledge_book[minecraft:custom_data={Tags:["timber_location"]}] -kill @e[type=minecraft:marker,tag=timber_tree,tag=!timber_slow_chop] -kill @e[type=minecraft:marker,tag=timber_log,tag=!timber_destroy] -kill @e[type=minecraft:marker,tag=timber_leaf,tag=!timber_destroy] -kill @e[type=minecraft:marker,tag=timber_root,tag=!timber_destroy] -kill @e[type=minecraft:marker,tag=timber_stem,tag=!timber_destroy] -kill @e[type=minecraft:marker,tag=timber_cap,tag=!timber_destroy] -kill @e[type=minecraft:marker,tag=timber_leaves_found] -kill @e[type=minecraft:marker,tag=timber_leaf_distance] -kill @e[type=minecraft:marker,tag=timber_other_stem] \ No newline at end of file diff --git a/18-41/data/timber/functions/run_fungi.mcfunction b/18-41/data/timber/functions/run_fungi.mcfunction deleted file mode 100644 index ff8a737..0000000 --- a/18-41/data/timber/functions/run_fungi.mcfunction +++ /dev/null @@ -1,18 +0,0 @@ -# reset -scoreboard players set tree_size timber 0 -kill @e[type=minecraft:marker,tag=timber_leaves_found] -kill @e[type=minecraft:marker,tag=timber_log,tag=!timber_destroy] -kill @e[type=minecraft:marker,tag=timber_leaf,tag=!timber_destroy] - -# get durability -function timber:tool/durability_get - -# fungi -execute at @e[type=minecraft:marker,tag=timber_tree,tag=!timber_slow_chop,distance=..7,sort=arbitrary,limit=1] run function timber:algorithm/fungus/run -execute store result score leaves_found timber if entity @e[type=minecraft:marker,tag=timber_leaves_found] -# if fungi is valid -execute if score leaves_found timber >= min_leaves_found timber unless score tree_size timber matches 0 run scoreboard players set tree_type timber 2 - -# don't destroy the blocks in a radius of 5 blocks from other stems -execute if score tree_type timber matches 2 run function timber:algorithm/fungus/leaves/find_other_stems -execute if score tree_type timber matches 2 at @e[type=minecraft:marker,tag=timber_other_stem] run kill @e[type=minecraft:marker,tag=timber_cap,distance=..5] \ No newline at end of file diff --git a/18-41/data/timber/functions/settings/default_values.mcfunction b/18-41/data/timber/functions/settings/default_values.mcfunction deleted file mode 100644 index 8800ffc..0000000 --- a/18-41/data/timber/functions/settings/default_values.mcfunction +++ /dev/null @@ -1,28 +0,0 @@ -# non-overriding default values -execute unless score standing timber = standing timber run scoreboard players set standing timber 1 -execute unless score sneaking timber = sneaking timber run scoreboard players set sneaking timber 0 -execute unless score destroy_leaves timber = destroy_leaves timber run scoreboard players set destroy_leaves timber 1 -execute unless score plant_sapling timber = plant_sapling timber run scoreboard players set plant_sapling timber 0 -execute unless score destroy_roots timber = destroy_roots timber run scoreboard players set destroy_roots timber 1 -execute unless score start_chop_on_root timber = start_chop_on_root timber run scoreboard players set start_chop_on_root timber 1 -execute unless score slow_chop timber = slow_chop timber run scoreboard players set slow_chop timber 0 -execute unless score chop_down timber = chop_down timber run scoreboard players set chop_down timber 0 -execute unless score stop_chopping timber = stop_chopping timber run scoreboard players set stop_chopping timber 0 -execute unless score wear_out timber = wear_out timber run scoreboard players set wear_out timber 1 -execute unless score drop_loot timber = drop_loot timber run scoreboard players set drop_loot timber 0 -execute unless score hunger timber = hunger timber run scoreboard players set hunger timber 0 -execute unless score stopsound timber = stopsound timber run scoreboard players set stopsound timber 0 - -execute unless score wooden_axe timber = wooden_axe timber run scoreboard players set wooden_axe timber 1 -execute unless score stone_axe timber = stone_axe timber run scoreboard players set stone_axe timber 1 -execute unless score iron_axe timber = iron_axe timber run scoreboard players set iron_axe timber 1 -execute unless score golden_axe timber = golden_axe timber run scoreboard players set golden_axe timber 1 -execute unless score diamond_axe timber = diamond_axe timber run scoreboard players set diamond_axe timber 1 -execute unless score netherite_axe timber = netherite_axe timber run scoreboard players set netherite_axe timber 1 -execute unless score chop_trees timber = chop_trees timber run scoreboard players set chop_trees timber 1 -execute unless score chop_fungi timber = chop_fungi timber run scoreboard players set chop_fungi timber 0 -execute unless score persistent timber = persistent timber run scoreboard players set persistent timber 0 -execute unless score blocks_per_chop timber = blocks_per_chop timber run scoreboard players set blocks_per_chop timber 1 -execute unless score time_between_chops timber = time_between_chops timber run scoreboard players set time_between_chops timber 1 -execute unless score max_tree_size timber = max_tree_size timber run scoreboard players set max_tree_size timber 555 -execute unless score min_leaves_found timber = min_leaves_found timber run scoreboard players set min_leaves_found timber 5 diff --git a/18-41/data/timber/functions/settings/end_of_message.mcfunction b/18-41/data/timber/functions/settings/end_of_message.mcfunction deleted file mode 100644 index 1d5e211..0000000 --- a/18-41/data/timber/functions/settings/end_of_message.mcfunction +++ /dev/null @@ -1,3 +0,0 @@ -execute store result score sendCommandFeedback timber run gamerule sendCommandFeedback -execute if score sendCommandFeedback timber matches 1 run schedule function timber:settings/reset_gamerule 1t -gamerule sendCommandFeedback false \ No newline at end of file diff --git a/18-41/data/timber/functions/settings/reset_gamerule.mcfunction b/18-41/data/timber/functions/settings/reset_gamerule.mcfunction deleted file mode 100644 index b466492..0000000 --- a/18-41/data/timber/functions/settings/reset_gamerule.mcfunction +++ /dev/null @@ -1 +0,0 @@ -gamerule sendCommandFeedback true \ No newline at end of file diff --git a/18-41/data/timber/functions/settings/settings.mcfunction b/18-41/data/timber/functions/settings/settings.mcfunction deleted file mode 100644 index 42d2588..0000000 --- a/18-41/data/timber/functions/settings/settings.mcfunction +++ /dev/null @@ -1 +0,0 @@ -function timber:settings/settings1 \ No newline at end of file diff --git a/18-41/data/timber/functions/settings/settings1.mcfunction b/18-41/data/timber/functions/settings/settings1.mcfunction deleted file mode 100644 index 140256c..0000000 --- a/18-41/data/timber/functions/settings/settings1.mcfunction +++ /dev/null @@ -1,57 +0,0 @@ -tellraw @s ["",{"text":" "}] -tellraw @s ["",{"text":" "}] -tellraw @s ["",{"text":" "}] -tellraw @s ["",{"text":" "}] - -tellraw @s ["",{"text":"\u00A7m ","color":"dark_gray"}] - -tellraw @s ["",{"text":" Timber "},{"text":"/","color":"gray"},{"text":" Global Settings "},{"text":" < ","clickEvent":{"action":"run_command","value":"/function timber:settings/settings1_click"}},{"text":"1/2"},{"text":" > ","clickEvent":{"action":"run_command","value":"/function timber:settings/settings2_click"}}] - -tellraw @s ["",{"text":"\u00A7m ","color":"dark_gray"}] - -execute if score standing timber matches 1.. run tellraw @s ["",{"text":"[ ✔ ]","color":"green","clickEvent":{"action":"run_command","value":"/function timber:settings/toggle/standing"}},{"text":" Works When Standing"}] -execute unless score standing timber matches 1.. run tellraw @s ["",{"text":"[ ❌ ]","color":"red","clickEvent":{"action":"run_command","value":"/function timber:settings/toggle/standing"}},{"text":" Works When Standing"}] - -execute if score sneaking timber matches 1.. run tellraw @s ["",{"text":"[ ✔ ]","color":"green","clickEvent":{"action":"run_command","value":"/function timber:settings/toggle/sneaking"}},{"text":" Works When Sneaking"}] -execute unless score sneaking timber matches 1.. run tellraw @s ["",{"text":"[ ❌ ]","color":"red","clickEvent":{"action":"run_command","value":"/function timber:settings/toggle/sneaking"}},{"text":" Works When Sneaking"}] - -execute if score destroy_leaves timber matches 1.. run tellraw @s ["",{"text":"[ ✔ ]","color":"green","clickEvent":{"action":"run_command","value":"/function timber:settings/toggle/destroy_leaves"}},{"text":" Destroy Leaves"}] -execute unless score destroy_leaves timber matches 1.. run tellraw @s ["",{"text":"[ ❌ ]","color":"red","clickEvent":{"action":"run_command","value":"/function timber:settings/toggle/destroy_leaves"}},{"text":" Destroy Leaves"}] - -execute if score plant_sapling timber matches 1.. run tellraw @s ["",{"text":"[ ✔ ]","color":"green","clickEvent":{"action":"run_command","value":"/function timber:settings/toggle/plant_sapling"}},{"text":" Auto Plant Saplings","hoverEvent":{"action":"show_text","value":["",{"text":"All kind of saplings laying on the ground will get planted every 2 seconds."},{"text":"\n\nWhen a sapling get placed on mud, it turns into muddy mangrove roots for a fraction of a second due to datapack limitations.","color":"gray"}]}}] -execute unless score plant_sapling timber matches 1.. run tellraw @s ["",{"text":"[ ❌ ]","color":"red","clickEvent":{"action":"run_command","value":"/function timber:settings/toggle/plant_sapling"}},{"text":" Auto Plant Saplings","hoverEvent":{"action":"show_text","value":["",{"text":"All kind of saplings laying on the ground will get planted every 2 seconds."},{"text":"\n\nWhen a sapling get placed on mud, it turns into muddy mangrove roots for a fraction of a second due to datapack limitations.","color":"gray"}]}}] - -execute if score destroy_roots timber matches 1.. run tellraw @s ["",{"text":"[ ✔ ]","color":"green","clickEvent":{"action":"run_command","value":"/function timber:settings/toggle/destroy_roots"}},{"text":" Destroy Roots","hoverEvent":{"action":"show_text","value":["",{"text":"Only root blocks which are not in the ground count."}]}}] -execute unless score destroy_roots timber matches 1.. run tellraw @s ["",{"text":"[ ❌ ]","color":"red","clickEvent":{"action":"run_command","value":"/function timber:settings/toggle/destroy_roots"}},{"text":" Destroy Roots","hoverEvent":{"action":"show_text","value":["",{"text":"Only root blocks which are not in the ground count."}]}}] - -execute if score start_chop_on_root timber matches 1.. run tellraw @s ["",{"text":"[ ✔ ]","color":"green","clickEvent":{"action":"run_command","value":"/function timber:settings/toggle/start_chop_on_root"}},{"text":" Chop Tree When Roots Get Destroyed","hoverEvent":{"action":"show_text","value":["",{"text":"The datapack will chop the tree if you break its root blocks.\nOnly root blocks which are not in the ground count."}]}}] -execute unless score start_chop_on_root timber matches 1.. run tellraw @s ["",{"text":"[ ❌ ]","color":"red","clickEvent":{"action":"run_command","value":"/function timber:settings/toggle/start_chop_on_root"}},{"text":" Chop Tree When Roots Get Destroyed","hoverEvent":{"action":"show_text","value":["",{"text":"The datapack will chop the tree if you break its root blocks.\nOnly root blocks which are not in the ground count."}]}}] - -execute if score slow_chop timber matches 1.. run tellraw @s ["",{"text":"[ ✔ ]","color":"green","clickEvent":{"action":"run_command","value":"/function timber:settings/toggle/slow_chop"}},{"text":" Chop Slowly","hoverEvent":{"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","clickEvent":{"action":"run_command","value":"/function timber:settings/toggle/slow_chop"}},{"text":" Chop Slowly","hoverEvent":{"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","hoverEvent":{"action":"show_text","value":"Can't be enabled when \"Drop Loot Straight into Inventory\" is enabled."}},{"text":" Chop Slowly","hoverEvent":{"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","clickEvent":{"action":"run_command","value":"/function timber:settings/toggle/chop_down"}},{"text":" Enable Chopping Down","hoverEvent":{"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","clickEvent":{"action":"run_command","value":"/function timber:settings/toggle/chop_down"}},{"text":" Enable Chopping Down","hoverEvent":{"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","clickEvent":{"action":"run_command","value":"/function timber:settings/toggle/stop_chopping"}},{"text":" Stop Chopping Once Axe Breaks","hoverEvent":{"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","clickEvent":{"action":"run_command","value":"/function timber:settings/toggle/stop_chopping"}},{"text":" Stop Chopping Once Axe Breaks","hoverEvent":{"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","hoverEvent":{"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","hoverEvent":{"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","clickEvent":{"action":"run_command","value":"/function timber:settings/toggle/wear_out"}},{"text":" Additionally Wear out Tool Depending on Tree Size","hoverEvent":{"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","clickEvent":{"action":"run_command","value":"/function timber:settings/toggle/wear_out"}},{"text":" Additionally Wear out Tool Depending on Tree Size","hoverEvent":{"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","hoverEvent":{"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","hoverEvent":{"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","clickEvent":{"action":"run_command","value":"/function timber:settings/toggle/drop_loot"}},{"text":" Drop Loot Straight into Inventory","hoverEvent":{"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","clickEvent":{"action":"run_command","value":"/function timber:settings/toggle/drop_loot"}},{"text":" Drop Loot Straight into Inventory","hoverEvent":{"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","hoverEvent":{"action":"show_text","value":"Can't be enabled when \"Chop Slowly\" is enabled."}},{"text":" Drop Loot Straight into Inventory","hoverEvent":{"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","clickEvent":{"action":"run_command","value":"/function timber:settings/toggle/hunger"}},{"text":" Give Additional Hunger Effect","hoverEvent":{"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","clickEvent":{"action":"run_command","value":"/function timber:settings/toggle/hunger"}},{"text":" Give Additional Hunger Effect","hoverEvent":{"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","clickEvent":{"action":"run_command","value":"/function timber:settings/toggle/stopsound"}},{"text":" Stop Loud Breaking Noises","hoverEvent":{"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","clickEvent":{"action":"run_command","value":"/function timber:settings/toggle/stopsound"}},{"text":" Stop Loud Breaking Noises","hoverEvent":{"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"}]}}] - -tellraw @s ["",{"text":"\u00A7m ","color":"dark_gray"}] - -function timber:settings/end_of_message \ No newline at end of file diff --git a/18-41/data/timber/functions/settings/settings1_click.mcfunction b/18-41/data/timber/functions/settings/settings1_click.mcfunction deleted file mode 100644 index 64625b3..0000000 --- a/18-41/data/timber/functions/settings/settings1_click.mcfunction +++ /dev/null @@ -1,2 +0,0 @@ -function timber:settings/settings -playsound minecraft:ui.button.click master @s ~ ~ ~ .2 1.6 .2 \ No newline at end of file diff --git a/18-41/data/timber/functions/settings/settings2.mcfunction b/18-41/data/timber/functions/settings/settings2.mcfunction deleted file mode 100644 index 6f1a745..0000000 --- a/18-41/data/timber/functions/settings/settings2.mcfunction +++ /dev/null @@ -1,55 +0,0 @@ -tellraw @s ["",{"text":" "}] -tellraw @s ["",{"text":" "}] -tellraw @s ["",{"text":" "}] -tellraw @s ["",{"text":" "}] - -tellraw @s ["",{"text":"\u00A7m ","color":"dark_gray"}] - -tellraw @s ["",{"text":" Timber "},{"text":"/","color":"gray"},{"text":" Global Settings "},{"text":" < ","clickEvent":{"action":"run_command","value":"/function timber:settings/settings1_click"}},{"text":"2/2"},{"text":" > ","clickEvent":{"action":"run_command","value":"/function timber:settings/settings2_click"}}] - -tellraw @s ["",{"text":"\u00A7m ","color":"dark_gray"}] - -execute if score wooden_axe timber matches 1.. run tellraw @s ["",{"text":"[ ✔ ]","color":"green","clickEvent":{"action":"run_command","value":"/function timber:settings/toggle/wooden_axe"}},{"text":" Enable Wooden Axe"}] -execute unless score wooden_axe timber matches 1.. run tellraw @s ["",{"text":"[ ❌ ]","color":"red","clickEvent":{"action":"run_command","value":"/function timber:settings/toggle/wooden_axe"}},{"text":" Enable Wooden Axe"}] - -execute if score stone_axe timber matches 1.. run tellraw @s ["",{"text":"[ ✔ ]","color":"green","clickEvent":{"action":"run_command","value":"/function timber:settings/toggle/stone_axe"}},{"text":" Enable Stone Axe"}] -execute unless score stone_axe timber matches 1.. run tellraw @s ["",{"text":"[ ❌ ]","color":"red","clickEvent":{"action":"run_command","value":"/function timber:settings/toggle/stone_axe"}},{"text":" Enable Stone Axe"}] - -execute if score iron_axe timber matches 1.. run tellraw @s ["",{"text":"[ ✔ ]","color":"green","clickEvent":{"action":"run_command","value":"/function timber:settings/toggle/iron_axe"}},{"text":" Enable Iron Axe"}] -execute unless score iron_axe timber matches 1.. run tellraw @s ["",{"text":"[ ❌ ]","color":"red","clickEvent":{"action":"run_command","value":"/function timber:settings/toggle/iron_axe"}},{"text":" Enable Iron Axe"}] - -execute if score golden_axe timber matches 1.. run tellraw @s ["",{"text":"[ ✔ ]","color":"green","clickEvent":{"action":"run_command","value":"/function timber:settings/toggle/golden_axe"}},{"text":" Enable Golden Axe"}] -execute unless score golden_axe timber matches 1.. run tellraw @s ["",{"text":"[ ❌ ]","color":"red","clickEvent":{"action":"run_command","value":"/function timber:settings/toggle/golden_axe"}},{"text":" Enable Golden Axe"}] - -execute if score diamond_axe timber matches 1.. run tellraw @s ["",{"text":"[ ✔ ]","color":"green","clickEvent":{"action":"run_command","value":"/function timber:settings/toggle/diamond_axe"}},{"text":" Enable Diamond Axe"}] -execute unless score diamond_axe timber matches 1.. run tellraw @s ["",{"text":"[ ❌ ]","color":"red","clickEvent":{"action":"run_command","value":"/function timber:settings/toggle/diamond_axe"}},{"text":" Enable Diamond Axe"}] - -execute if score netherite_axe timber matches 1.. run tellraw @s ["",{"text":"[ ✔ ]","color":"green","clickEvent":{"action":"run_command","value":"/function timber:settings/toggle/netherite_axe"}},{"text":" Enable Netherite Axe"}] -execute unless score netherite_axe timber matches 1.. run tellraw @s ["",{"text":"[ ❌ ]","color":"red","clickEvent":{"action":"run_command","value":"/function timber:settings/toggle/netherite_axe"}},{"text":" Enable Netherite Axe"}] - -execute if score chop_trees timber matches 1.. run tellraw @s ["",{"text":"[ ✔ ]","color":"green","clickEvent":{"action":"run_command","value":"/function timber:settings/toggle/chop_trees"}},{"text":" Chop Trees","hoverEvent":{"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","clickEvent":{"action":"run_command","value":"/function timber:settings/toggle/chop_trees"}},{"text":" Chop Trees","hoverEvent":{"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","clickEvent":{"action":"run_command","value":"/function timber:settings/toggle/chop_fungi"}},{"text":" Chop Fungi","hoverEvent":{"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","clickEvent":{"action":"run_command","value":"/function timber:settings/toggle/chop_fungi"}},{"text":" Chop Fungi","hoverEvent":{"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 persistent timber matches 1.. run tellraw @s ["",{"text":"[ ✔ ]","color":"green","clickEvent":{"action":"run_command","value":"/function timber:settings/toggle/persistent"}},{"text":" Destroy Player-Placed Trees","hoverEvent":{"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","clickEvent":{"action":"run_command","value":"/function timber:settings/toggle/persistent"}},{"text":" Destroy Player-Placed Trees","hoverEvent":{"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 if score blocks_per_chop timber matches 1 if score slow_chop timber matches 1.. run tellraw @s ["",{"text":"[ ✎ ]","color":"gray","clickEvent":{"action":"suggest_command","value":"/scoreboard players set blocks_per_chop timber "},"hoverEvent":{"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","clickEvent":{"action":"suggest_command","value":"/scoreboard players set blocks_per_chop timber "},"hoverEvent":{"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","hoverEvent":{"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","clickEvent":{"action":"suggest_command","value":"/scoreboard players set time_between_chops timber "},"hoverEvent":{"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","clickEvent":{"action":"suggest_command","value":"/scoreboard players set time_between_chops timber "},"hoverEvent":{"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","hoverEvent":{"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","clickEvent":{"action":"suggest_command","value":"/scoreboard players set max_tree_size timber "},"hoverEvent":{"action":"show_text","value":"Default: 555"}},{"text":" Set Max. Tree Size","hoverEvent":{"action":"show_text","value":"Trees bigger than this set value won't get further processed."}},{"text":" (Currently: ","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","clickEvent":{"action":"suggest_command","value":"/scoreboard players set max_tree_size timber "},"hoverEvent":{"action":"show_text","value":"Default: 555"}},{"text":" Set Max. Tree Size","hoverEvent":{"action":"show_text","value":"Trees bigger than this set value won't get further processed."}},{"text":" (Currently: ","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","clickEvent":{"action":"suggest_command","value":"/scoreboard players set min_leaves_found timber "},"hoverEvent":{"action":"show_text","value":"Default: 5"}},{"text":" Set Min. Leaves to Valid a Tree","hoverEvent":{"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","clickEvent":{"action":"suggest_command","value":"/scoreboard players set min_leaves_found timber "},"hoverEvent":{"action":"show_text","value":"Default: 5"}},{"text":" Set Min. Leaves to Valid a Tree","hoverEvent":{"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":"\u00A7m ","color":"dark_gray"}] - -function timber:settings/end_of_message \ No newline at end of file diff --git a/18-41/data/timber/functions/settings/settings2_click.mcfunction b/18-41/data/timber/functions/settings/settings2_click.mcfunction deleted file mode 100644 index 44b2ce4..0000000 --- a/18-41/data/timber/functions/settings/settings2_click.mcfunction +++ /dev/null @@ -1,2 +0,0 @@ -function timber:settings/settings2 -playsound minecraft:ui.button.click master @s ~ ~ ~ .2 1.6 .2 \ No newline at end of file diff --git a/18-41/data/timber/functions/settings/toggle/chop_down.mcfunction b/18-41/data/timber/functions/settings/toggle/chop_down.mcfunction deleted file mode 100644 index e601c0c..0000000 --- a/18-41/data/timber/functions/settings/toggle/chop_down.mcfunction +++ /dev/null @@ -1,7 +0,0 @@ -execute if score chop_down timber matches 1.. run scoreboard players set chop_down timber 2 -execute unless score chop_down timber matches 1.. run scoreboard players set chop_down timber 1 -execute if score chop_down timber matches 2.. run scoreboard players set chop_down timber 0 -execute if score chop_down timber matches 1 run playsound minecraft:ui.button.click master @s ~ ~ ~ .2 1.9 .2 -execute if score chop_down timber matches 0 run playsound minecraft:ui.button.click master @s ~ ~ ~ .2 1.3 .2 -function timber:settings/settings -function timber:settings/end_of_message \ No newline at end of file diff --git a/18-41/data/timber/functions/settings/toggle/chop_fungi.mcfunction b/18-41/data/timber/functions/settings/toggle/chop_fungi.mcfunction deleted file mode 100644 index 22614b8..0000000 --- a/18-41/data/timber/functions/settings/toggle/chop_fungi.mcfunction +++ /dev/null @@ -1,7 +0,0 @@ -execute if score chop_fungi timber matches 1.. run scoreboard players set chop_fungi timber 2 -execute unless score chop_fungi timber matches 1.. run scoreboard players set chop_fungi timber 1 -execute if score chop_fungi timber matches 2.. run scoreboard players set chop_fungi timber 0 -execute if score chop_fungi timber matches 1 run playsound minecraft:ui.button.click master @s ~ ~ ~ .2 1.9 .2 -execute if score chop_fungi timber matches 0 run playsound minecraft:ui.button.click master @s ~ ~ ~ .2 1.3 .2 -function timber:settings/settings2 -function timber:settings/end_of_message \ No newline at end of file diff --git a/18-41/data/timber/functions/settings/toggle/chop_trees.mcfunction b/18-41/data/timber/functions/settings/toggle/chop_trees.mcfunction deleted file mode 100644 index 19fe627..0000000 --- a/18-41/data/timber/functions/settings/toggle/chop_trees.mcfunction +++ /dev/null @@ -1,7 +0,0 @@ -execute if score chop_trees timber matches 1.. run scoreboard players set chop_trees timber 2 -execute unless score chop_trees timber matches 1.. run scoreboard players set chop_trees timber 1 -execute if score chop_trees timber matches 2.. run scoreboard players set chop_trees timber 0 -execute if score chop_trees timber matches 1 run playsound minecraft:ui.button.click master @s ~ ~ ~ .2 1.9 .2 -execute if score chop_trees timber matches 0 run playsound minecraft:ui.button.click master @s ~ ~ ~ .2 1.3 .2 -function timber:settings/settings2 -function timber:settings/end_of_message \ No newline at end of file diff --git a/18-41/data/timber/functions/settings/toggle/destroy_leaves.mcfunction b/18-41/data/timber/functions/settings/toggle/destroy_leaves.mcfunction deleted file mode 100644 index 346bced..0000000 --- a/18-41/data/timber/functions/settings/toggle/destroy_leaves.mcfunction +++ /dev/null @@ -1,7 +0,0 @@ -execute if score destroy_leaves timber matches 1.. run scoreboard players set destroy_leaves timber 2 -execute unless score destroy_leaves timber matches 1.. run scoreboard players set destroy_leaves timber 1 -execute if score destroy_leaves timber matches 2.. run scoreboard players set destroy_leaves timber 0 -execute if score destroy_leaves timber matches 1 run playsound minecraft:ui.button.click master @s ~ ~ ~ .2 1.9 .2 -execute if score destroy_leaves timber matches 0 run playsound minecraft:ui.button.click master @s ~ ~ ~ .2 1.3 .2 -function timber:settings/settings -function timber:settings/end_of_message \ No newline at end of file diff --git a/18-41/data/timber/functions/settings/toggle/destroy_roots.mcfunction b/18-41/data/timber/functions/settings/toggle/destroy_roots.mcfunction deleted file mode 100644 index 87a6906..0000000 --- a/18-41/data/timber/functions/settings/toggle/destroy_roots.mcfunction +++ /dev/null @@ -1,7 +0,0 @@ -execute if score destroy_roots timber matches 1.. run scoreboard players set destroy_roots timber 2 -execute unless score destroy_roots timber matches 1.. run scoreboard players set destroy_roots timber 1 -execute if score destroy_roots timber matches 2.. run scoreboard players set destroy_roots timber 0 -execute if score destroy_roots timber matches 1 run playsound minecraft:ui.button.click master @s ~ ~ ~ .2 1.9 .2 -execute if score destroy_roots timber matches 0 run playsound minecraft:ui.button.click master @s ~ ~ ~ .2 1.3 .2 -function timber:settings/settings -function timber:settings/end_of_message \ No newline at end of file diff --git a/18-41/data/timber/functions/settings/toggle/diamond_axe.mcfunction b/18-41/data/timber/functions/settings/toggle/diamond_axe.mcfunction deleted file mode 100644 index 83e45d8..0000000 --- a/18-41/data/timber/functions/settings/toggle/diamond_axe.mcfunction +++ /dev/null @@ -1,7 +0,0 @@ -execute if score diamond_axe timber matches 1.. run scoreboard players set diamond_axe timber 2 -execute unless score diamond_axe timber matches 1.. run scoreboard players set diamond_axe timber 1 -execute if score diamond_axe timber matches 2.. run scoreboard players set diamond_axe timber 0 -execute if score diamond_axe timber matches 1 run playsound minecraft:ui.button.click master @s ~ ~ ~ .2 1.9 .2 -execute if score diamond_axe timber matches 0 run playsound minecraft:ui.button.click master @s ~ ~ ~ .2 1.3 .2 -function timber:settings/settings2 -function timber:settings/end_of_message \ No newline at end of file diff --git a/18-41/data/timber/functions/settings/toggle/drop_loot.mcfunction b/18-41/data/timber/functions/settings/toggle/drop_loot.mcfunction deleted file mode 100644 index dc35415..0000000 --- a/18-41/data/timber/functions/settings/toggle/drop_loot.mcfunction +++ /dev/null @@ -1,7 +0,0 @@ -execute if score drop_loot timber matches 1.. run scoreboard players set drop_loot timber 2 -execute unless score drop_loot timber matches 1.. run scoreboard players set drop_loot timber 1 -execute if score drop_loot timber matches 2.. run scoreboard players set drop_loot timber 0 -execute if score drop_loot timber matches 1 run playsound minecraft:ui.button.click master @s ~ ~ ~ .2 1.9 .2 -execute if score drop_loot timber matches 0 run playsound minecraft:ui.button.click master @s ~ ~ ~ .2 1.3 .2 -function timber:settings/settings -function timber:settings/end_of_message \ No newline at end of file diff --git a/18-41/data/timber/functions/settings/toggle/golden_axe.mcfunction b/18-41/data/timber/functions/settings/toggle/golden_axe.mcfunction deleted file mode 100644 index f21f5b8..0000000 --- a/18-41/data/timber/functions/settings/toggle/golden_axe.mcfunction +++ /dev/null @@ -1,7 +0,0 @@ -execute if score golden_axe timber matches 1.. run scoreboard players set golden_axe timber 2 -execute unless score golden_axe timber matches 1.. run scoreboard players set golden_axe timber 1 -execute if score golden_axe timber matches 2.. run scoreboard players set golden_axe timber 0 -execute if score golden_axe timber matches 1 run playsound minecraft:ui.button.click master @s ~ ~ ~ .2 1.9 .2 -execute if score golden_axe timber matches 0 run playsound minecraft:ui.button.click master @s ~ ~ ~ .2 1.3 .2 -function timber:settings/settings2 -function timber:settings/end_of_message \ No newline at end of file diff --git a/18-41/data/timber/functions/settings/toggle/hunger.mcfunction b/18-41/data/timber/functions/settings/toggle/hunger.mcfunction deleted file mode 100644 index b1e9543..0000000 --- a/18-41/data/timber/functions/settings/toggle/hunger.mcfunction +++ /dev/null @@ -1,7 +0,0 @@ -execute if score hunger timber matches 1.. run scoreboard players set hunger timber 2 -execute unless score hunger timber matches 1.. run scoreboard players set hunger timber 1 -execute if score hunger timber matches 2.. run scoreboard players set hunger timber 0 -execute if score hunger timber matches 1 run playsound minecraft:ui.button.click master @s ~ ~ ~ .2 1.9 .2 -execute if score hunger timber matches 0 run playsound minecraft:ui.button.click master @s ~ ~ ~ .2 1.3 .2 -function timber:settings/settings1 -function timber:settings/end_of_message \ No newline at end of file diff --git a/18-41/data/timber/functions/settings/toggle/interfere.mcfunction b/18-41/data/timber/functions/settings/toggle/interfere.mcfunction deleted file mode 100644 index b1270d0..0000000 --- a/18-41/data/timber/functions/settings/toggle/interfere.mcfunction +++ /dev/null @@ -1,7 +0,0 @@ -execute if score interfere timber matches 1.. run scoreboard players set interfere timber 2 -execute unless score interfere timber matches 1.. run scoreboard players set interfere timber 1 -execute if score interfere timber matches 2.. run scoreboard players set interfere timber 0 -execute if score interfere timber matches 1 run playsound minecraft:ui.button.click master @s ~ ~ ~ .2 1.9 .2 -execute if score interfere timber matches 0 run playsound minecraft:ui.button.click master @s ~ ~ ~ .2 1.3 .2 -function timber:settings/settings -function timber:settings/end_of_message \ No newline at end of file diff --git a/18-41/data/timber/functions/settings/toggle/iron_axe.mcfunction b/18-41/data/timber/functions/settings/toggle/iron_axe.mcfunction deleted file mode 100644 index bf08c1f..0000000 --- a/18-41/data/timber/functions/settings/toggle/iron_axe.mcfunction +++ /dev/null @@ -1,7 +0,0 @@ -execute if score iron_axe timber matches 1.. run scoreboard players set iron_axe timber 2 -execute unless score iron_axe timber matches 1.. run scoreboard players set iron_axe timber 1 -execute if score iron_axe timber matches 2.. run scoreboard players set iron_axe timber 0 -execute if score iron_axe timber matches 1 run playsound minecraft:ui.button.click master @s ~ ~ ~ .2 1.9 .2 -execute if score iron_axe timber matches 0 run playsound minecraft:ui.button.click master @s ~ ~ ~ .2 1.3 .2 -function timber:settings/settings2 -function timber:settings/end_of_message \ No newline at end of file diff --git a/18-41/data/timber/functions/settings/toggle/netherite_axe.mcfunction b/18-41/data/timber/functions/settings/toggle/netherite_axe.mcfunction deleted file mode 100644 index 17f6528..0000000 --- a/18-41/data/timber/functions/settings/toggle/netherite_axe.mcfunction +++ /dev/null @@ -1,7 +0,0 @@ -execute if score netherite_axe timber matches 1.. run scoreboard players set netherite_axe timber 2 -execute unless score netherite_axe timber matches 1.. run scoreboard players set netherite_axe timber 1 -execute if score netherite_axe timber matches 2.. run scoreboard players set netherite_axe timber 0 -execute if score netherite_axe timber matches 1 run playsound minecraft:ui.button.click master @s ~ ~ ~ .2 1.9 .2 -execute if score netherite_axe timber matches 0 run playsound minecraft:ui.button.click master @s ~ ~ ~ .2 1.3 .2 -function timber:settings/settings2 -function timber:settings/end_of_message \ No newline at end of file diff --git a/18-41/data/timber/functions/settings/toggle/persistent.mcfunction b/18-41/data/timber/functions/settings/toggle/persistent.mcfunction deleted file mode 100644 index 58bad84..0000000 --- a/18-41/data/timber/functions/settings/toggle/persistent.mcfunction +++ /dev/null @@ -1,7 +0,0 @@ -execute if score persistent timber matches 1.. run scoreboard players set persistent timber 2 -execute unless score persistent timber matches 1.. run scoreboard players set persistent timber 1 -execute if score persistent timber matches 2.. run scoreboard players set persistent timber 0 -execute if score persistent timber matches 1 run playsound minecraft:ui.button.click master @s ~ ~ ~ .2 1.9 .2 -execute if score persistent timber matches 0 run playsound minecraft:ui.button.click master @s ~ ~ ~ .2 1.3 .2 -function timber:settings/settings2 -function timber:settings/end_of_message \ No newline at end of file diff --git a/18-41/data/timber/functions/settings/toggle/plant_sapling.mcfunction b/18-41/data/timber/functions/settings/toggle/plant_sapling.mcfunction deleted file mode 100644 index a6efdc3..0000000 --- a/18-41/data/timber/functions/settings/toggle/plant_sapling.mcfunction +++ /dev/null @@ -1,8 +0,0 @@ -execute if score plant_sapling timber matches 1.. run scoreboard players set plant_sapling timber 2 -execute unless score plant_sapling timber matches 1.. run scoreboard players set plant_sapling timber 1 -execute if score plant_sapling timber matches 2.. run scoreboard players set plant_sapling timber 0 -execute if score plant_sapling timber matches 1 run playsound minecraft:ui.button.click master @s ~ ~ ~ .2 1.9 .2 -execute if score plant_sapling timber matches 1 run function timber:autoplant/loop -execute if score plant_sapling timber matches 0 run playsound minecraft:ui.button.click master @s ~ ~ ~ .2 1.3 .2 -function timber:settings/settings1 -function timber:settings/end_of_message \ No newline at end of file diff --git a/18-41/data/timber/functions/settings/toggle/slow_chop.mcfunction b/18-41/data/timber/functions/settings/toggle/slow_chop.mcfunction deleted file mode 100644 index 0a0989c..0000000 --- a/18-41/data/timber/functions/settings/toggle/slow_chop.mcfunction +++ /dev/null @@ -1,8 +0,0 @@ -execute if score slow_chop timber matches 1.. run scoreboard players set slow_chop timber 2 -execute unless score slow_chop timber matches 1.. run scoreboard players set slow_chop timber 1 -execute if score slow_chop timber matches 2.. run scoreboard players set slow_chop timber 0 -execute if score slow_chop timber matches 1 run playsound minecraft:ui.button.click master @s ~ ~ ~ .2 1.9 .2 -execute if score slow_chop timber matches 1 run function timber:slow_chop/loop -execute if score slow_chop timber matches 0 run playsound minecraft:ui.button.click master @s ~ ~ ~ .2 1.3 .2 -function timber:settings/settings1 -function timber:settings/end_of_message \ No newline at end of file diff --git a/18-41/data/timber/functions/settings/toggle/sneaking.mcfunction b/18-41/data/timber/functions/settings/toggle/sneaking.mcfunction deleted file mode 100644 index 53f5141..0000000 --- a/18-41/data/timber/functions/settings/toggle/sneaking.mcfunction +++ /dev/null @@ -1,7 +0,0 @@ -execute if score sneaking timber matches 1.. run scoreboard players set sneaking timber 2 -execute unless score sneaking timber matches 1.. run scoreboard players set sneaking timber 1 -execute if score sneaking timber matches 2.. run scoreboard players set sneaking timber 0 -execute if score sneaking timber matches 1 run playsound minecraft:ui.button.click master @s ~ ~ ~ .2 1.9 .2 -execute if score sneaking timber matches 0 run playsound minecraft:ui.button.click master @s ~ ~ ~ .2 1.3 .2 -function timber:settings/settings -function timber:settings/end_of_message \ No newline at end of file diff --git a/18-41/data/timber/functions/settings/toggle/standing.mcfunction b/18-41/data/timber/functions/settings/toggle/standing.mcfunction deleted file mode 100644 index 08c661d..0000000 --- a/18-41/data/timber/functions/settings/toggle/standing.mcfunction +++ /dev/null @@ -1,7 +0,0 @@ -execute if score standing timber matches 1.. run scoreboard players set standing timber 2 -execute unless score standing timber matches 1.. run scoreboard players set standing timber 1 -execute if score standing timber matches 2.. run scoreboard players set standing timber 0 -execute if score standing timber matches 1 run playsound minecraft:ui.button.click master @s ~ ~ ~ .2 1.9 .2 -execute if score standing timber matches 0 run playsound minecraft:ui.button.click master @s ~ ~ ~ .2 1.3 .2 -function timber:settings/settings -function timber:settings/end_of_message \ No newline at end of file diff --git a/18-41/data/timber/functions/settings/toggle/start_chop_on_root.mcfunction b/18-41/data/timber/functions/settings/toggle/start_chop_on_root.mcfunction deleted file mode 100644 index e04a2b7..0000000 --- a/18-41/data/timber/functions/settings/toggle/start_chop_on_root.mcfunction +++ /dev/null @@ -1,7 +0,0 @@ -execute if score start_chop_on_root timber matches 1.. run scoreboard players set start_chop_on_root timber 2 -execute unless score start_chop_on_root timber matches 1.. run scoreboard players set start_chop_on_root timber 1 -execute if score start_chop_on_root timber matches 2.. run scoreboard players set start_chop_on_root timber 0 -execute if score start_chop_on_root timber matches 1 run playsound minecraft:ui.button.click master @s ~ ~ ~ .2 1.9 .2 -execute if score start_chop_on_root timber matches 0 run playsound minecraft:ui.button.click master @s ~ ~ ~ .2 1.3 .2 -function timber:settings/settings -function timber:settings/end_of_message \ No newline at end of file diff --git a/18-41/data/timber/functions/settings/toggle/stone_axe.mcfunction b/18-41/data/timber/functions/settings/toggle/stone_axe.mcfunction deleted file mode 100644 index 641459d..0000000 --- a/18-41/data/timber/functions/settings/toggle/stone_axe.mcfunction +++ /dev/null @@ -1,7 +0,0 @@ -execute if score stone_axe timber matches 1.. run scoreboard players set stone_axe timber 2 -execute unless score stone_axe timber matches 1.. run scoreboard players set stone_axe timber 1 -execute if score stone_axe timber matches 2.. run scoreboard players set stone_axe timber 0 -execute if score stone_axe timber matches 1 run playsound minecraft:ui.button.click master @s ~ ~ ~ .2 1.9 .2 -execute if score stone_axe timber matches 0 run playsound minecraft:ui.button.click master @s ~ ~ ~ .2 1.3 .2 -function timber:settings/settings2 -function timber:settings/end_of_message \ No newline at end of file diff --git a/18-41/data/timber/functions/settings/toggle/stop_chopping.mcfunction b/18-41/data/timber/functions/settings/toggle/stop_chopping.mcfunction deleted file mode 100644 index b13140f..0000000 --- a/18-41/data/timber/functions/settings/toggle/stop_chopping.mcfunction +++ /dev/null @@ -1,7 +0,0 @@ -execute if score stop_chopping timber matches 1.. run scoreboard players set stop_chopping timber 2 -execute unless score stop_chopping timber matches 1.. run scoreboard players set stop_chopping timber 1 -execute if score stop_chopping timber matches 2.. run scoreboard players set stop_chopping timber 0 -execute if score stop_chopping timber matches 1 run playsound minecraft:ui.button.click master @s ~ ~ ~ .2 1.9 .2 -execute if score stop_chopping timber matches 0 run playsound minecraft:ui.button.click master @s ~ ~ ~ .2 1.3 .2 -function timber:settings/settings -function timber:settings/end_of_message \ No newline at end of file diff --git a/18-41/data/timber/functions/settings/toggle/stopsound.mcfunction b/18-41/data/timber/functions/settings/toggle/stopsound.mcfunction deleted file mode 100644 index 9418b18..0000000 --- a/18-41/data/timber/functions/settings/toggle/stopsound.mcfunction +++ /dev/null @@ -1,7 +0,0 @@ -execute if score stopsound timber matches 1.. run scoreboard players set stopsound timber 2 -execute unless score stopsound timber matches 1.. run scoreboard players set stopsound timber 1 -execute if score stopsound timber matches 2.. run scoreboard players set stopsound timber 0 -execute if score stopsound timber matches 1 run playsound minecraft:ui.button.click master @s ~ ~ ~ .2 1.9 .2 -execute if score stopsound timber matches 0 run playsound minecraft:ui.button.click master @s ~ ~ ~ .2 1.3 .2 -function timber:settings/settings -function timber:settings/end_of_message \ No newline at end of file diff --git a/18-41/data/timber/functions/settings/toggle/timber.mcfunction b/18-41/data/timber/functions/settings/toggle/timber.mcfunction deleted file mode 100644 index 0a26b1d..0000000 --- a/18-41/data/timber/functions/settings/toggle/timber.mcfunction +++ /dev/null @@ -1,9 +0,0 @@ -# reset -scoreboard players set @s TimberToggle 0 -# toggle -execute unless score @s timber_disabled matches 1.. run scoreboard players set @s timber_disabled 3 -execute if score @s timber_disabled matches 1 run scoreboard players set @s timber_disabled 0 -execute if score @s timber_disabled matches 3 run scoreboard players set @s timber_disabled 1 -# display on/off status -execute unless score @s[tag=!global.ignore.gui] timber_disabled matches 1.. run tellraw @s ["",{"text":"<< ","color":"dark_gray"},{"text":"✔","color":"green"},{"text":" Timber is now on"},{"text":" >>","color":"dark_gray"}] -execute if score @s[tag=!global.ignore.gui] timber_disabled matches 1.. run tellraw @s ["",{"text":"<< ","color":"dark_gray"},{"text":"❌","color":"red"},{"text":" Timber is now off"},{"text":" >>","color":"dark_gray"}] \ No newline at end of file diff --git a/18-41/data/timber/functions/settings/toggle/wear_out.mcfunction b/18-41/data/timber/functions/settings/toggle/wear_out.mcfunction deleted file mode 100644 index 0bad5ec..0000000 --- a/18-41/data/timber/functions/settings/toggle/wear_out.mcfunction +++ /dev/null @@ -1,7 +0,0 @@ -execute if score wear_out timber matches 1.. run scoreboard players set wear_out timber 2 -execute unless score wear_out timber matches 1.. run scoreboard players set wear_out timber 1 -execute if score wear_out timber matches 2.. run scoreboard players set wear_out timber 0 -execute if score wear_out timber matches 1 run playsound minecraft:ui.button.click master @s ~ ~ ~ .2 1.9 .2 -execute if score wear_out timber matches 0 run playsound minecraft:ui.button.click master @s ~ ~ ~ .2 1.3 .2 -function timber:settings/settings -function timber:settings/end_of_message \ No newline at end of file diff --git a/18-41/data/timber/functions/settings/toggle/wooden_axe.mcfunction b/18-41/data/timber/functions/settings/toggle/wooden_axe.mcfunction deleted file mode 100644 index cb82456..0000000 --- a/18-41/data/timber/functions/settings/toggle/wooden_axe.mcfunction +++ /dev/null @@ -1,7 +0,0 @@ -execute if score wooden_axe timber matches 1.. run scoreboard players set wooden_axe timber 2 -execute unless score wooden_axe timber matches 1.. run scoreboard players set wooden_axe timber 1 -execute if score wooden_axe timber matches 2.. run scoreboard players set wooden_axe timber 0 -execute if score wooden_axe timber matches 1 run playsound minecraft:ui.button.click master @s ~ ~ ~ .2 1.9 .2 -execute if score wooden_axe timber matches 0 run playsound minecraft:ui.button.click master @s ~ ~ ~ .2 1.3 .2 -function timber:settings/settings2 -function timber:settings/end_of_message \ No newline at end of file diff --git a/18-41/data/timber/functions/slow_chop/api.mcfunction b/18-41/data/timber/functions/slow_chop/api.mcfunction deleted file mode 100644 index d27c681..0000000 --- a/18-41/data/timber/functions/slow_chop/api.mcfunction +++ /dev/null @@ -1,6 +0,0 @@ -# api -execute if entity @s[tag=timber_log] run function #timber:api/break_log -execute if entity @s[tag=timber_leaf] run function #timber:api/break_leaf -execute if entity @s[tag=timber_root] run function #timber:api/break_root -execute if entity @s[tag=timber_stem] run function #timber:api/break_stem -execute if entity @s[tag=timber_cap] run function #timber:api/break_cap \ No newline at end of file diff --git a/18-41/data/timber/functions/slow_chop/delete_markers.mcfunction b/18-41/data/timber/functions/slow_chop/delete_markers.mcfunction deleted file mode 100644 index c3375d6..0000000 --- a/18-41/data/timber/functions/slow_chop/delete_markers.mcfunction +++ /dev/null @@ -1,3 +0,0 @@ -# delete tree markers after chopping -kill @e[type=minecraft:marker,tag=timber_slow_chop] -kill @e[type=minecraft:armor_stand,tag=timber_tool] \ No newline at end of file diff --git a/18-41/data/timber/functions/slow_chop/destroy_loop.mcfunction b/18-41/data/timber/functions/slow_chop/destroy_loop.mcfunction deleted file mode 100644 index db43fbd..0000000 --- a/18-41/data/timber/functions/slow_chop/destroy_loop.mcfunction +++ /dev/null @@ -1,25 +0,0 @@ -# loop -$schedule function timber:slow_chop/loop $(time_between_chops)t replace - -# api -$execute at @e[type=minecraft:marker,tag=timber_slow_chop] as @e[type=minecraft:marker,tag=timber_destroy,sort=nearest,limit=$(blocks_per_chop)] at @s run function timber:slow_chop/api - -# destroy n block -$execute at @e[type=minecraft:marker,tag=timber_slow_chop] as @e[type=minecraft:armor_stand,tag=timber_tool,y=-64,distance=...1,sort=arbitrary,limit=1] at @e[type=minecraft:marker,tag=timber_destroy,sort=nearest,limit=$(blocks_per_chop)] run loot spawn ~ ~ ~ mine ~ ~ ~ mainhand - -# destroy animation (doTileDrops can be changed, because datapack wouldn't get to this point otherwise) -gamerule doTileDrops false -$execute at @e[type=minecraft:marker,tag=timber_slow_chop] at @e[type=minecraft:marker,tag=timber_destroy,sort=nearest,limit=$(blocks_per_chop)] run setblock ~ ~ ~ minecraft:air destroy -gamerule doTileDrops true - -# stop sound -$execute at @e[type=minecraft:marker,tag=timber_slow_chop] if score stopsound timber matches 1.. at @e[type=minecraft:marker,tag=timber_destroy,sort=nearest,limit=$(blocks_per_chop)] as @a[distance=..20,tag=!global.ignore.gui] run function timber:utils/stopsound - -# delete location item -$execute at @e[type=minecraft:marker,tag=timber_slow_chop] at @e[type=minecraft:marker,tag=timber_destroy,sort=nearest,limit=$(blocks_per_chop)] run kill @e[type=minecraft:item,distance=..1,nbt={Item:{components:{"minecraft:custom_data":{Tags:["timber_location"]}}}}] - -# remove marker of processed blocks -$execute at @e[type=minecraft:marker,tag=timber_slow_chop] run kill @e[type=minecraft:marker,tag=timber_destroy,sort=nearest,limit=$(blocks_per_chop)] - -# delete tree markers after chopping -execute unless entity @e[type=minecraft:marker,tag=timber_destroy] run function timber:slow_chop/delete_markers \ No newline at end of file diff --git a/18-41/data/timber/functions/slow_chop/loop.mcfunction b/18-41/data/timber/functions/slow_chop/loop.mcfunction deleted file mode 100644 index e6a33b5..0000000 --- a/18-41/data/timber/functions/slow_chop/loop.mcfunction +++ /dev/null @@ -1,4 +0,0 @@ -# destroy loop -execute store result storage timber:slow_chop blocks_per_chop int 1 run scoreboard players get blocks_per_chop timber -execute store result storage timber:slow_chop time_between_chops int 1 run scoreboard players get time_between_chops timber -execute if score slow_chop timber matches 1.. run function timber:slow_chop/destroy_loop with storage timber:slow_chop diff --git a/18-41/data/timber/functions/tool/durability_check.mcfunction b/18-41/data/timber/functions/tool/durability_check.mcfunction deleted file mode 100644 index d6607bf..0000000 --- a/18-41/data/timber/functions/tool/durability_check.mcfunction +++ /dev/null @@ -1,7 +0,0 @@ -# check if axe is broken -execute if score @s timber_w_axe matches 1.. unless score durability timber <= #wooden_axe_max_durability timber run scoreboard players set durability_okay timber 0 -execute if score @s timber_s_axe matches 1.. unless score durability timber <= #stone_axe_max_durability timber run scoreboard players set durability_okay timber 0 -execute if score @s timber_i_axe matches 1.. unless score durability timber <= #iron_axe_max_durability timber run scoreboard players set durability_okay timber 0 -execute if score @s timber_g_axe matches 1.. unless score durability timber <= #golden_axe_max_durability timber run scoreboard players set durability_okay timber 0 -execute if score @s timber_d_axe matches 1.. unless score durability timber <= #diamond_axe_max_durability timber run scoreboard players set durability_okay timber 0 -execute if score @s timber_n_axe matches 1.. unless score durability timber <= #netherite_axe_max_durability timber run scoreboard players set durability_okay timber 0 \ No newline at end of file diff --git a/18-41/data/timber/functions/tool/durability_count.mcfunction b/18-41/data/timber/functions/tool/durability_count.mcfunction deleted file mode 100644 index 118f8c3..0000000 --- a/18-41/data/timber/functions/tool/durability_count.mcfunction +++ /dev/null @@ -1,5 +0,0 @@ -# count wear out of tool depending on enchantment -execute if score unbreaking timber matches 0 run scoreboard players add durability timber 1 -execute if score unbreaking timber matches 1 if predicate timber:random_chance/0.5 run scoreboard players add durability timber 1 -execute if score unbreaking timber matches 2 if predicate timber:random_chance/0.333 run scoreboard players add durability timber 1 -execute if score unbreaking timber matches 3.. if predicate timber:random_chance/0.25 run scoreboard players add durability timber 1 \ No newline at end of file diff --git a/18-41/data/timber/functions/tool/durability_get.mcfunction b/18-41/data/timber/functions/tool/durability_get.mcfunction deleted file mode 100644 index d4505c4..0000000 --- a/18-41/data/timber/functions/tool/durability_get.mcfunction +++ /dev/null @@ -1,5 +0,0 @@ -scoreboard players set unbreakable timber 0 -execute store result score durability timber run data get entity @s SelectedItem.components."minecraft:damage" -scoreboard players remove durability timber 1 -execute if entity @s[nbt=!{SelectedItem:{}}] run scoreboard players set durability timber 2147483647 -execute if data entity @s SelectedItem.components."minecraft:unbreakable" run scoreboard players set unbreakable timber 1 \ No newline at end of file diff --git a/18-41/data/timber/functions/tool/durability_max.mcfunction b/18-41/data/timber/functions/tool/durability_max.mcfunction deleted file mode 100644 index 3342e7b..0000000 --- a/18-41/data/timber/functions/tool/durability_max.mcfunction +++ /dev/null @@ -1,7 +0,0 @@ -# non-overriding max durability for axes -execute unless score #wooden_axe_max_durability timber = #wooden_axe_max_durability timber run scoreboard players set #wooden_axe_max_durability timber 59 -execute unless score #stone_axe_max_durability timber = #stone_axe_max_durability timber run scoreboard players set #stone_axe_max_durability timber 131 -execute unless score #iron_axe_max_durability timber = #iron_axe_max_durability timber run scoreboard players set #iron_axe_max_durability timber 250 -execute unless score #golden_axe_max_durability timber = #golden_axe_max_durability timber run scoreboard players set #golden_axe_max_durability timber 32 -execute unless score #diamond_axe_max_durability timber = #diamond_axe_max_durability timber run scoreboard players set #diamond_axe_max_durability timber 1561 -execute unless score #netherite_axe_max_durability timber = #netherite_axe_max_durability timber run scoreboard players set #netherite_axe_max_durability timber 2031 \ No newline at end of file diff --git a/18-41/data/timber/functions/tool/wear_out.mcfunction b/18-41/data/timber/functions/tool/wear_out.mcfunction deleted file mode 100644 index c9a6224..0000000 --- a/18-41/data/timber/functions/tool/wear_out.mcfunction +++ /dev/null @@ -1,9 +0,0 @@ -# wear out tool -execute if score @s timber_w_axe matches 1.. run scoreboard players operation damage timber = #wooden_axe_max_durability timber -execute if score @s timber_s_axe matches 1.. run scoreboard players operation damage timber = #stone_axe_max_durability timber -execute if score @s timber_i_axe matches 1.. run scoreboard players operation damage timber = #iron_axe_max_durability timber -execute if score @s timber_g_axe matches 1.. run scoreboard players operation damage timber = #golden_axe_max_durability timber -execute if score @s timber_d_axe matches 1.. run scoreboard players operation damage timber = #diamond_axe_max_durability timber -execute if score @s timber_n_axe matches 1.. run scoreboard players operation damage timber = #netherite_axe_max_durability timber -scoreboard players operation damage timber -= durability timber -item modify entity @s weapon.mainhand timber:wear_out \ No newline at end of file diff --git a/18-41/data/timber/functions/tool/worn_out.mcfunction b/18-41/data/timber/functions/tool/worn_out.mcfunction deleted file mode 100644 index 545717d..0000000 --- a/18-41/data/timber/functions/tool/worn_out.mcfunction +++ /dev/null @@ -1,13 +0,0 @@ -# break axe if worn out -execute if score @s timber_w_axe matches 1.. if score durability timber >= #wooden_axe_max_durability timber run item replace entity @s weapon.mainhand with minecraft:air -execute if score @s timber_w_axe matches 1.. if score durability timber >= #wooden_axe_max_durability timber run playsound minecraft:entity.item.break player @a ~ ~ ~ -execute if score @s timber_s_axe matches 1.. if score durability timber >= #stone_axe_max_durability timber run item replace entity @s weapon.mainhand with minecraft:air -execute if score @s timber_s_axe matches 1.. if score durability timber >= #stone_axe_max_durability timber run playsound minecraft:entity.item.break player @a ~ ~ ~ -execute if score @s timber_i_axe matches 1.. if score durability timber >= #iron_axe_max_durability timber run item replace entity @s weapon.mainhand with minecraft:air -execute if score @s timber_i_axe matches 1.. if score durability timber >= #iron_axe_max_durability timber run playsound minecraft:entity.item.break player @a ~ ~ ~ -execute if score @s timber_g_axe matches 1.. if score durability timber >= #golden_axe_max_durability timber run item replace entity @s weapon.mainhand with minecraft:air -execute if score @s timber_g_axe matches 1.. if score durability timber >= #golden_axe_max_durability timber run playsound minecraft:entity.item.break player @a ~ ~ ~ -execute if score @s timber_d_axe matches 1.. if score durability timber >= #diamond_axe_max_durability timber run item replace entity @s weapon.mainhand with minecraft:air -execute if score @s timber_d_axe matches 1.. if score durability timber >= #diamond_axe_max_durability timber run playsound minecraft:entity.item.break player @a ~ ~ ~ -execute if score @s timber_n_axe matches 1.. if score durability timber >= #netherite_axe_max_durability timber run item replace entity @s weapon.mainhand with minecraft:air -execute if score @s timber_n_axe matches 1.. if score durability timber >= #netherite_axe_max_durability timber run playsound minecraft:entity.item.break player @a ~ ~ ~ \ No newline at end of file diff --git a/18-41/data/timber/functions/uninstall.mcfunction b/18-41/data/timber/functions/uninstall.mcfunction deleted file mode 100644 index 96a2656..0000000 --- a/18-41/data/timber/functions/uninstall.mcfunction +++ /dev/null @@ -1,19 +0,0 @@ -# stop main functions -schedule clear timber:main - -# remove scoreboards -scoreboard objectives remove timber_w_axe -scoreboard objectives remove timber_s_axe -scoreboard objectives remove timber_i_axe -scoreboard objectives remove timber_g_axe -scoreboard objectives remove timber_d_axe -scoreboard objectives remove timber_n_axe -scoreboard objectives remove timber -scoreboard objectives remove TimberToggle -scoreboard objectives remove timber_disabled -scoreboard objectives remove timber_prsistent - -# remove markers -kill @e[type=minecraft:marker,tag=timber_slow_chop] -kill @e[type=minecraft:marker,tag=timber_destroy] -kill @e[type=minecraft:armor_stand,tag=timber_tool] \ No newline at end of file diff --git a/18-41/data/timber/functions/utils/check_max_command_chain_length.mcfunction b/18-41/data/timber/functions/utils/check_max_command_chain_length.mcfunction deleted file mode 100644 index 6f32c3e..0000000 --- a/18-41/data/timber/functions/utils/check_max_command_chain_length.mcfunction +++ /dev/null @@ -1,13 +0,0 @@ -# function didn't end successfully -execute if score running timber matches 1 run scoreboard players set running timber 2 -# normal behavior -execute if score running timber matches 0 run scoreboard players set running timber 1 -execute if score running timber matches 1 run function timber:utils/used_axe -# function didn't end successfully -execute if score running timber matches 2 run execute store result storage timber:max_command_chain_length value int 1 run gamerule maxCommandChainLength -execute if score running timber matches 2 run tellraw @a[tag=!noTimberWarning] ["",{"text":"Timber Datapack Warning: ","color":"red"},{"text":"The datapack wasn't able to finish its functionality to work properly!"},{"text":"\n ─ Please either decrease setting \"Max. Tree Size\" with "},{"text":"\n [ ✎ ]","color":"gray","clickEvent":{"action":"suggest_command","value":"/scoreboard players set max_tree_size timber "},"hoverEvent":{"action":"show_text","value":"Default: 555"}},{"text":" (Currently: ","color":"gray"},{"score":{"name":"max_tree_size","objective":"timber"},"color":"gray"},{"text": ")","color":"gray"},{"text":"."},{"text":"\n ─ Or increase the gamerule \"maxCommandChainLength\" with "},{"text":"\n [ ✎ ]","color":"gray","clickEvent":{"action":"suggest_command","value":"/gamerule maxCommandChainLength "},"hoverEvent":{"action":"show_text","value":"Default: 65536"}},{"text":" (Currently: ","color":"gray"},{"nbt":"value","storage":"timber:max_command_chain_length","color":"gray"},{"text": ")","color":"gray"},{"text":"."}] -execute if score running timber matches 2 run schedule function timber:utils/reset 10t -execute if score running timber matches 2 run scoreboard players set running timber 3 - -# function ended successfully -execute if score running timber matches 1 run scoreboard players set running timber 0 \ No newline at end of file diff --git a/18-41/data/timber/functions/utils/check_server.mcfunction b/18-41/data/timber/functions/utils/check_server.mcfunction deleted file mode 100644 index 7d70177..0000000 --- a/18-41/data/timber/functions/utils/check_server.mcfunction +++ /dev/null @@ -1,8 +0,0 @@ -# load until someone is in the server -execute unless entity @r run schedule function timber:utils/check_server 1s - -# Checking if the server uses a different jar from the vanilla one -execute unless score not_vanilla timber matches 1.. store success score not_vanilla timber run data get entity @r "Spigot.ticksLived" -execute unless score not_vanilla timber matches 1.. store success score not_vanilla timber run data get entity @r "Bukkit.updateLevel" -execute unless score not_vanilla timber matches 1.. store success score not_vanilla timber run data get entity @r "Paper.SpawnReason" -execute if score not_vanilla timber matches 1 run tellraw @a[tag=!noTimberWarning] ["",{"text":"Timber Datapack Warning: ","color":"red"},{"text":"Compatibility in non-vanilla servers is not guaranteed! For more information please visit official download site.","clickEvent":{"action":"open_url","value":"https://github.com/Moggla/Timber-Datapack"}}] \ No newline at end of file diff --git a/18-41/data/timber/functions/utils/hunger.mcfunction b/18-41/data/timber/functions/utils/hunger.mcfunction deleted file mode 100644 index 3d9e3de..0000000 --- a/18-41/data/timber/functions/utils/hunger.mcfunction +++ /dev/null @@ -1,255 +0,0 @@ -execute if score tree_size timber matches 1 run effect give @s minecraft:hunger 1 1 true -execute if score tree_size timber matches 2 run effect give @s minecraft:hunger 1 2 true -execute if score tree_size timber matches 3 run effect give @s minecraft:hunger 1 3 true -execute if score tree_size timber matches 4 run effect give @s minecraft:hunger 1 4 true -execute if score tree_size timber matches 5 run effect give @s minecraft:hunger 1 5 true -execute if score tree_size timber matches 6 run effect give @s minecraft:hunger 1 6 true -execute if score tree_size timber matches 7 run effect give @s minecraft:hunger 1 7 true -execute if score tree_size timber matches 8 run effect give @s minecraft:hunger 1 8 true -execute if score tree_size timber matches 9 run effect give @s minecraft:hunger 1 9 true -execute if score tree_size timber matches 10 run effect give @s minecraft:hunger 1 10 true -execute if score tree_size timber matches 11 run effect give @s minecraft:hunger 1 11 true -execute if score tree_size timber matches 12 run effect give @s minecraft:hunger 1 12 true -execute if score tree_size timber matches 13 run effect give @s minecraft:hunger 1 13 true -execute if score tree_size timber matches 14 run effect give @s minecraft:hunger 1 14 true -execute if score tree_size timber matches 15 run effect give @s minecraft:hunger 1 15 true -execute if score tree_size timber matches 16 run effect give @s minecraft:hunger 1 16 true -execute if score tree_size timber matches 17 run effect give @s minecraft:hunger 1 17 true -execute if score tree_size timber matches 18 run effect give @s minecraft:hunger 1 18 true -execute if score tree_size timber matches 19 run effect give @s minecraft:hunger 1 19 true -execute if score tree_size timber matches 20 run effect give @s minecraft:hunger 1 20 true -execute if score tree_size timber matches 21 run effect give @s minecraft:hunger 1 21 true -execute if score tree_size timber matches 22 run effect give @s minecraft:hunger 1 22 true -execute if score tree_size timber matches 23 run effect give @s minecraft:hunger 1 23 true -execute if score tree_size timber matches 24 run effect give @s minecraft:hunger 1 24 true -execute if score tree_size timber matches 25 run effect give @s minecraft:hunger 1 25 true -execute if score tree_size timber matches 26 run effect give @s minecraft:hunger 1 26 true -execute if score tree_size timber matches 27 run effect give @s minecraft:hunger 1 27 true -execute if score tree_size timber matches 28 run effect give @s minecraft:hunger 1 28 true -execute if score tree_size timber matches 29 run effect give @s minecraft:hunger 1 29 true -execute if score tree_size timber matches 30 run effect give @s minecraft:hunger 1 30 true -execute if score tree_size timber matches 31 run effect give @s minecraft:hunger 1 31 true -execute if score tree_size timber matches 32 run effect give @s minecraft:hunger 1 32 true -execute if score tree_size timber matches 33 run effect give @s minecraft:hunger 1 33 true -execute if score tree_size timber matches 34 run effect give @s minecraft:hunger 1 34 true -execute if score tree_size timber matches 35 run effect give @s minecraft:hunger 1 35 true -execute if score tree_size timber matches 36 run effect give @s minecraft:hunger 1 36 true -execute if score tree_size timber matches 37 run effect give @s minecraft:hunger 1 37 true -execute if score tree_size timber matches 38 run effect give @s minecraft:hunger 1 38 true -execute if score tree_size timber matches 39 run effect give @s minecraft:hunger 1 39 true -execute if score tree_size timber matches 40 run effect give @s minecraft:hunger 1 40 true -execute if score tree_size timber matches 41 run effect give @s minecraft:hunger 1 41 true -execute if score tree_size timber matches 42 run effect give @s minecraft:hunger 1 42 true -execute if score tree_size timber matches 43 run effect give @s minecraft:hunger 1 43 true -execute if score tree_size timber matches 44 run effect give @s minecraft:hunger 1 44 true -execute if score tree_size timber matches 45 run effect give @s minecraft:hunger 1 45 true -execute if score tree_size timber matches 46 run effect give @s minecraft:hunger 1 46 true -execute if score tree_size timber matches 47 run effect give @s minecraft:hunger 1 47 true -execute if score tree_size timber matches 48 run effect give @s minecraft:hunger 1 48 true -execute if score tree_size timber matches 49 run effect give @s minecraft:hunger 1 49 true -execute if score tree_size timber matches 50 run effect give @s minecraft:hunger 1 50 true -execute if score tree_size timber matches 51 run effect give @s minecraft:hunger 1 51 true -execute if score tree_size timber matches 52 run effect give @s minecraft:hunger 1 52 true -execute if score tree_size timber matches 53 run effect give @s minecraft:hunger 1 53 true -execute if score tree_size timber matches 54 run effect give @s minecraft:hunger 1 54 true -execute if score tree_size timber matches 55 run effect give @s minecraft:hunger 1 55 true -execute if score tree_size timber matches 56 run effect give @s minecraft:hunger 1 56 true -execute if score tree_size timber matches 57 run effect give @s minecraft:hunger 1 57 true -execute if score tree_size timber matches 58 run effect give @s minecraft:hunger 1 58 true -execute if score tree_size timber matches 59 run effect give @s minecraft:hunger 1 59 true -execute if score tree_size timber matches 60 run effect give @s minecraft:hunger 1 60 true -execute if score tree_size timber matches 61 run effect give @s minecraft:hunger 1 61 true -execute if score tree_size timber matches 62 run effect give @s minecraft:hunger 1 62 true -execute if score tree_size timber matches 63 run effect give @s minecraft:hunger 1 63 true -execute if score tree_size timber matches 64 run effect give @s minecraft:hunger 1 64 true -execute if score tree_size timber matches 65 run effect give @s minecraft:hunger 1 65 true -execute if score tree_size timber matches 66 run effect give @s minecraft:hunger 1 66 true -execute if score tree_size timber matches 67 run effect give @s minecraft:hunger 1 67 true -execute if score tree_size timber matches 68 run effect give @s minecraft:hunger 1 68 true -execute if score tree_size timber matches 69 run effect give @s minecraft:hunger 1 69 true -execute if score tree_size timber matches 70 run effect give @s minecraft:hunger 1 70 true -execute if score tree_size timber matches 71 run effect give @s minecraft:hunger 1 71 true -execute if score tree_size timber matches 72 run effect give @s minecraft:hunger 1 72 true -execute if score tree_size timber matches 73 run effect give @s minecraft:hunger 1 73 true -execute if score tree_size timber matches 74 run effect give @s minecraft:hunger 1 74 true -execute if score tree_size timber matches 75 run effect give @s minecraft:hunger 1 75 true -execute if score tree_size timber matches 76 run effect give @s minecraft:hunger 1 76 true -execute if score tree_size timber matches 77 run effect give @s minecraft:hunger 1 77 true -execute if score tree_size timber matches 78 run effect give @s minecraft:hunger 1 78 true -execute if score tree_size timber matches 79 run effect give @s minecraft:hunger 1 79 true -execute if score tree_size timber matches 80 run effect give @s minecraft:hunger 1 80 true -execute if score tree_size timber matches 81 run effect give @s minecraft:hunger 1 81 true -execute if score tree_size timber matches 82 run effect give @s minecraft:hunger 1 82 true -execute if score tree_size timber matches 83 run effect give @s minecraft:hunger 1 83 true -execute if score tree_size timber matches 84 run effect give @s minecraft:hunger 1 84 true -execute if score tree_size timber matches 85 run effect give @s minecraft:hunger 1 85 true -execute if score tree_size timber matches 86 run effect give @s minecraft:hunger 1 86 true -execute if score tree_size timber matches 87 run effect give @s minecraft:hunger 1 87 true -execute if score tree_size timber matches 88 run effect give @s minecraft:hunger 1 88 true -execute if score tree_size timber matches 89 run effect give @s minecraft:hunger 1 89 true -execute if score tree_size timber matches 90 run effect give @s minecraft:hunger 1 90 true -execute if score tree_size timber matches 91 run effect give @s minecraft:hunger 1 91 true -execute if score tree_size timber matches 92 run effect give @s minecraft:hunger 1 92 true -execute if score tree_size timber matches 93 run effect give @s minecraft:hunger 1 93 true -execute if score tree_size timber matches 94 run effect give @s minecraft:hunger 1 94 true -execute if score tree_size timber matches 95 run effect give @s minecraft:hunger 1 95 true -execute if score tree_size timber matches 96 run effect give @s minecraft:hunger 1 96 true -execute if score tree_size timber matches 97 run effect give @s minecraft:hunger 1 97 true -execute if score tree_size timber matches 98 run effect give @s minecraft:hunger 1 98 true -execute if score tree_size timber matches 99 run effect give @s minecraft:hunger 1 99 true -execute if score tree_size timber matches 100 run effect give @s minecraft:hunger 1 100 true -execute if score tree_size timber matches 101 run effect give @s minecraft:hunger 1 101 true -execute if score tree_size timber matches 102 run effect give @s minecraft:hunger 1 102 true -execute if score tree_size timber matches 103 run effect give @s minecraft:hunger 1 103 true -execute if score tree_size timber matches 104 run effect give @s minecraft:hunger 1 104 true -execute if score tree_size timber matches 105 run effect give @s minecraft:hunger 1 105 true -execute if score tree_size timber matches 106 run effect give @s minecraft:hunger 1 106 true -execute if score tree_size timber matches 107 run effect give @s minecraft:hunger 1 107 true -execute if score tree_size timber matches 108 run effect give @s minecraft:hunger 1 108 true -execute if score tree_size timber matches 109 run effect give @s minecraft:hunger 1 109 true -execute if score tree_size timber matches 110 run effect give @s minecraft:hunger 1 110 true -execute if score tree_size timber matches 111 run effect give @s minecraft:hunger 1 111 true -execute if score tree_size timber matches 112 run effect give @s minecraft:hunger 1 112 true -execute if score tree_size timber matches 113 run effect give @s minecraft:hunger 1 113 true -execute if score tree_size timber matches 114 run effect give @s minecraft:hunger 1 114 true -execute if score tree_size timber matches 115 run effect give @s minecraft:hunger 1 115 true -execute if score tree_size timber matches 116 run effect give @s minecraft:hunger 1 116 true -execute if score tree_size timber matches 117 run effect give @s minecraft:hunger 1 117 true -execute if score tree_size timber matches 118 run effect give @s minecraft:hunger 1 118 true -execute if score tree_size timber matches 119 run effect give @s minecraft:hunger 1 119 true -execute if score tree_size timber matches 120 run effect give @s minecraft:hunger 1 120 true -execute if score tree_size timber matches 121 run effect give @s minecraft:hunger 1 121 true -execute if score tree_size timber matches 122 run effect give @s minecraft:hunger 1 122 true -execute if score tree_size timber matches 123 run effect give @s minecraft:hunger 1 123 true -execute if score tree_size timber matches 124 run effect give @s minecraft:hunger 1 124 true -execute if score tree_size timber matches 125 run effect give @s minecraft:hunger 1 125 true -execute if score tree_size timber matches 126 run effect give @s minecraft:hunger 1 126 true -execute if score tree_size timber matches 127 run effect give @s minecraft:hunger 1 127 true -execute if score tree_size timber matches 128 run effect give @s minecraft:hunger 1 128 true -execute if score tree_size timber matches 129 run effect give @s minecraft:hunger 1 129 true -execute if score tree_size timber matches 130 run effect give @s minecraft:hunger 1 130 true -execute if score tree_size timber matches 131 run effect give @s minecraft:hunger 1 131 true -execute if score tree_size timber matches 132 run effect give @s minecraft:hunger 1 132 true -execute if score tree_size timber matches 133 run effect give @s minecraft:hunger 1 133 true -execute if score tree_size timber matches 134 run effect give @s minecraft:hunger 1 134 true -execute if score tree_size timber matches 135 run effect give @s minecraft:hunger 1 135 true -execute if score tree_size timber matches 136 run effect give @s minecraft:hunger 1 136 true -execute if score tree_size timber matches 137 run effect give @s minecraft:hunger 1 137 true -execute if score tree_size timber matches 138 run effect give @s minecraft:hunger 1 138 true -execute if score tree_size timber matches 139 run effect give @s minecraft:hunger 1 139 true -execute if score tree_size timber matches 140 run effect give @s minecraft:hunger 1 140 true -execute if score tree_size timber matches 141 run effect give @s minecraft:hunger 1 141 true -execute if score tree_size timber matches 142 run effect give @s minecraft:hunger 1 142 true -execute if score tree_size timber matches 143 run effect give @s minecraft:hunger 1 143 true -execute if score tree_size timber matches 144 run effect give @s minecraft:hunger 1 144 true -execute if score tree_size timber matches 145 run effect give @s minecraft:hunger 1 145 true -execute if score tree_size timber matches 146 run effect give @s minecraft:hunger 1 146 true -execute if score tree_size timber matches 147 run effect give @s minecraft:hunger 1 147 true -execute if score tree_size timber matches 148 run effect give @s minecraft:hunger 1 148 true -execute if score tree_size timber matches 149 run effect give @s minecraft:hunger 1 149 true -execute if score tree_size timber matches 150 run effect give @s minecraft:hunger 1 150 true -execute if score tree_size timber matches 151 run effect give @s minecraft:hunger 1 151 true -execute if score tree_size timber matches 152 run effect give @s minecraft:hunger 1 152 true -execute if score tree_size timber matches 153 run effect give @s minecraft:hunger 1 153 true -execute if score tree_size timber matches 154 run effect give @s minecraft:hunger 1 154 true -execute if score tree_size timber matches 155 run effect give @s minecraft:hunger 1 155 true -execute if score tree_size timber matches 156 run effect give @s minecraft:hunger 1 156 true -execute if score tree_size timber matches 157 run effect give @s minecraft:hunger 1 157 true -execute if score tree_size timber matches 158 run effect give @s minecraft:hunger 1 158 true -execute if score tree_size timber matches 159 run effect give @s minecraft:hunger 1 159 true -execute if score tree_size timber matches 160 run effect give @s minecraft:hunger 1 160 true -execute if score tree_size timber matches 161 run effect give @s minecraft:hunger 1 161 true -execute if score tree_size timber matches 162 run effect give @s minecraft:hunger 1 162 true -execute if score tree_size timber matches 163 run effect give @s minecraft:hunger 1 163 true -execute if score tree_size timber matches 164 run effect give @s minecraft:hunger 1 164 true -execute if score tree_size timber matches 165 run effect give @s minecraft:hunger 1 165 true -execute if score tree_size timber matches 166 run effect give @s minecraft:hunger 1 166 true -execute if score tree_size timber matches 167 run effect give @s minecraft:hunger 1 167 true -execute if score tree_size timber matches 168 run effect give @s minecraft:hunger 1 168 true -execute if score tree_size timber matches 169 run effect give @s minecraft:hunger 1 169 true -execute if score tree_size timber matches 170 run effect give @s minecraft:hunger 1 170 true -execute if score tree_size timber matches 171 run effect give @s minecraft:hunger 1 171 true -execute if score tree_size timber matches 172 run effect give @s minecraft:hunger 1 172 true -execute if score tree_size timber matches 173 run effect give @s minecraft:hunger 1 173 true -execute if score tree_size timber matches 174 run effect give @s minecraft:hunger 1 174 true -execute if score tree_size timber matches 175 run effect give @s minecraft:hunger 1 175 true -execute if score tree_size timber matches 176 run effect give @s minecraft:hunger 1 176 true -execute if score tree_size timber matches 177 run effect give @s minecraft:hunger 1 177 true -execute if score tree_size timber matches 178 run effect give @s minecraft:hunger 1 178 true -execute if score tree_size timber matches 179 run effect give @s minecraft:hunger 1 179 true -execute if score tree_size timber matches 180 run effect give @s minecraft:hunger 1 180 true -execute if score tree_size timber matches 181 run effect give @s minecraft:hunger 1 181 true -execute if score tree_size timber matches 182 run effect give @s minecraft:hunger 1 182 true -execute if score tree_size timber matches 183 run effect give @s minecraft:hunger 1 183 true -execute if score tree_size timber matches 184 run effect give @s minecraft:hunger 1 184 true -execute if score tree_size timber matches 185 run effect give @s minecraft:hunger 1 185 true -execute if score tree_size timber matches 186 run effect give @s minecraft:hunger 1 186 true -execute if score tree_size timber matches 187 run effect give @s minecraft:hunger 1 187 true -execute if score tree_size timber matches 188 run effect give @s minecraft:hunger 1 188 true -execute if score tree_size timber matches 189 run effect give @s minecraft:hunger 1 189 true -execute if score tree_size timber matches 190 run effect give @s minecraft:hunger 1 190 true -execute if score tree_size timber matches 191 run effect give @s minecraft:hunger 1 191 true -execute if score tree_size timber matches 192 run effect give @s minecraft:hunger 1 192 true -execute if score tree_size timber matches 193 run effect give @s minecraft:hunger 1 193 true -execute if score tree_size timber matches 194 run effect give @s minecraft:hunger 1 194 true -execute if score tree_size timber matches 195 run effect give @s minecraft:hunger 1 195 true -execute if score tree_size timber matches 196 run effect give @s minecraft:hunger 1 196 true -execute if score tree_size timber matches 197 run effect give @s minecraft:hunger 1 197 true -execute if score tree_size timber matches 198 run effect give @s minecraft:hunger 1 198 true -execute if score tree_size timber matches 199 run effect give @s minecraft:hunger 1 199 true -execute if score tree_size timber matches 200 run effect give @s minecraft:hunger 1 200 true -execute if score tree_size timber matches 201 run effect give @s minecraft:hunger 1 201 true -execute if score tree_size timber matches 202 run effect give @s minecraft:hunger 1 202 true -execute if score tree_size timber matches 203 run effect give @s minecraft:hunger 1 203 true -execute if score tree_size timber matches 204 run effect give @s minecraft:hunger 1 204 true -execute if score tree_size timber matches 205 run effect give @s minecraft:hunger 1 205 true -execute if score tree_size timber matches 206 run effect give @s minecraft:hunger 1 206 true -execute if score tree_size timber matches 207 run effect give @s minecraft:hunger 1 207 true -execute if score tree_size timber matches 208 run effect give @s minecraft:hunger 1 208 true -execute if score tree_size timber matches 209 run effect give @s minecraft:hunger 1 209 true -execute if score tree_size timber matches 210 run effect give @s minecraft:hunger 1 210 true -execute if score tree_size timber matches 211 run effect give @s minecraft:hunger 1 211 true -execute if score tree_size timber matches 212 run effect give @s minecraft:hunger 1 212 true -execute if score tree_size timber matches 213 run effect give @s minecraft:hunger 1 213 true -execute if score tree_size timber matches 214 run effect give @s minecraft:hunger 1 214 true -execute if score tree_size timber matches 215 run effect give @s minecraft:hunger 1 215 true -execute if score tree_size timber matches 216 run effect give @s minecraft:hunger 1 216 true -execute if score tree_size timber matches 217 run effect give @s minecraft:hunger 1 217 true -execute if score tree_size timber matches 218 run effect give @s minecraft:hunger 1 218 true -execute if score tree_size timber matches 219 run effect give @s minecraft:hunger 1 219 true -execute if score tree_size timber matches 220 run effect give @s minecraft:hunger 1 220 true -execute if score tree_size timber matches 221 run effect give @s minecraft:hunger 1 221 true -execute if score tree_size timber matches 222 run effect give @s minecraft:hunger 1 222 true -execute if score tree_size timber matches 223 run effect give @s minecraft:hunger 1 223 true -execute if score tree_size timber matches 224 run effect give @s minecraft:hunger 1 224 true -execute if score tree_size timber matches 225 run effect give @s minecraft:hunger 1 225 true -execute if score tree_size timber matches 226 run effect give @s minecraft:hunger 1 226 true -execute if score tree_size timber matches 227 run effect give @s minecraft:hunger 1 227 true -execute if score tree_size timber matches 228 run effect give @s minecraft:hunger 1 228 true -execute if score tree_size timber matches 229 run effect give @s minecraft:hunger 1 229 true -execute if score tree_size timber matches 230 run effect give @s minecraft:hunger 1 230 true -execute if score tree_size timber matches 231 run effect give @s minecraft:hunger 1 231 true -execute if score tree_size timber matches 232 run effect give @s minecraft:hunger 1 232 true -execute if score tree_size timber matches 233 run effect give @s minecraft:hunger 1 233 true -execute if score tree_size timber matches 234 run effect give @s minecraft:hunger 1 234 true -execute if score tree_size timber matches 235 run effect give @s minecraft:hunger 1 235 true -execute if score tree_size timber matches 236 run effect give @s minecraft:hunger 1 236 true -execute if score tree_size timber matches 237 run effect give @s minecraft:hunger 1 237 true -execute if score tree_size timber matches 238 run effect give @s minecraft:hunger 1 238 true -execute if score tree_size timber matches 239 run effect give @s minecraft:hunger 1 239 true -execute if score tree_size timber matches 240 run effect give @s minecraft:hunger 1 240 true -execute if score tree_size timber matches 241 run effect give @s minecraft:hunger 1 241 true -execute if score tree_size timber matches 242 run effect give @s minecraft:hunger 1 242 true -execute if score tree_size timber matches 243 run effect give @s minecraft:hunger 1 243 true -execute if score tree_size timber matches 244 run effect give @s minecraft:hunger 1 244 true -execute if score tree_size timber matches 245 run effect give @s minecraft:hunger 1 245 true -execute if score tree_size timber matches 246 run effect give @s minecraft:hunger 1 246 true -execute if score tree_size timber matches 247 run effect give @s minecraft:hunger 1 247 true -execute if score tree_size timber matches 248 run effect give @s minecraft:hunger 1 248 true -execute if score tree_size timber matches 249 run effect give @s minecraft:hunger 1 249 true -execute if score tree_size timber matches 250 run effect give @s minecraft:hunger 1 250 true -execute if score tree_size timber matches 251 run effect give @s minecraft:hunger 1 251 true -execute if score tree_size timber matches 252 run effect give @s minecraft:hunger 1 252 true -execute if score tree_size timber matches 253 run effect give @s minecraft:hunger 1 253 true -execute if score tree_size timber matches 254 run effect give @s minecraft:hunger 1 254 true -execute if score tree_size timber matches 255.. run effect give @s minecraft:hunger 1 255 true \ No newline at end of file diff --git a/18-41/data/timber/functions/utils/reset.mcfunction b/18-41/data/timber/functions/utils/reset.mcfunction deleted file mode 100644 index 3b6df1c..0000000 --- a/18-41/data/timber/functions/utils/reset.mcfunction +++ /dev/null @@ -1,24 +0,0 @@ -scoreboard players set running timber 0 - -# reset scores -scoreboard players set @s timber_w_axe 0 -scoreboard players set @s timber_s_axe 0 -scoreboard players set @s timber_i_axe 0 -scoreboard players set @s timber_g_axe 0 -scoreboard players set @s timber_d_axe 0 -scoreboard players set @s timber_n_axe 0 - -# remove markers -execute if score chop_fungi timber matches 1.. run kill @e[type=minecraft:item,nbt={Item:{components:{"minecraft:custom_data":{Tags:["timber_location"]}}}}] -#execute if score chop_fungi timber matches 1.. run clear @s knowledge_book{Tags:[timber_location]} -kill @e[type=minecraft:marker,tag=timber_tree,tag=!timber_slow_chop] -kill @e[type=minecraft:marker,tag=timber_log,tag=!timber_destroy] -kill @e[type=minecraft:marker,tag=timber_leaf,tag=!timber_destroy] -kill @e[type=minecraft:marker,tag=timber_root,tag=!timber_destroy] -kill @e[type=minecraft:marker,tag=timber_stem,tag=!timber_destroy] -kill @e[type=minecraft:marker,tag=timber_cap,tag=!timber_destroy] -kill @e[type=minecraft:marker,tag=timber_leaves_found] -kill @e[type=minecraft:marker,tag=timber_leaf_distance] -kill @e[type=minecraft:marker,tag=timber_other_stem] - -kill @e[type=minecraft:armor_stand,tag=timber_item_check] \ No newline at end of file diff --git a/18-41/data/timber/functions/utils/sneaking.mcfunction b/18-41/data/timber/functions/utils/sneaking.mcfunction deleted file mode 100644 index 1a6478b..0000000 --- a/18-41/data/timber/functions/utils/sneaking.mcfunction +++ /dev/null @@ -1,3 +0,0 @@ -# standing or sneaking enabled? -execute if score standing timber matches 1.. unless predicate timber:sneaking run function timber:run -execute if score sneaking timber matches 1.. if predicate timber:sneaking run function timber:run \ No newline at end of file diff --git a/18-41/data/timber/functions/utils/stopsound.mcfunction b/18-41/data/timber/functions/utils/stopsound.mcfunction deleted file mode 100644 index b9d5f78..0000000 --- a/18-41/data/timber/functions/utils/stopsound.mcfunction +++ /dev/null @@ -1,6 +0,0 @@ -stopsound @s block minecraft:block.grass.break -stopsound @s block minecraft:block.wood.break -stopsound @s block minecraft:block.wart_block.break -stopsound @s block minecraft:block.shroomlight.break -stopsound @s block minecraft:block.nether_wart.break -stopsound @s block minecraft:block.stem.break \ No newline at end of file diff --git a/18-41/data/timber/functions/utils/tp_item.mcfunction b/18-41/data/timber/functions/utils/tp_item.mcfunction deleted file mode 100644 index a01d4e1..0000000 --- a/18-41/data/timber/functions/utils/tp_item.mcfunction +++ /dev/null @@ -1,9 +0,0 @@ -# tp hand-broken loot into inventory - -tp @e[type=minecraft:item,sort=nearest,limit=1] @s - -#setblock ~ 255 ~ minecraft:yellow_shulker_box -#data modify block ~ 255 ~ Items append from entity @e[type=minecraft:item,sort=nearest,limit=1] Item -#kill @e[type=minecraft:item,sort=nearest,limit=1] -#loot give @s mine ~ 255 ~ minecraft:air{drop_contents:1b} -#setblock ~ 255 ~ minecraft:air \ No newline at end of file diff --git a/18-41/data/timber/functions/utils/used_axe.mcfunction b/18-41/data/timber/functions/utils/used_axe.mcfunction deleted file mode 100644 index 5e7f9b6..0000000 --- a/18-41/data/timber/functions/utils/used_axe.mcfunction +++ /dev/null @@ -1,18 +0,0 @@ -# is this axe enabled? -execute unless score @s timber_disabled matches 1.. if score @s timber_w_axe matches 1.. if score wooden_axe timber matches 1.. run function timber:utils/sneaking -execute unless score @s timber_disabled matches 1.. if score @s timber_s_axe matches 1.. if score stone_axe timber matches 1.. run function timber:utils/sneaking -execute unless score @s timber_disabled matches 1.. if score @s timber_i_axe matches 1.. if score iron_axe timber matches 1.. run function timber:utils/sneaking -execute unless score @s timber_disabled matches 1.. if score @s timber_g_axe matches 1.. if score golden_axe timber matches 1.. run function timber:utils/sneaking -execute unless score @s timber_disabled matches 1.. if score @s timber_d_axe matches 1.. if score diamond_axe timber matches 1.. run function timber:utils/sneaking -execute unless score @s timber_disabled matches 1.. if score @s timber_n_axe matches 1.. if score netherite_axe timber matches 1.. run function timber:utils/sneaking - -# remove mushroom_stem marker -kill @e[type=minecraft:item,distance=..7,nbt={Item:{components:{"minecraft:custom_data":{Tags:["timber_location"]}}}}] - -# reset scores -scoreboard players set @s timber_w_axe 0 -scoreboard players set @s timber_s_axe 0 -scoreboard players set @s timber_i_axe 0 -scoreboard players set @s timber_g_axe 0 -scoreboard players set @s timber_d_axe 0 -scoreboard players set @s timber_n_axe 0 \ No newline at end of file diff --git a/18-41/data/timber/functions/validated.mcfunction b/18-41/data/timber/functions/validated.mcfunction deleted file mode 100644 index b00df5e..0000000 --- a/18-41/data/timber/functions/validated.mcfunction +++ /dev/null @@ -1,51 +0,0 @@ -# when full inventory fix -execute if score drop_loot timber matches 1.. store result score inventory timber run data get entity @s Inventory -execute if score drop_loot timber matches 1.. if entity @s[nbt={Inventory:[{Slot:100b}]}] run scoreboard players remove inventory timber 1 -execute if score drop_loot timber matches 1.. if entity @s[nbt={Inventory:[{Slot:101b}]}] run scoreboard players remove inventory timber 1 -execute if score drop_loot timber matches 1.. if entity @s[nbt={Inventory:[{Slot:102b}]}] run scoreboard players remove inventory timber 1 -execute if score drop_loot timber matches 1.. if entity @s[nbt={Inventory:[{Slot:103b}]}] run scoreboard players remove inventory timber 1 -execute if score drop_loot timber matches 1.. if entity @s[nbt={Inventory:[{Slot:-106b}]}] run scoreboard players remove inventory timber 1 - -# destroy blocks - # mark blocks that need to be destroyed - tag @e[type=minecraft:marker,tag=timber_log] add timber_destroy - execute if score destroy_leaves timber matches 1.. run tag @e[type=minecraft:marker,tag=timber_leaf] add timber_destroy - execute if score destroy_roots timber matches 1.. run tag @e[type=minecraft:marker,tag=timber_root] 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_root] run function #timber:api/break_root - 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 (doTileDrops can be changed, because datapack wouldn't get to this point otherwise) - 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 ~ -64 ~ {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=-64,distance=...1,sort=arbitrary,limit=1] HandItems[0] 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 \ No newline at end of file diff --git a/18-41/data/timber/item_modifiers/wear_out.json b/18-41/data/timber/item_modifiers/wear_out.json deleted file mode 100644 index 63fd89d..0000000 --- a/18-41/data/timber/item_modifiers/wear_out.json +++ /dev/null @@ -1,152 +0,0 @@ -[ - { - "function": "minecraft:set_damage", - "damage": { - "type": "minecraft:score", - "target": { - "type": "minecraft:fixed", - "name": "damage" - }, - "score": "timber", - "scale": 0.01694915254237288 - }, - "conditions": [ - { - "condition": "minecraft:entity_properties", - "entity": "this", - "predicate": { - "equipment": { - "mainhand": { - "items": "minecraft:wooden_axe" - } - } - } - } - ] - }, - { - "function": "minecraft:set_damage", - "damage": { - "type": "minecraft:score", - "target": { - "type": "minecraft:fixed", - "name": "damage" - }, - "score": "timber", - "scale": 0.007633587786259542 - }, - "conditions": [ - { - "condition": "minecraft:entity_properties", - "entity": "this", - "predicate": { - "equipment": { - "mainhand": { - "items": "minecraft:stone_axe" - } - } - } - } - ] - }, - { - "function": "minecraft:set_damage", - "damage": { - "type": "minecraft:score", - "target": { - "type": "minecraft:fixed", - "name": "damage" - }, - "score": "timber", - "scale": 0.004 - }, - "conditions": [ - { - "condition": "minecraft:entity_properties", - "entity": "this", - "predicate": { - "equipment": { - "mainhand": { - "items": "minecraft:iron_axe" - } - } - } - } - ] - }, - { - "function": "minecraft:set_damage", - "damage": { - "type": "minecraft:score", - "target": { - "type": "minecraft:fixed", - "name": "damage" - }, - "score": "timber", - "scale": 0.03125 - }, - "conditions": [ - { - "condition": "minecraft:entity_properties", - "entity": "this", - "predicate": { - "equipment": { - "mainhand": { - "items": "minecraft:golden_axe" - } - } - } - } - ] - }, - { - "function": "minecraft:set_damage", - "damage": { - "type": "minecraft:score", - "target": { - "type": "minecraft:fixed", - "name": "damage" - }, - "score": "timber", - "scale": 0.0006393861892583121 - }, - "conditions": [ - { - "condition": "minecraft:entity_properties", - "entity": "this", - "predicate": { - "equipment": { - "mainhand": { - "items": "minecraft:diamond_axe" - } - } - } - } - ] - }, - { - "function": "minecraft:set_damage", - "damage": { - "type": "minecraft:score", - "target": { - "type": "minecraft:fixed", - "name": "damage" - }, - "score": "timber", - "scale": 0.0004923682914820286 - }, - "conditions": [ - { - "condition": "minecraft:entity_properties", - "entity": "this", - "predicate": { - "equipment": { - "mainhand": { - "items": "minecraft:netherite_axe" - } - } - } - } - ] - } -] \ No newline at end of file diff --git a/18-41/data/timber/predicates/block/cap.json b/18-41/data/timber/predicates/block/cap.json deleted file mode 100644 index 807ada7..0000000 --- a/18-41/data/timber/predicates/block/cap.json +++ /dev/null @@ -1,37 +0,0 @@ -{ - "condition": "minecraft:any_of", - "terms": [ - { - "condition": "minecraft:location_check", - "predicate": { - "block": { - "blocks": "#minecraft:wart_blocks" - } - } - }, - { - "condition": "minecraft:location_check", - "predicate": { - "block": { - "blocks": "minecraft:shroomlight" - } - } - }, - { - "condition": "minecraft:location_check", - "predicate": { - "block": { - "blocks": "minecraft:brown_mushroom_block" - } - } - }, - { - "condition": "minecraft:location_check", - "predicate": { - "block": { - "blocks": "minecraft:red_mushroom_block" - } - } - } - ] -} \ No newline at end of file diff --git a/18-41/data/timber/predicates/block/leaf.json b/18-41/data/timber/predicates/block/leaf.json deleted file mode 100644 index 14d5368..0000000 --- a/18-41/data/timber/predicates/block/leaf.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "condition": "minecraft:any_of", - "terms": [ - { - "condition": "minecraft:location_check", - "predicate": { - "block": { - "blocks": "#minecraft:leaves" - } - } - }, - { - "condition": "minecraft:location_check", - "predicate": { - "block": { - "blocks": "minecraft:mangrove_propagule", - "state": { - "hanging": "true" - } - } - } - } - ] -} \ No newline at end of file diff --git a/18-41/data/timber/predicates/block/log.json b/18-41/data/timber/predicates/block/log.json deleted file mode 100644 index 3b960aa..0000000 --- a/18-41/data/timber/predicates/block/log.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "condition": "minecraft:location_check", - "predicate": { - "block": { - "blocks": "#minecraft:logs" - } - } -} diff --git a/18-41/data/timber/predicates/block/stem.json b/18-41/data/timber/predicates/block/stem.json deleted file mode 100644 index 591f3db..0000000 --- a/18-41/data/timber/predicates/block/stem.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "condition": "minecraft:any_of", - "terms": [ - { - "condition": "minecraft:location_check", - "predicate": { - "block": { - "blocks": "#minecraft:logs" - } - } - }, - { - "condition": "minecraft:location_check", - "predicate": { - "block": { - "blocks": "minecraft:mushroom_stem" - } - } - } - ] -} \ No newline at end of file diff --git a/18-41/data/timber/predicates/item/log.json b/18-41/data/timber/predicates/item/log.json deleted file mode 100644 index 7fea675..0000000 --- a/18-41/data/timber/predicates/item/log.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "condition": "minecraft:entity_properties", - "entity": "this", - "predicate": { - "equipment": { - "mainhand": { - "items": "#minecraft:logs" - } - } - } -} \ No newline at end of file diff --git a/18-41/data/timber/predicates/item/root.json b/18-41/data/timber/predicates/item/root.json deleted file mode 100644 index f746554..0000000 --- a/18-41/data/timber/predicates/item/root.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "condition": "minecraft:entity_properties", - "entity": "this", - "predicate": { - "equipment": { - "mainhand": { - "items": "minecraft:mangrove_roots" - } - } - } -} \ No newline at end of file diff --git a/18-41/data/timber/predicates/item/sapling.json b/18-41/data/timber/predicates/item/sapling.json deleted file mode 100644 index 31bd5c7..0000000 --- a/18-41/data/timber/predicates/item/sapling.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "condition": "minecraft:entity_properties", - "entity": "this", - "predicate": { - "equipment": { - "mainhand": { - "items": "#minecraft:saplings" - } - } - } -} \ No newline at end of file diff --git a/18-41/data/timber/predicates/item/stem.json b/18-41/data/timber/predicates/item/stem.json deleted file mode 100644 index 43b5e29..0000000 --- a/18-41/data/timber/predicates/item/stem.json +++ /dev/null @@ -1,45 +0,0 @@ -{ - "condition": "minecraft:any_of", - "terms": [ - { - "condition": "minecraft:entity_properties", - "entity": "this", - "predicate": { - "equipment": { - "mainhand": { - "items": "#minecraft:logs" - } - } - } - }, - { - "condition": "minecraft:entity_properties", - "entity": "this", - "predicate": { - "equipment": { - "mainhand": { - "items": "minecraft:mushroom_stem" - } - } - } - }, - { - "condition": "minecraft:entity_properties", - "entity": "this", - "predicate": { - "equipment": { - "mainhand": { - "items": "minecraft:knowledge_book", - "components": { - "minecraft:custom_data": { - "Tags": [ - "timber_location" - ] - } - } - } - } - } - } - ] -} \ No newline at end of file diff --git a/18-41/data/timber/predicates/random_chance/0.25.json b/18-41/data/timber/predicates/random_chance/0.25.json deleted file mode 100644 index 9740f91..0000000 --- a/18-41/data/timber/predicates/random_chance/0.25.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "condition": "minecraft:random_chance", - "chance": 0.25 - } \ No newline at end of file diff --git a/18-41/data/timber/predicates/random_chance/0.333.json b/18-41/data/timber/predicates/random_chance/0.333.json deleted file mode 100644 index 52e5ecf..0000000 --- a/18-41/data/timber/predicates/random_chance/0.333.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "condition": "minecraft:random_chance", - "chance": 0.333 - } \ No newline at end of file diff --git a/18-41/data/timber/predicates/random_chance/0.5.json b/18-41/data/timber/predicates/random_chance/0.5.json deleted file mode 100644 index 66c2b14..0000000 --- a/18-41/data/timber/predicates/random_chance/0.5.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "condition": "minecraft:random_chance", - "chance": 0.5 - } \ No newline at end of file diff --git a/18-41/data/timber/predicates/sneaking.json b/18-41/data/timber/predicates/sneaking.json deleted file mode 100644 index a41c89c..0000000 --- a/18-41/data/timber/predicates/sneaking.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "condition": "minecraft:entity_properties", - "entity": "this", - "predicate": { - "flags": { - "is_sneaking": true - } - } -} \ No newline at end of file diff --git a/18-41/data/timber/predicates/used_axe.json b/18-41/data/timber/predicates/used_axe.json deleted file mode 100644 index ac00bc4..0000000 --- a/18-41/data/timber/predicates/used_axe.json +++ /dev/null @@ -1,59 +0,0 @@ -{ - "condition": "minecraft:any_of", - "terms": [ - { - "condition": "minecraft:entity_scores", - "entity": "this", - "scores": { - "timber_w_axe": { - "min": 1 - } - } - }, - { - "condition": "minecraft:entity_scores", - "entity": "this", - "scores": { - "timber_s_axe": { - "min": 1 - } - } - }, - { - "condition": "minecraft:entity_scores", - "entity": "this", - "scores": { - "timber_i_axe": { - "min": 1 - } - } - }, - { - "condition": "minecraft:entity_scores", - "entity": "this", - "scores": { - "timber_g_axe": { - "min": 1 - } - } - }, - { - "condition": "minecraft:entity_scores", - "entity": "this", - "scores": { - "timber_d_axe": { - "min": 1 - } - } - }, - { - "condition": "minecraft:entity_scores", - "entity": "this", - "scores": { - "timber_n_axe": { - "min": 1 - } - } - } - ] -} \ No newline at end of file diff --git a/18-41/data/timber/tags/functions/api/break_cap.json b/18-41/data/timber/tags/functions/api/break_cap.json deleted file mode 100644 index ab3fce9..0000000 --- a/18-41/data/timber/tags/functions/api/break_cap.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "values":[ - ] -} \ No newline at end of file diff --git a/18-41/data/timber/tags/functions/api/break_leaf.json b/18-41/data/timber/tags/functions/api/break_leaf.json deleted file mode 100644 index ab3fce9..0000000 --- a/18-41/data/timber/tags/functions/api/break_leaf.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "values":[ - ] -} \ No newline at end of file diff --git a/18-41/data/timber/tags/functions/api/break_log.json b/18-41/data/timber/tags/functions/api/break_log.json deleted file mode 100644 index ab3fce9..0000000 --- a/18-41/data/timber/tags/functions/api/break_log.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "values":[ - ] -} \ No newline at end of file diff --git a/18-41/data/timber/tags/functions/api/break_root.json b/18-41/data/timber/tags/functions/api/break_root.json deleted file mode 100644 index ab3fce9..0000000 --- a/18-41/data/timber/tags/functions/api/break_root.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "values":[ - ] -} \ No newline at end of file diff --git a/18-41/data/timber/tags/functions/api/break_stem.json b/18-41/data/timber/tags/functions/api/break_stem.json deleted file mode 100644 index ab3fce9..0000000 --- a/18-41/data/timber/tags/functions/api/break_stem.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "values":[ - ] -} \ No newline at end of file diff --git a/18-41/data/timber/tags/functions/help.json b/18-41/data/timber/tags/functions/help.json deleted file mode 100644 index 082ff6b..0000000 --- a/18-41/data/timber/tags/functions/help.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "values":[ - "timber:help" - ] -} \ No newline at end of file diff --git a/18-41/data/timber/tags/items/axes.json b/18-41/data/timber/tags/items/axes.json deleted file mode 100644 index c496215..0000000 --- a/18-41/data/timber/tags/items/axes.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "values":[ - "minecraft:wooden_axe", - "minecraft:stone_axe", - "minecraft:iron_axe", - "minecraft:golden_axe", - "minecraft:diamond_axe", - "minecraft:netherite_axe" - ] -} \ No newline at end of file diff --git a/18-61/data/timber/function/algorithm/fungus/run.mcfunction b/18-61/data/timber/function/algorithm/fungus/run.mcfunction deleted file mode 100644 index 6db2dbe..0000000 --- a/18-61/data/timber/function/algorithm/fungus/run.mcfunction +++ /dev/null @@ -1,5 +0,0 @@ -# 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] HandItems[0] 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] \ No newline at end of file diff --git a/18-61/data/timber/function/algorithm/tree/run.mcfunction b/18-61/data/timber/function/algorithm/tree/run.mcfunction deleted file mode 100644 index 172c583..0000000 --- a/18-61/data/timber/function/algorithm/tree/run.mcfunction +++ /dev/null @@ -1,6 +0,0 @@ -# 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] HandItems[0] 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 -execute if score start_chop_on_root timber matches 1.. if entity @e[type=minecraft:armor_stand,tag=timber_item_check,distance=...1,sort=arbitrary,limit=1,predicate=timber:item/root] run function timber:algorithm/tree/chop_roots -kill @e[type=minecraft:armor_stand,tag=timber_item_check,distance=...1,sort=arbitrary,limit=1] diff --git a/18-61/data/timber/function/autoplant/validate.mcfunction b/18-61/data/timber/function/autoplant/validate.mcfunction deleted file mode 100644 index e84bccf..0000000 --- a/18-61/data/timber/function/autoplant/validate.mcfunction +++ /dev/null @@ -1,8 +0,0 @@ -# don't check items twice (except saplings, look in plant.mcfunction) -tag @s add timber_checked - -# check if item is in tag #minecraft:sapling -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] HandItems[0] set from entity @s Item -execute if entity @e[type=minecraft:armor_stand,tag=timber_item_check,distance=...1,sort=arbitrary,limit=1,predicate=timber:item/sapling] run function timber:autoplant/plant -kill @e[type=minecraft:armor_stand,tag=timber_item_check,distance=...1,sort=arbitrary,limit=1] \ No newline at end of file diff --git a/18-61/data/timber/function/help.mcfunction b/18-61/data/timber/function/help.mcfunction deleted file mode 100644 index 6051b57..0000000 --- a/18-61/data/timber/function/help.mcfunction +++ /dev/null @@ -1,25 +0,0 @@ -tellraw @s ["",{"text":"\u00A7m ","color":"dark_gray"}] - -tellraw @s ["",{"text":" Timber Datapack"}] - -tellraw @s ["",{"text":"\u00A7m ","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","clickEvent":{"action":"suggest_command","value":"/trigger TimberToggle"}},{"text":" to individually turn the datapack on or off."}] - -tellraw @s [""] - -tellraw @s ["",{"text":"Snapshot (work in progress) version"}] - -tellraw @s [""] - -tellraw @s [""," ",{"text":"[click here to see the settings]","color":"gold","clickEvent":{"action":"run_command","value":"/function timber:settings/settings1_click"}}] - -tellraw @s ["",{"text":"\u00A7m ","color":"dark_gray"}] - -function timber:settings/end_of_message \ No newline at end of file diff --git a/18-61/data/timber/function/init.mcfunction b/18-61/data/timber/function/init.mcfunction deleted file mode 100644 index 1d2cbf0..0000000 --- a/18-61/data/timber/function/init.mcfunction +++ /dev/null @@ -1,39 +0,0 @@ -# longer maxCommandChainLength -gamerule maxCommandChainLength 1000000000 - -# create scoreboards -scoreboard objectives add timber_w_axe minecraft.used:minecraft.wooden_axe -scoreboard objectives add timber_s_axe minecraft.used:minecraft.stone_axe -scoreboard objectives add timber_i_axe minecraft.used:minecraft.iron_axe -scoreboard objectives add timber_g_axe minecraft.used:minecraft.golden_axe -scoreboard objectives add timber_d_axe minecraft.used:minecraft.diamond_axe -scoreboard objectives add timber_n_axe minecraft.used:minecraft.netherite_axe -scoreboard objectives add timber dummy -scoreboard objectives add TimberToggle trigger {"text":"Timber Toggle","color":"#724E21"} -scoreboard objectives add timber_disabled dummy -scoreboard objectives add timber_prsistent dummy - -# non-overriding default values -function timber:settings/default_values -function timber:tool/durability_max -scoreboard players set running timber 0 - -# start optional loops -execute if score plant_sapling timber matches 1.. run function timber:autoplant/loop -execute if score slow_chop timber matches 1.. run function timber:slow_chop/loop - -# check loottable compatibility of mushroom stem -setblock ~ 255 ~ minecraft:chest -setblock ~ 255 ~1 minecraft:mushroom_stem -loot insert ~ 255 ~ mine ~ 255 ~1 minecraft:diamond_axe -execute unless data block ~ 255 ~ Items[{id:"minecraft:knowledge_book",components:{"minecraft:custom_data":{Tags:["timber_location"]}}}] run tellraw @a[tag=!noTimberWarning] ["",{"text":"Timber Datapack Warning: ","color":"red"},{"text":"Incompatibility with the mushroom_stem loottable of another datapack!"}] -fill ~-1 255 ~-1 ~1 255 ~1 minecraft:air -execute store result score doTileDrops timber run gamerule doTileDrops -execute if score doTileDrops timber matches 0 run tellraw @a[tag=!noTimberWarning] ["",{"text":"Timber Datapack Warning: ","color":"red"},{"text":"This datapack only works when gamerule doTileDrops is set to true!"}] - -# Getting the game version and checking if it is compatible with the datapack https://minecraft.fandom.com/wiki/Data_version -execute store result score game_version timber run data get entity @r DataVersion -execute if score game_version timber matches ..3442 run tellraw @a[tag=!noTimberWarning] ["",{"text":"Timber Datapack Warning: ","color":"red"},{"text":"This datapack is not compatible with all the versions before 1.20!"}] - -# Checking if the server uses a different jar from the vanilla one -function timber:utils/check_server \ No newline at end of file diff --git a/18-61/data/timber/function/settings/settings1.mcfunction b/18-61/data/timber/function/settings/settings1.mcfunction deleted file mode 100644 index 140256c..0000000 --- a/18-61/data/timber/function/settings/settings1.mcfunction +++ /dev/null @@ -1,57 +0,0 @@ -tellraw @s ["",{"text":" "}] -tellraw @s ["",{"text":" "}] -tellraw @s ["",{"text":" "}] -tellraw @s ["",{"text":" "}] - -tellraw @s ["",{"text":"\u00A7m ","color":"dark_gray"}] - -tellraw @s ["",{"text":" Timber "},{"text":"/","color":"gray"},{"text":" Global Settings "},{"text":" < ","clickEvent":{"action":"run_command","value":"/function timber:settings/settings1_click"}},{"text":"1/2"},{"text":" > ","clickEvent":{"action":"run_command","value":"/function timber:settings/settings2_click"}}] - -tellraw @s ["",{"text":"\u00A7m ","color":"dark_gray"}] - -execute if score standing timber matches 1.. run tellraw @s ["",{"text":"[ ✔ ]","color":"green","clickEvent":{"action":"run_command","value":"/function timber:settings/toggle/standing"}},{"text":" Works When Standing"}] -execute unless score standing timber matches 1.. run tellraw @s ["",{"text":"[ ❌ ]","color":"red","clickEvent":{"action":"run_command","value":"/function timber:settings/toggle/standing"}},{"text":" Works When Standing"}] - -execute if score sneaking timber matches 1.. run tellraw @s ["",{"text":"[ ✔ ]","color":"green","clickEvent":{"action":"run_command","value":"/function timber:settings/toggle/sneaking"}},{"text":" Works When Sneaking"}] -execute unless score sneaking timber matches 1.. run tellraw @s ["",{"text":"[ ❌ ]","color":"red","clickEvent":{"action":"run_command","value":"/function timber:settings/toggle/sneaking"}},{"text":" Works When Sneaking"}] - -execute if score destroy_leaves timber matches 1.. run tellraw @s ["",{"text":"[ ✔ ]","color":"green","clickEvent":{"action":"run_command","value":"/function timber:settings/toggle/destroy_leaves"}},{"text":" Destroy Leaves"}] -execute unless score destroy_leaves timber matches 1.. run tellraw @s ["",{"text":"[ ❌ ]","color":"red","clickEvent":{"action":"run_command","value":"/function timber:settings/toggle/destroy_leaves"}},{"text":" Destroy Leaves"}] - -execute if score plant_sapling timber matches 1.. run tellraw @s ["",{"text":"[ ✔ ]","color":"green","clickEvent":{"action":"run_command","value":"/function timber:settings/toggle/plant_sapling"}},{"text":" Auto Plant Saplings","hoverEvent":{"action":"show_text","value":["",{"text":"All kind of saplings laying on the ground will get planted every 2 seconds."},{"text":"\n\nWhen a sapling get placed on mud, it turns into muddy mangrove roots for a fraction of a second due to datapack limitations.","color":"gray"}]}}] -execute unless score plant_sapling timber matches 1.. run tellraw @s ["",{"text":"[ ❌ ]","color":"red","clickEvent":{"action":"run_command","value":"/function timber:settings/toggle/plant_sapling"}},{"text":" Auto Plant Saplings","hoverEvent":{"action":"show_text","value":["",{"text":"All kind of saplings laying on the ground will get planted every 2 seconds."},{"text":"\n\nWhen a sapling get placed on mud, it turns into muddy mangrove roots for a fraction of a second due to datapack limitations.","color":"gray"}]}}] - -execute if score destroy_roots timber matches 1.. run tellraw @s ["",{"text":"[ ✔ ]","color":"green","clickEvent":{"action":"run_command","value":"/function timber:settings/toggle/destroy_roots"}},{"text":" Destroy Roots","hoverEvent":{"action":"show_text","value":["",{"text":"Only root blocks which are not in the ground count."}]}}] -execute unless score destroy_roots timber matches 1.. run tellraw @s ["",{"text":"[ ❌ ]","color":"red","clickEvent":{"action":"run_command","value":"/function timber:settings/toggle/destroy_roots"}},{"text":" Destroy Roots","hoverEvent":{"action":"show_text","value":["",{"text":"Only root blocks which are not in the ground count."}]}}] - -execute if score start_chop_on_root timber matches 1.. run tellraw @s ["",{"text":"[ ✔ ]","color":"green","clickEvent":{"action":"run_command","value":"/function timber:settings/toggle/start_chop_on_root"}},{"text":" Chop Tree When Roots Get Destroyed","hoverEvent":{"action":"show_text","value":["",{"text":"The datapack will chop the tree if you break its root blocks.\nOnly root blocks which are not in the ground count."}]}}] -execute unless score start_chop_on_root timber matches 1.. run tellraw @s ["",{"text":"[ ❌ ]","color":"red","clickEvent":{"action":"run_command","value":"/function timber:settings/toggle/start_chop_on_root"}},{"text":" Chop Tree When Roots Get Destroyed","hoverEvent":{"action":"show_text","value":["",{"text":"The datapack will chop the tree if you break its root blocks.\nOnly root blocks which are not in the ground count."}]}}] - -execute if score slow_chop timber matches 1.. run tellraw @s ["",{"text":"[ ✔ ]","color":"green","clickEvent":{"action":"run_command","value":"/function timber:settings/toggle/slow_chop"}},{"text":" Chop Slowly","hoverEvent":{"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","clickEvent":{"action":"run_command","value":"/function timber:settings/toggle/slow_chop"}},{"text":" Chop Slowly","hoverEvent":{"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","hoverEvent":{"action":"show_text","value":"Can't be enabled when \"Drop Loot Straight into Inventory\" is enabled."}},{"text":" Chop Slowly","hoverEvent":{"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","clickEvent":{"action":"run_command","value":"/function timber:settings/toggle/chop_down"}},{"text":" Enable Chopping Down","hoverEvent":{"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","clickEvent":{"action":"run_command","value":"/function timber:settings/toggle/chop_down"}},{"text":" Enable Chopping Down","hoverEvent":{"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","clickEvent":{"action":"run_command","value":"/function timber:settings/toggle/stop_chopping"}},{"text":" Stop Chopping Once Axe Breaks","hoverEvent":{"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","clickEvent":{"action":"run_command","value":"/function timber:settings/toggle/stop_chopping"}},{"text":" Stop Chopping Once Axe Breaks","hoverEvent":{"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","hoverEvent":{"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","hoverEvent":{"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","clickEvent":{"action":"run_command","value":"/function timber:settings/toggle/wear_out"}},{"text":" Additionally Wear out Tool Depending on Tree Size","hoverEvent":{"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","clickEvent":{"action":"run_command","value":"/function timber:settings/toggle/wear_out"}},{"text":" Additionally Wear out Tool Depending on Tree Size","hoverEvent":{"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","hoverEvent":{"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","hoverEvent":{"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","clickEvent":{"action":"run_command","value":"/function timber:settings/toggle/drop_loot"}},{"text":" Drop Loot Straight into Inventory","hoverEvent":{"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","clickEvent":{"action":"run_command","value":"/function timber:settings/toggle/drop_loot"}},{"text":" Drop Loot Straight into Inventory","hoverEvent":{"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","hoverEvent":{"action":"show_text","value":"Can't be enabled when \"Chop Slowly\" is enabled."}},{"text":" Drop Loot Straight into Inventory","hoverEvent":{"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","clickEvent":{"action":"run_command","value":"/function timber:settings/toggle/hunger"}},{"text":" Give Additional Hunger Effect","hoverEvent":{"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","clickEvent":{"action":"run_command","value":"/function timber:settings/toggle/hunger"}},{"text":" Give Additional Hunger Effect","hoverEvent":{"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","clickEvent":{"action":"run_command","value":"/function timber:settings/toggle/stopsound"}},{"text":" Stop Loud Breaking Noises","hoverEvent":{"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","clickEvent":{"action":"run_command","value":"/function timber:settings/toggle/stopsound"}},{"text":" Stop Loud Breaking Noises","hoverEvent":{"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"}]}}] - -tellraw @s ["",{"text":"\u00A7m ","color":"dark_gray"}] - -function timber:settings/end_of_message \ No newline at end of file diff --git a/18-61/data/timber/function/settings/settings2.mcfunction b/18-61/data/timber/function/settings/settings2.mcfunction deleted file mode 100644 index 6f1a745..0000000 --- a/18-61/data/timber/function/settings/settings2.mcfunction +++ /dev/null @@ -1,55 +0,0 @@ -tellraw @s ["",{"text":" "}] -tellraw @s ["",{"text":" "}] -tellraw @s ["",{"text":" "}] -tellraw @s ["",{"text":" "}] - -tellraw @s ["",{"text":"\u00A7m ","color":"dark_gray"}] - -tellraw @s ["",{"text":" Timber "},{"text":"/","color":"gray"},{"text":" Global Settings "},{"text":" < ","clickEvent":{"action":"run_command","value":"/function timber:settings/settings1_click"}},{"text":"2/2"},{"text":" > ","clickEvent":{"action":"run_command","value":"/function timber:settings/settings2_click"}}] - -tellraw @s ["",{"text":"\u00A7m ","color":"dark_gray"}] - -execute if score wooden_axe timber matches 1.. run tellraw @s ["",{"text":"[ ✔ ]","color":"green","clickEvent":{"action":"run_command","value":"/function timber:settings/toggle/wooden_axe"}},{"text":" Enable Wooden Axe"}] -execute unless score wooden_axe timber matches 1.. run tellraw @s ["",{"text":"[ ❌ ]","color":"red","clickEvent":{"action":"run_command","value":"/function timber:settings/toggle/wooden_axe"}},{"text":" Enable Wooden Axe"}] - -execute if score stone_axe timber matches 1.. run tellraw @s ["",{"text":"[ ✔ ]","color":"green","clickEvent":{"action":"run_command","value":"/function timber:settings/toggle/stone_axe"}},{"text":" Enable Stone Axe"}] -execute unless score stone_axe timber matches 1.. run tellraw @s ["",{"text":"[ ❌ ]","color":"red","clickEvent":{"action":"run_command","value":"/function timber:settings/toggle/stone_axe"}},{"text":" Enable Stone Axe"}] - -execute if score iron_axe timber matches 1.. run tellraw @s ["",{"text":"[ ✔ ]","color":"green","clickEvent":{"action":"run_command","value":"/function timber:settings/toggle/iron_axe"}},{"text":" Enable Iron Axe"}] -execute unless score iron_axe timber matches 1.. run tellraw @s ["",{"text":"[ ❌ ]","color":"red","clickEvent":{"action":"run_command","value":"/function timber:settings/toggle/iron_axe"}},{"text":" Enable Iron Axe"}] - -execute if score golden_axe timber matches 1.. run tellraw @s ["",{"text":"[ ✔ ]","color":"green","clickEvent":{"action":"run_command","value":"/function timber:settings/toggle/golden_axe"}},{"text":" Enable Golden Axe"}] -execute unless score golden_axe timber matches 1.. run tellraw @s ["",{"text":"[ ❌ ]","color":"red","clickEvent":{"action":"run_command","value":"/function timber:settings/toggle/golden_axe"}},{"text":" Enable Golden Axe"}] - -execute if score diamond_axe timber matches 1.. run tellraw @s ["",{"text":"[ ✔ ]","color":"green","clickEvent":{"action":"run_command","value":"/function timber:settings/toggle/diamond_axe"}},{"text":" Enable Diamond Axe"}] -execute unless score diamond_axe timber matches 1.. run tellraw @s ["",{"text":"[ ❌ ]","color":"red","clickEvent":{"action":"run_command","value":"/function timber:settings/toggle/diamond_axe"}},{"text":" Enable Diamond Axe"}] - -execute if score netherite_axe timber matches 1.. run tellraw @s ["",{"text":"[ ✔ ]","color":"green","clickEvent":{"action":"run_command","value":"/function timber:settings/toggle/netherite_axe"}},{"text":" Enable Netherite Axe"}] -execute unless score netherite_axe timber matches 1.. run tellraw @s ["",{"text":"[ ❌ ]","color":"red","clickEvent":{"action":"run_command","value":"/function timber:settings/toggle/netherite_axe"}},{"text":" Enable Netherite Axe"}] - -execute if score chop_trees timber matches 1.. run tellraw @s ["",{"text":"[ ✔ ]","color":"green","clickEvent":{"action":"run_command","value":"/function timber:settings/toggle/chop_trees"}},{"text":" Chop Trees","hoverEvent":{"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","clickEvent":{"action":"run_command","value":"/function timber:settings/toggle/chop_trees"}},{"text":" Chop Trees","hoverEvent":{"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","clickEvent":{"action":"run_command","value":"/function timber:settings/toggle/chop_fungi"}},{"text":" Chop Fungi","hoverEvent":{"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","clickEvent":{"action":"run_command","value":"/function timber:settings/toggle/chop_fungi"}},{"text":" Chop Fungi","hoverEvent":{"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 persistent timber matches 1.. run tellraw @s ["",{"text":"[ ✔ ]","color":"green","clickEvent":{"action":"run_command","value":"/function timber:settings/toggle/persistent"}},{"text":" Destroy Player-Placed Trees","hoverEvent":{"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","clickEvent":{"action":"run_command","value":"/function timber:settings/toggle/persistent"}},{"text":" Destroy Player-Placed Trees","hoverEvent":{"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 if score blocks_per_chop timber matches 1 if score slow_chop timber matches 1.. run tellraw @s ["",{"text":"[ ✎ ]","color":"gray","clickEvent":{"action":"suggest_command","value":"/scoreboard players set blocks_per_chop timber "},"hoverEvent":{"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","clickEvent":{"action":"suggest_command","value":"/scoreboard players set blocks_per_chop timber "},"hoverEvent":{"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","hoverEvent":{"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","clickEvent":{"action":"suggest_command","value":"/scoreboard players set time_between_chops timber "},"hoverEvent":{"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","clickEvent":{"action":"suggest_command","value":"/scoreboard players set time_between_chops timber "},"hoverEvent":{"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","hoverEvent":{"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","clickEvent":{"action":"suggest_command","value":"/scoreboard players set max_tree_size timber "},"hoverEvent":{"action":"show_text","value":"Default: 555"}},{"text":" Set Max. Tree Size","hoverEvent":{"action":"show_text","value":"Trees bigger than this set value won't get further processed."}},{"text":" (Currently: ","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","clickEvent":{"action":"suggest_command","value":"/scoreboard players set max_tree_size timber "},"hoverEvent":{"action":"show_text","value":"Default: 555"}},{"text":" Set Max. Tree Size","hoverEvent":{"action":"show_text","value":"Trees bigger than this set value won't get further processed."}},{"text":" (Currently: ","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","clickEvent":{"action":"suggest_command","value":"/scoreboard players set min_leaves_found timber "},"hoverEvent":{"action":"show_text","value":"Default: 5"}},{"text":" Set Min. Leaves to Valid a Tree","hoverEvent":{"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","clickEvent":{"action":"suggest_command","value":"/scoreboard players set min_leaves_found timber "},"hoverEvent":{"action":"show_text","value":"Default: 5"}},{"text":" Set Min. Leaves to Valid a Tree","hoverEvent":{"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":"\u00A7m ","color":"dark_gray"}] - -function timber:settings/end_of_message \ No newline at end of file diff --git a/18-61/data/timber/function/settings/toggle/timber.mcfunction b/18-61/data/timber/function/settings/toggle/timber.mcfunction deleted file mode 100644 index 0a26b1d..0000000 --- a/18-61/data/timber/function/settings/toggle/timber.mcfunction +++ /dev/null @@ -1,9 +0,0 @@ -# reset -scoreboard players set @s TimberToggle 0 -# toggle -execute unless score @s timber_disabled matches 1.. run scoreboard players set @s timber_disabled 3 -execute if score @s timber_disabled matches 1 run scoreboard players set @s timber_disabled 0 -execute if score @s timber_disabled matches 3 run scoreboard players set @s timber_disabled 1 -# display on/off status -execute unless score @s[tag=!global.ignore.gui] timber_disabled matches 1.. run tellraw @s ["",{"text":"<< ","color":"dark_gray"},{"text":"✔","color":"green"},{"text":" Timber is now on"},{"text":" >>","color":"dark_gray"}] -execute if score @s[tag=!global.ignore.gui] timber_disabled matches 1.. run tellraw @s ["",{"text":"<< ","color":"dark_gray"},{"text":"❌","color":"red"},{"text":" Timber is now off"},{"text":" >>","color":"dark_gray"}] \ No newline at end of file diff --git a/18-61/data/timber/function/utils/check_max_command_chain_length.mcfunction b/18-61/data/timber/function/utils/check_max_command_chain_length.mcfunction deleted file mode 100644 index 6f32c3e..0000000 --- a/18-61/data/timber/function/utils/check_max_command_chain_length.mcfunction +++ /dev/null @@ -1,13 +0,0 @@ -# function didn't end successfully -execute if score running timber matches 1 run scoreboard players set running timber 2 -# normal behavior -execute if score running timber matches 0 run scoreboard players set running timber 1 -execute if score running timber matches 1 run function timber:utils/used_axe -# function didn't end successfully -execute if score running timber matches 2 run execute store result storage timber:max_command_chain_length value int 1 run gamerule maxCommandChainLength -execute if score running timber matches 2 run tellraw @a[tag=!noTimberWarning] ["",{"text":"Timber Datapack Warning: ","color":"red"},{"text":"The datapack wasn't able to finish its functionality to work properly!"},{"text":"\n ─ Please either decrease setting \"Max. Tree Size\" with "},{"text":"\n [ ✎ ]","color":"gray","clickEvent":{"action":"suggest_command","value":"/scoreboard players set max_tree_size timber "},"hoverEvent":{"action":"show_text","value":"Default: 555"}},{"text":" (Currently: ","color":"gray"},{"score":{"name":"max_tree_size","objective":"timber"},"color":"gray"},{"text": ")","color":"gray"},{"text":"."},{"text":"\n ─ Or increase the gamerule \"maxCommandChainLength\" with "},{"text":"\n [ ✎ ]","color":"gray","clickEvent":{"action":"suggest_command","value":"/gamerule maxCommandChainLength "},"hoverEvent":{"action":"show_text","value":"Default: 65536"}},{"text":" (Currently: ","color":"gray"},{"nbt":"value","storage":"timber:max_command_chain_length","color":"gray"},{"text": ")","color":"gray"},{"text":"."}] -execute if score running timber matches 2 run schedule function timber:utils/reset 10t -execute if score running timber matches 2 run scoreboard players set running timber 3 - -# function ended successfully -execute if score running timber matches 1 run scoreboard players set running timber 0 \ No newline at end of file diff --git a/18-61/data/timber/function/utils/check_server.mcfunction b/18-61/data/timber/function/utils/check_server.mcfunction deleted file mode 100644 index 7d70177..0000000 --- a/18-61/data/timber/function/utils/check_server.mcfunction +++ /dev/null @@ -1,8 +0,0 @@ -# load until someone is in the server -execute unless entity @r run schedule function timber:utils/check_server 1s - -# Checking if the server uses a different jar from the vanilla one -execute unless score not_vanilla timber matches 1.. store success score not_vanilla timber run data get entity @r "Spigot.ticksLived" -execute unless score not_vanilla timber matches 1.. store success score not_vanilla timber run data get entity @r "Bukkit.updateLevel" -execute unless score not_vanilla timber matches 1.. store success score not_vanilla timber run data get entity @r "Paper.SpawnReason" -execute if score not_vanilla timber matches 1 run tellraw @a[tag=!noTimberWarning] ["",{"text":"Timber Datapack Warning: ","color":"red"},{"text":"Compatibility in non-vanilla servers is not guaranteed! For more information please visit official download site.","clickEvent":{"action":"open_url","value":"https://github.com/Moggla/Timber-Datapack"}}] \ No newline at end of file diff --git a/18-61/data/timber/function/validated.mcfunction b/18-61/data/timber/function/validated.mcfunction deleted file mode 100644 index b00df5e..0000000 --- a/18-61/data/timber/function/validated.mcfunction +++ /dev/null @@ -1,51 +0,0 @@ -# when full inventory fix -execute if score drop_loot timber matches 1.. store result score inventory timber run data get entity @s Inventory -execute if score drop_loot timber matches 1.. if entity @s[nbt={Inventory:[{Slot:100b}]}] run scoreboard players remove inventory timber 1 -execute if score drop_loot timber matches 1.. if entity @s[nbt={Inventory:[{Slot:101b}]}] run scoreboard players remove inventory timber 1 -execute if score drop_loot timber matches 1.. if entity @s[nbt={Inventory:[{Slot:102b}]}] run scoreboard players remove inventory timber 1 -execute if score drop_loot timber matches 1.. if entity @s[nbt={Inventory:[{Slot:103b}]}] run scoreboard players remove inventory timber 1 -execute if score drop_loot timber matches 1.. if entity @s[nbt={Inventory:[{Slot:-106b}]}] run scoreboard players remove inventory timber 1 - -# destroy blocks - # mark blocks that need to be destroyed - tag @e[type=minecraft:marker,tag=timber_log] add timber_destroy - execute if score destroy_leaves timber matches 1.. run tag @e[type=minecraft:marker,tag=timber_leaf] add timber_destroy - execute if score destroy_roots timber matches 1.. run tag @e[type=minecraft:marker,tag=timber_root] 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_root] run function #timber:api/break_root - 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 (doTileDrops can be changed, because datapack wouldn't get to this point otherwise) - 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 ~ -64 ~ {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=-64,distance=...1,sort=arbitrary,limit=1] HandItems[0] 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 \ No newline at end of file diff --git a/18-81/data/timber/function/init.mcfunction b/18-81/data/timber/function/init.mcfunction deleted file mode 100644 index 3bfd75d..0000000 --- a/18-81/data/timber/function/init.mcfunction +++ /dev/null @@ -1,39 +0,0 @@ -# longer maxCommandChainLength -gamerule maxCommandChainLength 1000000000 - -# create scoreboards -scoreboard objectives add timber_w_axe minecraft.used:minecraft.wooden_axe -scoreboard objectives add timber_s_axe minecraft.used:minecraft.stone_axe -scoreboard objectives add timber_i_axe minecraft.used:minecraft.iron_axe -scoreboard objectives add timber_g_axe minecraft.used:minecraft.golden_axe -scoreboard objectives add timber_d_axe minecraft.used:minecraft.diamond_axe -scoreboard objectives add timber_n_axe minecraft.used:minecraft.netherite_axe -scoreboard objectives add timber dummy -scoreboard objectives add TimberToggle trigger {text:"Timber Toggle",color:"#724E21"} -scoreboard objectives add timber_disabled dummy -scoreboard objectives add timber_prsistent dummy - -# non-overriding default values -function timber:settings/default_values -function timber:tool/durability_max -scoreboard players set running timber 0 - -# start optional loops -execute if score plant_sapling timber matches 1.. run function timber:autoplant/loop -execute if score slow_chop timber matches 1.. run function timber:slow_chop/loop - -# check loottable compatibility of mushroom stem -setblock ~ 255 ~ minecraft:chest -setblock ~ 255 ~1 minecraft:mushroom_stem -loot insert ~ 255 ~ mine ~ 255 ~1 minecraft:diamond_axe -execute unless data block ~ 255 ~ Items[{id:"minecraft:knowledge_book",components:{"minecraft:custom_data":{Tags:["timber_location"]}}}] run tellraw @a[tag=!noTimberWarning] ["",{text:"Timber Datapack Warning: ",color:"red"},{text:"Incompatibility with the mushroom_stem loottable of another datapack!"}] -fill ~-1 255 ~-1 ~1 255 ~1 minecraft:air -execute store result score doTileDrops timber run gamerule doTileDrops -execute if score doTileDrops timber matches 0 run tellraw @a[tag=!noTimberWarning] ["",{text:"Timber Datapack Warning: ",color:"red"},{text:"This datapack only works when gamerule doTileDrops is set to true!"}] - -# Getting the game version and checking if it is compatible with the datapack https://minecraft.fandom.com/wiki/Data_version -execute store result score game_version timber run data get entity @r DataVersion -execute if score game_version timber matches ..3442 run tellraw @a[tag=!noTimberWarning] ["",{text:"Timber Datapack Warning: ",color:"red"},{text:"This datapack is not compatible with all the versions before 1.20!"}] - -# Checking if the server uses a different jar from the vanilla one -function timber:utils/check_server \ No newline at end of file diff --git a/18-81/data/timber/function/main.mcfunction b/18-81/data/timber/function/main.mcfunction deleted file mode 100644 index 02ef309..0000000 --- a/18-81/data/timber/function/main.mcfunction +++ /dev/null @@ -1,11 +0,0 @@ -# loop (not in minecraft:tick in order to stop it after uninstall) -schedule function timber:main 1t - -# if any kind of axe is used -execute as @a[predicate=timber:used_axe,tag=!global.ignore] at @s run function timber:utils/check_max_command_chain_length - -# toggle timber datapack per player -execute as @a[scores={TimberToggle=1..},tag=!global.ignore] run function timber:settings/toggle/timber - -# reset -scoreboard players enable @a TimberToggle \ No newline at end of file diff --git a/18-81/data/timber/function/settings/end_of_message.mcfunction b/18-81/data/timber/function/settings/end_of_message.mcfunction deleted file mode 100644 index 1d5e211..0000000 --- a/18-81/data/timber/function/settings/end_of_message.mcfunction +++ /dev/null @@ -1,3 +0,0 @@ -execute store result score sendCommandFeedback timber run gamerule sendCommandFeedback -execute if score sendCommandFeedback timber matches 1 run schedule function timber:settings/reset_gamerule 1t -gamerule sendCommandFeedback false \ No newline at end of file diff --git a/18-81/data/timber/function/settings/reset_gamerule.mcfunction b/18-81/data/timber/function/settings/reset_gamerule.mcfunction deleted file mode 100644 index b466492..0000000 --- a/18-81/data/timber/function/settings/reset_gamerule.mcfunction +++ /dev/null @@ -1 +0,0 @@ -gamerule sendCommandFeedback true \ No newline at end of file diff --git a/18-81/data/timber/function/settings/settings2.mcfunction b/18-81/data/timber/function/settings/settings2.mcfunction deleted file mode 100644 index 6f1a745..0000000 --- a/18-81/data/timber/function/settings/settings2.mcfunction +++ /dev/null @@ -1,55 +0,0 @@ -tellraw @s ["",{"text":" "}] -tellraw @s ["",{"text":" "}] -tellraw @s ["",{"text":" "}] -tellraw @s ["",{"text":" "}] - -tellraw @s ["",{"text":"\u00A7m ","color":"dark_gray"}] - -tellraw @s ["",{"text":" Timber "},{"text":"/","color":"gray"},{"text":" Global Settings "},{"text":" < ","clickEvent":{"action":"run_command","value":"/function timber:settings/settings1_click"}},{"text":"2/2"},{"text":" > ","clickEvent":{"action":"run_command","value":"/function timber:settings/settings2_click"}}] - -tellraw @s ["",{"text":"\u00A7m ","color":"dark_gray"}] - -execute if score wooden_axe timber matches 1.. run tellraw @s ["",{"text":"[ ✔ ]","color":"green","clickEvent":{"action":"run_command","value":"/function timber:settings/toggle/wooden_axe"}},{"text":" Enable Wooden Axe"}] -execute unless score wooden_axe timber matches 1.. run tellraw @s ["",{"text":"[ ❌ ]","color":"red","clickEvent":{"action":"run_command","value":"/function timber:settings/toggle/wooden_axe"}},{"text":" Enable Wooden Axe"}] - -execute if score stone_axe timber matches 1.. run tellraw @s ["",{"text":"[ ✔ ]","color":"green","clickEvent":{"action":"run_command","value":"/function timber:settings/toggle/stone_axe"}},{"text":" Enable Stone Axe"}] -execute unless score stone_axe timber matches 1.. run tellraw @s ["",{"text":"[ ❌ ]","color":"red","clickEvent":{"action":"run_command","value":"/function timber:settings/toggle/stone_axe"}},{"text":" Enable Stone Axe"}] - -execute if score iron_axe timber matches 1.. run tellraw @s ["",{"text":"[ ✔ ]","color":"green","clickEvent":{"action":"run_command","value":"/function timber:settings/toggle/iron_axe"}},{"text":" Enable Iron Axe"}] -execute unless score iron_axe timber matches 1.. run tellraw @s ["",{"text":"[ ❌ ]","color":"red","clickEvent":{"action":"run_command","value":"/function timber:settings/toggle/iron_axe"}},{"text":" Enable Iron Axe"}] - -execute if score golden_axe timber matches 1.. run tellraw @s ["",{"text":"[ ✔ ]","color":"green","clickEvent":{"action":"run_command","value":"/function timber:settings/toggle/golden_axe"}},{"text":" Enable Golden Axe"}] -execute unless score golden_axe timber matches 1.. run tellraw @s ["",{"text":"[ ❌ ]","color":"red","clickEvent":{"action":"run_command","value":"/function timber:settings/toggle/golden_axe"}},{"text":" Enable Golden Axe"}] - -execute if score diamond_axe timber matches 1.. run tellraw @s ["",{"text":"[ ✔ ]","color":"green","clickEvent":{"action":"run_command","value":"/function timber:settings/toggle/diamond_axe"}},{"text":" Enable Diamond Axe"}] -execute unless score diamond_axe timber matches 1.. run tellraw @s ["",{"text":"[ ❌ ]","color":"red","clickEvent":{"action":"run_command","value":"/function timber:settings/toggle/diamond_axe"}},{"text":" Enable Diamond Axe"}] - -execute if score netherite_axe timber matches 1.. run tellraw @s ["",{"text":"[ ✔ ]","color":"green","clickEvent":{"action":"run_command","value":"/function timber:settings/toggle/netherite_axe"}},{"text":" Enable Netherite Axe"}] -execute unless score netherite_axe timber matches 1.. run tellraw @s ["",{"text":"[ ❌ ]","color":"red","clickEvent":{"action":"run_command","value":"/function timber:settings/toggle/netherite_axe"}},{"text":" Enable Netherite Axe"}] - -execute if score chop_trees timber matches 1.. run tellraw @s ["",{"text":"[ ✔ ]","color":"green","clickEvent":{"action":"run_command","value":"/function timber:settings/toggle/chop_trees"}},{"text":" Chop Trees","hoverEvent":{"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","clickEvent":{"action":"run_command","value":"/function timber:settings/toggle/chop_trees"}},{"text":" Chop Trees","hoverEvent":{"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","clickEvent":{"action":"run_command","value":"/function timber:settings/toggle/chop_fungi"}},{"text":" Chop Fungi","hoverEvent":{"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","clickEvent":{"action":"run_command","value":"/function timber:settings/toggle/chop_fungi"}},{"text":" Chop Fungi","hoverEvent":{"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 persistent timber matches 1.. run tellraw @s ["",{"text":"[ ✔ ]","color":"green","clickEvent":{"action":"run_command","value":"/function timber:settings/toggle/persistent"}},{"text":" Destroy Player-Placed Trees","hoverEvent":{"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","clickEvent":{"action":"run_command","value":"/function timber:settings/toggle/persistent"}},{"text":" Destroy Player-Placed Trees","hoverEvent":{"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 if score blocks_per_chop timber matches 1 if score slow_chop timber matches 1.. run tellraw @s ["",{"text":"[ ✎ ]","color":"gray","clickEvent":{"action":"suggest_command","value":"/scoreboard players set blocks_per_chop timber "},"hoverEvent":{"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","clickEvent":{"action":"suggest_command","value":"/scoreboard players set blocks_per_chop timber "},"hoverEvent":{"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","hoverEvent":{"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","clickEvent":{"action":"suggest_command","value":"/scoreboard players set time_between_chops timber "},"hoverEvent":{"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","clickEvent":{"action":"suggest_command","value":"/scoreboard players set time_between_chops timber "},"hoverEvent":{"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","hoverEvent":{"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","clickEvent":{"action":"suggest_command","value":"/scoreboard players set max_tree_size timber "},"hoverEvent":{"action":"show_text","value":"Default: 555"}},{"text":" Set Max. Tree Size","hoverEvent":{"action":"show_text","value":"Trees bigger than this set value won't get further processed."}},{"text":" (Currently: ","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","clickEvent":{"action":"suggest_command","value":"/scoreboard players set max_tree_size timber "},"hoverEvent":{"action":"show_text","value":"Default: 555"}},{"text":" Set Max. Tree Size","hoverEvent":{"action":"show_text","value":"Trees bigger than this set value won't get further processed."}},{"text":" (Currently: ","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","clickEvent":{"action":"suggest_command","value":"/scoreboard players set min_leaves_found timber "},"hoverEvent":{"action":"show_text","value":"Default: 5"}},{"text":" Set Min. Leaves to Valid a Tree","hoverEvent":{"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","clickEvent":{"action":"suggest_command","value":"/scoreboard players set min_leaves_found timber "},"hoverEvent":{"action":"show_text","value":"Default: 5"}},{"text":" Set Min. Leaves to Valid a Tree","hoverEvent":{"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":"\u00A7m ","color":"dark_gray"}] - -function timber:settings/end_of_message \ No newline at end of file diff --git a/18-81/data/timber/function/slow_chop/destroy_loop.mcfunction b/18-81/data/timber/function/slow_chop/destroy_loop.mcfunction deleted file mode 100644 index db43fbd..0000000 --- a/18-81/data/timber/function/slow_chop/destroy_loop.mcfunction +++ /dev/null @@ -1,25 +0,0 @@ -# loop -$schedule function timber:slow_chop/loop $(time_between_chops)t replace - -# api -$execute at @e[type=minecraft:marker,tag=timber_slow_chop] as @e[type=minecraft:marker,tag=timber_destroy,sort=nearest,limit=$(blocks_per_chop)] at @s run function timber:slow_chop/api - -# destroy n block -$execute at @e[type=minecraft:marker,tag=timber_slow_chop] as @e[type=minecraft:armor_stand,tag=timber_tool,y=-64,distance=...1,sort=arbitrary,limit=1] at @e[type=minecraft:marker,tag=timber_destroy,sort=nearest,limit=$(blocks_per_chop)] run loot spawn ~ ~ ~ mine ~ ~ ~ mainhand - -# destroy animation (doTileDrops can be changed, because datapack wouldn't get to this point otherwise) -gamerule doTileDrops false -$execute at @e[type=minecraft:marker,tag=timber_slow_chop] at @e[type=minecraft:marker,tag=timber_destroy,sort=nearest,limit=$(blocks_per_chop)] run setblock ~ ~ ~ minecraft:air destroy -gamerule doTileDrops true - -# stop sound -$execute at @e[type=minecraft:marker,tag=timber_slow_chop] if score stopsound timber matches 1.. at @e[type=minecraft:marker,tag=timber_destroy,sort=nearest,limit=$(blocks_per_chop)] as @a[distance=..20,tag=!global.ignore.gui] run function timber:utils/stopsound - -# delete location item -$execute at @e[type=minecraft:marker,tag=timber_slow_chop] at @e[type=minecraft:marker,tag=timber_destroy,sort=nearest,limit=$(blocks_per_chop)] run kill @e[type=minecraft:item,distance=..1,nbt={Item:{components:{"minecraft:custom_data":{Tags:["timber_location"]}}}}] - -# remove marker of processed blocks -$execute at @e[type=minecraft:marker,tag=timber_slow_chop] run kill @e[type=minecraft:marker,tag=timber_destroy,sort=nearest,limit=$(blocks_per_chop)] - -# delete tree markers after chopping -execute unless entity @e[type=minecraft:marker,tag=timber_destroy] run function timber:slow_chop/delete_markers \ No newline at end of file diff --git a/18-81/data/timber/function/utils/check_max_command_chain_length.mcfunction b/18-81/data/timber/function/utils/check_max_command_chain_length.mcfunction deleted file mode 100644 index 6f32c3e..0000000 --- a/18-81/data/timber/function/utils/check_max_command_chain_length.mcfunction +++ /dev/null @@ -1,13 +0,0 @@ -# function didn't end successfully -execute if score running timber matches 1 run scoreboard players set running timber 2 -# normal behavior -execute if score running timber matches 0 run scoreboard players set running timber 1 -execute if score running timber matches 1 run function timber:utils/used_axe -# function didn't end successfully -execute if score running timber matches 2 run execute store result storage timber:max_command_chain_length value int 1 run gamerule maxCommandChainLength -execute if score running timber matches 2 run tellraw @a[tag=!noTimberWarning] ["",{"text":"Timber Datapack Warning: ","color":"red"},{"text":"The datapack wasn't able to finish its functionality to work properly!"},{"text":"\n ─ Please either decrease setting \"Max. Tree Size\" with "},{"text":"\n [ ✎ ]","color":"gray","clickEvent":{"action":"suggest_command","value":"/scoreboard players set max_tree_size timber "},"hoverEvent":{"action":"show_text","value":"Default: 555"}},{"text":" (Currently: ","color":"gray"},{"score":{"name":"max_tree_size","objective":"timber"},"color":"gray"},{"text": ")","color":"gray"},{"text":"."},{"text":"\n ─ Or increase the gamerule \"maxCommandChainLength\" with "},{"text":"\n [ ✎ ]","color":"gray","clickEvent":{"action":"suggest_command","value":"/gamerule maxCommandChainLength "},"hoverEvent":{"action":"show_text","value":"Default: 65536"}},{"text":" (Currently: ","color":"gray"},{"nbt":"value","storage":"timber:max_command_chain_length","color":"gray"},{"text": ")","color":"gray"},{"text":"."}] -execute if score running timber matches 2 run schedule function timber:utils/reset 10t -execute if score running timber matches 2 run scoreboard players set running timber 3 - -# function ended successfully -execute if score running timber matches 1 run scoreboard players set running timber 0 \ No newline at end of file diff --git a/18-81/data/timber/function/utils/check_max_command_sequence_length.mcfunction b/18-81/data/timber/function/utils/check_max_command_sequence_length.mcfunction deleted file mode 100644 index e69de29..0000000 diff --git a/18-81/data/timber/function/validated.mcfunction b/18-81/data/timber/function/validated.mcfunction deleted file mode 100644 index 9617429..0000000 --- a/18-81/data/timber/function/validated.mcfunction +++ /dev/null @@ -1,51 +0,0 @@ -# when full inventory fix -execute if score drop_loot timber matches 1.. store result score inventory timber run data get entity @s Inventory -execute if score drop_loot timber matches 1.. if entity @s[nbt={Inventory:[{Slot:100b}]}] run scoreboard players remove inventory timber 1 -execute if score drop_loot timber matches 1.. if entity @s[nbt={Inventory:[{Slot:101b}]}] run scoreboard players remove inventory timber 1 -execute if score drop_loot timber matches 1.. if entity @s[nbt={Inventory:[{Slot:102b}]}] run scoreboard players remove inventory timber 1 -execute if score drop_loot timber matches 1.. if entity @s[nbt={Inventory:[{Slot:103b}]}] run scoreboard players remove inventory timber 1 -execute if score drop_loot timber matches 1.. if entity @s[nbt={Inventory:[{Slot:-106b}]}] run scoreboard players remove inventory timber 1 - -# destroy blocks - # mark blocks that need to be destroyed - tag @e[type=minecraft:marker,tag=timber_log] add timber_destroy - execute if score destroy_leaves timber matches 1.. run tag @e[type=minecraft:marker,tag=timber_leaf] add timber_destroy - execute if score destroy_roots timber matches 1.. run tag @e[type=minecraft:marker,tag=timber_root] 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_root] run function #timber:api/break_root - 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 (doTileDrops can be changed, because datapack wouldn't get to this point otherwise) - 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 ~ -64 ~ {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=-64,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 \ No newline at end of file diff --git a/18-81/data/timber/item_modifier/wear_out.json b/18-81/data/timber/item_modifier/wear_out.json deleted file mode 100644 index 63fd89d..0000000 --- a/18-81/data/timber/item_modifier/wear_out.json +++ /dev/null @@ -1,152 +0,0 @@ -[ - { - "function": "minecraft:set_damage", - "damage": { - "type": "minecraft:score", - "target": { - "type": "minecraft:fixed", - "name": "damage" - }, - "score": "timber", - "scale": 0.01694915254237288 - }, - "conditions": [ - { - "condition": "minecraft:entity_properties", - "entity": "this", - "predicate": { - "equipment": { - "mainhand": { - "items": "minecraft:wooden_axe" - } - } - } - } - ] - }, - { - "function": "minecraft:set_damage", - "damage": { - "type": "minecraft:score", - "target": { - "type": "minecraft:fixed", - "name": "damage" - }, - "score": "timber", - "scale": 0.007633587786259542 - }, - "conditions": [ - { - "condition": "minecraft:entity_properties", - "entity": "this", - "predicate": { - "equipment": { - "mainhand": { - "items": "minecraft:stone_axe" - } - } - } - } - ] - }, - { - "function": "minecraft:set_damage", - "damage": { - "type": "minecraft:score", - "target": { - "type": "minecraft:fixed", - "name": "damage" - }, - "score": "timber", - "scale": 0.004 - }, - "conditions": [ - { - "condition": "minecraft:entity_properties", - "entity": "this", - "predicate": { - "equipment": { - "mainhand": { - "items": "minecraft:iron_axe" - } - } - } - } - ] - }, - { - "function": "minecraft:set_damage", - "damage": { - "type": "minecraft:score", - "target": { - "type": "minecraft:fixed", - "name": "damage" - }, - "score": "timber", - "scale": 0.03125 - }, - "conditions": [ - { - "condition": "minecraft:entity_properties", - "entity": "this", - "predicate": { - "equipment": { - "mainhand": { - "items": "minecraft:golden_axe" - } - } - } - } - ] - }, - { - "function": "minecraft:set_damage", - "damage": { - "type": "minecraft:score", - "target": { - "type": "minecraft:fixed", - "name": "damage" - }, - "score": "timber", - "scale": 0.0006393861892583121 - }, - "conditions": [ - { - "condition": "minecraft:entity_properties", - "entity": "this", - "predicate": { - "equipment": { - "mainhand": { - "items": "minecraft:diamond_axe" - } - } - } - } - ] - }, - { - "function": "minecraft:set_damage", - "damage": { - "type": "minecraft:score", - "target": { - "type": "minecraft:fixed", - "name": "damage" - }, - "score": "timber", - "scale": 0.0004923682914820286 - }, - "conditions": [ - { - "condition": "minecraft:entity_properties", - "entity": "this", - "predicate": { - "equipment": { - "mainhand": { - "items": "minecraft:netherite_axe" - } - } - } - } - ] - } -] \ No newline at end of file diff --git a/18-81/data/timber/predicate/used_axe.json b/18-81/data/timber/predicate/used_axe.json deleted file mode 100644 index ac00bc4..0000000 --- a/18-81/data/timber/predicate/used_axe.json +++ /dev/null @@ -1,59 +0,0 @@ -{ - "condition": "minecraft:any_of", - "terms": [ - { - "condition": "minecraft:entity_scores", - "entity": "this", - "scores": { - "timber_w_axe": { - "min": 1 - } - } - }, - { - "condition": "minecraft:entity_scores", - "entity": "this", - "scores": { - "timber_s_axe": { - "min": 1 - } - } - }, - { - "condition": "minecraft:entity_scores", - "entity": "this", - "scores": { - "timber_i_axe": { - "min": 1 - } - } - }, - { - "condition": "minecraft:entity_scores", - "entity": "this", - "scores": { - "timber_g_axe": { - "min": 1 - } - } - }, - { - "condition": "minecraft:entity_scores", - "entity": "this", - "scores": { - "timber_d_axe": { - "min": 1 - } - } - }, - { - "condition": "minecraft:entity_scores", - "entity": "this", - "scores": { - "timber_n_axe": { - "min": 1 - } - } - } - ] -} \ No newline at end of file diff --git a/18-81/data/timber/tags/item/axes.json b/18-81/data/timber/tags/item/axes.json deleted file mode 100644 index c496215..0000000 --- a/18-81/data/timber/tags/item/axes.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "values":[ - "minecraft:wooden_axe", - "minecraft:stone_axe", - "minecraft:iron_axe", - "minecraft:golden_axe", - "minecraft:diamond_axe", - "minecraft:netherite_axe" - ] -} \ No newline at end of file diff --git a/82-88/data/timber/function/init.mcfunction b/82-88/data/timber/function/init.mcfunction deleted file mode 100644 index 9bfeada..0000000 --- a/82-88/data/timber/function/init.mcfunction +++ /dev/null @@ -1,40 +0,0 @@ -# longer maxCommandChainLength -gamerule maxCommandChainLength 1000000000 - -# create scoreboards -scoreboard objectives add timber_w_axe minecraft.used:minecraft.wooden_axe -scoreboard objectives add timber_s_axe minecraft.used:minecraft.stone_axe -scoreboard objectives add timber_c_axe minecraft.used:minecraft.copper_axe -scoreboard objectives add timber_i_axe minecraft.used:minecraft.iron_axe -scoreboard objectives add timber_g_axe minecraft.used:minecraft.golden_axe -scoreboard objectives add timber_d_axe minecraft.used:minecraft.diamond_axe -scoreboard objectives add timber_n_axe minecraft.used:minecraft.netherite_axe -scoreboard objectives add timber dummy -scoreboard objectives add TimberToggle trigger {text:"Timber Toggle",color:"#724E21"} -scoreboard objectives add timber_disabled dummy -scoreboard objectives add timber_prsistent dummy - -# non-overriding default values -function timber:settings/default_values -function timber:tool/durability_max -scoreboard players set running timber 0 - -# start optional loops -execute if score plant_sapling timber matches 1.. run function timber:autoplant/loop -execute if score slow_chop timber matches 1.. run function timber:slow_chop/loop - -# check loottable compatibility of mushroom stem -setblock ~ 255 ~ minecraft:chest -setblock ~ 255 ~1 minecraft:mushroom_stem -loot insert ~ 255 ~ mine ~ 255 ~1 minecraft:diamond_axe -execute unless data block ~ 255 ~ Items[{id:"minecraft:knowledge_book",components:{"minecraft:custom_data":{Tags:["timber_location"]}}}] run tellraw @a[tag=!noTimberWarning] ["",{text:"Timber Datapack Warning: ",color:"red"},{text:"Incompatibility with the mushroom_stem loottable of another datapack!"}] -fill ~-1 255 ~-1 ~1 255 ~1 minecraft:air -execute store result score doTileDrops timber run gamerule doTileDrops -execute if score doTileDrops timber matches 0 run tellraw @a[tag=!noTimberWarning] ["",{text:"Timber Datapack Warning: ",color:"red"},{text:"This datapack only works when gamerule doTileDrops is set to true!"}] - -# Getting the game version and checking if it is compatible with the datapack https://minecraft.fandom.com/wiki/Data_version -execute store result score game_version timber run data get entity @r DataVersion -execute if score game_version timber matches ..3442 run tellraw @a[tag=!noTimberWarning] ["",{text:"Timber Datapack Warning: ",color:"red"},{text:"This datapack is not compatible with all the versions before 1.20!"}] - -# Checking if the server uses a different jar from the vanilla one -function timber:utils/check_server \ No newline at end of file diff --git a/82-88/data/timber/function/main.mcfunction b/82-88/data/timber/function/main.mcfunction deleted file mode 100644 index 02ef309..0000000 --- a/82-88/data/timber/function/main.mcfunction +++ /dev/null @@ -1,11 +0,0 @@ -# loop (not in minecraft:tick in order to stop it after uninstall) -schedule function timber:main 1t - -# if any kind of axe is used -execute as @a[predicate=timber:used_axe,tag=!global.ignore] at @s run function timber:utils/check_max_command_chain_length - -# toggle timber datapack per player -execute as @a[scores={TimberToggle=1..},tag=!global.ignore] run function timber:settings/toggle/timber - -# reset -scoreboard players enable @a TimberToggle \ No newline at end of file diff --git a/82-88/data/timber/function/settings/end_of_message.mcfunction b/82-88/data/timber/function/settings/end_of_message.mcfunction deleted file mode 100644 index 1d5e211..0000000 --- a/82-88/data/timber/function/settings/end_of_message.mcfunction +++ /dev/null @@ -1,3 +0,0 @@ -execute store result score sendCommandFeedback timber run gamerule sendCommandFeedback -execute if score sendCommandFeedback timber matches 1 run schedule function timber:settings/reset_gamerule 1t -gamerule sendCommandFeedback false \ No newline at end of file diff --git a/82-88/data/timber/function/settings/reset_gamerule.mcfunction b/82-88/data/timber/function/settings/reset_gamerule.mcfunction deleted file mode 100644 index b466492..0000000 --- a/82-88/data/timber/function/settings/reset_gamerule.mcfunction +++ /dev/null @@ -1 +0,0 @@ -gamerule sendCommandFeedback true \ No newline at end of file diff --git a/82-88/data/timber/function/slow_chop/destroy_loop.mcfunction b/82-88/data/timber/function/slow_chop/destroy_loop.mcfunction deleted file mode 100644 index db43fbd..0000000 --- a/82-88/data/timber/function/slow_chop/destroy_loop.mcfunction +++ /dev/null @@ -1,25 +0,0 @@ -# loop -$schedule function timber:slow_chop/loop $(time_between_chops)t replace - -# api -$execute at @e[type=minecraft:marker,tag=timber_slow_chop] as @e[type=minecraft:marker,tag=timber_destroy,sort=nearest,limit=$(blocks_per_chop)] at @s run function timber:slow_chop/api - -# destroy n block -$execute at @e[type=minecraft:marker,tag=timber_slow_chop] as @e[type=minecraft:armor_stand,tag=timber_tool,y=-64,distance=...1,sort=arbitrary,limit=1] at @e[type=minecraft:marker,tag=timber_destroy,sort=nearest,limit=$(blocks_per_chop)] run loot spawn ~ ~ ~ mine ~ ~ ~ mainhand - -# destroy animation (doTileDrops can be changed, because datapack wouldn't get to this point otherwise) -gamerule doTileDrops false -$execute at @e[type=minecraft:marker,tag=timber_slow_chop] at @e[type=minecraft:marker,tag=timber_destroy,sort=nearest,limit=$(blocks_per_chop)] run setblock ~ ~ ~ minecraft:air destroy -gamerule doTileDrops true - -# stop sound -$execute at @e[type=minecraft:marker,tag=timber_slow_chop] if score stopsound timber matches 1.. at @e[type=minecraft:marker,tag=timber_destroy,sort=nearest,limit=$(blocks_per_chop)] as @a[distance=..20,tag=!global.ignore.gui] run function timber:utils/stopsound - -# delete location item -$execute at @e[type=minecraft:marker,tag=timber_slow_chop] at @e[type=minecraft:marker,tag=timber_destroy,sort=nearest,limit=$(blocks_per_chop)] run kill @e[type=minecraft:item,distance=..1,nbt={Item:{components:{"minecraft:custom_data":{Tags:["timber_location"]}}}}] - -# remove marker of processed blocks -$execute at @e[type=minecraft:marker,tag=timber_slow_chop] run kill @e[type=minecraft:marker,tag=timber_destroy,sort=nearest,limit=$(blocks_per_chop)] - -# delete tree markers after chopping -execute unless entity @e[type=minecraft:marker,tag=timber_destroy] run function timber:slow_chop/delete_markers \ No newline at end of file diff --git a/82-88/data/timber/function/utils/check_max_command_chain_length.mcfunction b/82-88/data/timber/function/utils/check_max_command_chain_length.mcfunction deleted file mode 100644 index 6f32c3e..0000000 --- a/82-88/data/timber/function/utils/check_max_command_chain_length.mcfunction +++ /dev/null @@ -1,13 +0,0 @@ -# function didn't end successfully -execute if score running timber matches 1 run scoreboard players set running timber 2 -# normal behavior -execute if score running timber matches 0 run scoreboard players set running timber 1 -execute if score running timber matches 1 run function timber:utils/used_axe -# function didn't end successfully -execute if score running timber matches 2 run execute store result storage timber:max_command_chain_length value int 1 run gamerule maxCommandChainLength -execute if score running timber matches 2 run tellraw @a[tag=!noTimberWarning] ["",{"text":"Timber Datapack Warning: ","color":"red"},{"text":"The datapack wasn't able to finish its functionality to work properly!"},{"text":"\n ─ Please either decrease setting \"Max. Tree Size\" with "},{"text":"\n [ ✎ ]","color":"gray","clickEvent":{"action":"suggest_command","value":"/scoreboard players set max_tree_size timber "},"hoverEvent":{"action":"show_text","value":"Default: 555"}},{"text":" (Currently: ","color":"gray"},{"score":{"name":"max_tree_size","objective":"timber"},"color":"gray"},{"text": ")","color":"gray"},{"text":"."},{"text":"\n ─ Or increase the gamerule \"maxCommandChainLength\" with "},{"text":"\n [ ✎ ]","color":"gray","clickEvent":{"action":"suggest_command","value":"/gamerule maxCommandChainLength "},"hoverEvent":{"action":"show_text","value":"Default: 65536"}},{"text":" (Currently: ","color":"gray"},{"nbt":"value","storage":"timber:max_command_chain_length","color":"gray"},{"text": ")","color":"gray"},{"text":"."}] -execute if score running timber matches 2 run schedule function timber:utils/reset 10t -execute if score running timber matches 2 run scoreboard players set running timber 3 - -# function ended successfully -execute if score running timber matches 1 run scoreboard players set running timber 0 \ No newline at end of file diff --git a/82-88/data/timber/function/utils/check_max_command_sequence_length.mcfunction b/82-88/data/timber/function/utils/check_max_command_sequence_length.mcfunction deleted file mode 100644 index e69de29..0000000 diff --git a/82-88/data/timber/function/validated.mcfunction b/82-88/data/timber/function/validated.mcfunction deleted file mode 100644 index 9617429..0000000 --- a/82-88/data/timber/function/validated.mcfunction +++ /dev/null @@ -1,51 +0,0 @@ -# when full inventory fix -execute if score drop_loot timber matches 1.. store result score inventory timber run data get entity @s Inventory -execute if score drop_loot timber matches 1.. if entity @s[nbt={Inventory:[{Slot:100b}]}] run scoreboard players remove inventory timber 1 -execute if score drop_loot timber matches 1.. if entity @s[nbt={Inventory:[{Slot:101b}]}] run scoreboard players remove inventory timber 1 -execute if score drop_loot timber matches 1.. if entity @s[nbt={Inventory:[{Slot:102b}]}] run scoreboard players remove inventory timber 1 -execute if score drop_loot timber matches 1.. if entity @s[nbt={Inventory:[{Slot:103b}]}] run scoreboard players remove inventory timber 1 -execute if score drop_loot timber matches 1.. if entity @s[nbt={Inventory:[{Slot:-106b}]}] run scoreboard players remove inventory timber 1 - -# destroy blocks - # mark blocks that need to be destroyed - tag @e[type=minecraft:marker,tag=timber_log] add timber_destroy - execute if score destroy_leaves timber matches 1.. run tag @e[type=minecraft:marker,tag=timber_leaf] add timber_destroy - execute if score destroy_roots timber matches 1.. run tag @e[type=minecraft:marker,tag=timber_root] 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_root] run function #timber:api/break_root - 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 (doTileDrops can be changed, because datapack wouldn't get to this point otherwise) - 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 ~ -64 ~ {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=-64,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 \ No newline at end of file diff --git a/README.md b/README.md index 54272e7..568e931 100644 --- a/README.md +++ b/README.md @@ -36,9 +36,10 @@ To get descriptions and settings for this datapack use: If you don't have access to commands in your singleplayer world 1. Pause the game -2. Click on Open to LAN -3. In the options, change **Allow Cheats**: OFF to ON -4. Click on Start LAN World +2. Click on `World Options...` +3. Toggle `LAN` to `ON` +4. Toggle `Command Access` to `ON` +5. Click on `Apply Changes`
diff --git a/18-26/data/timber/tags/functions/help.json b/data/minecraft/tags/dialog/pause_screen_additions.json similarity index 64% rename from 18-26/data/timber/tags/functions/help.json rename to data/minecraft/tags/dialog/pause_screen_additions.json index 082ff6b..54d298d 100644 --- a/18-26/data/timber/tags/functions/help.json +++ b/data/minecraft/tags/dialog/pause_screen_additions.json @@ -1,5 +1,5 @@ { - "values":[ + "values": [ "timber:help" ] } \ No newline at end of file diff --git a/data/timber/dialog/help.json b/data/timber/dialog/help.json new file mode 100644 index 0000000..7a4bdb0 --- /dev/null +++ b/data/timber/dialog/help.json @@ -0,0 +1,75 @@ +{ + "type": "minecraft:multi_action", + "title": "Timber Datapack", + "external_title": "Timber", + "body": { + "type": "minecraft:plain_message", + "contents": [ + "", + { + "text": "The Timber Datapack allows you to instantly chop down a tree just by breaking one log with any axe." + }, + "\n\n", + { + "text": "By default, sneaking while breaking will not chop the tree." + }, + "\n\n", + { + "text": "Every player can use " + }, + { + "text": "/trigger TimberToggle", + "color": "blue", + "click_event": { + "action": "suggest_command", + "command": "/trigger TimberToggle" + } + }, + { + "text": " or the button below to individually turn the datapack on or off." + } + ], + "width": 300 + }, + "inputs": [], + "can_close_with_escape": true, + "pause": false, + "actions": [ + { + "label": "Check for New Updates", + "action": { + "type": "minecraft:open_url", + "url": "https://github.com/Moggla/Timber-Datapack/releases" + } + }, + { + "label": "Settings", + "tooltip": { + "text": "Requires the tag timber_admin.", + "color": "gray" + }, + "action": { + "type": "minecraft:run_command", + "command": "trigger TimberToggle set 2" + } + }, + { + "label": "Toggle Timber for Me", + "tooltip": "Turns the datapack on or off for you only.", + "action": { + "type": "minecraft:run_command", + "command": "trigger TimberToggle set 3" + } + } + ], + "after_action": "none", + "exit_action": { + "label": { + "translate": "gui.back" + }, + "action": { + "type": "minecraft:run_command", + "command": "trigger TimberToggle set 4" + } + } +} \ No newline at end of file diff --git a/data/timber/function/help.mcfunction b/data/timber/function/help.mcfunction index daa8cab..21452a5 100644 --- a/data/timber/function/help.mcfunction +++ b/data/timber/function/help.mcfunction @@ -1,25 +1 @@ -tellraw @s ["",{text:"\u00A7m ",color:"dark_gray"}] - -tellraw @s ["",{text:" Timber Datapack"}] - -tellraw @s ["",{text:"\u00A7m ",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:"[click here to check for new updates]",color:"green",click_event:{action:"open_url",url:"https://github.com/Moggla/Timber-Datapack/releases"}}] - -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:"\u00A7m ",color:"dark_gray"}] - -function timber:settings/end_of_message \ No newline at end of file +function timber:settings/open/help diff --git a/data/timber/function/init.mcfunction b/data/timber/function/init.mcfunction index 6cf85e8..7f36fe3 100644 --- a/data/timber/function/init.mcfunction +++ b/data/timber/function/init.mcfunction @@ -11,9 +11,21 @@ scoreboard objectives add timber_d_axe minecraft.used:minecraft.diamond_axe scoreboard objectives add timber_n_axe minecraft.used:minecraft.netherite_axe scoreboard objectives add timber dummy scoreboard objectives add TimberToggle trigger {text:"Timber Toggle",color:"#724E21"} +scoreboard objectives add TimberSettings trigger {text:"Timber Settings",color:"#724E21"} +scoreboard objectives add TimberSetBlocks trigger +scoreboard objectives add TimberSetTicks trigger +scoreboard objectives add TimberSetTreeSize trigger +scoreboard objectives add TimberSetLeaves trigger +scoreboard objectives add timber_menu dummy scoreboard objectives add timber_disabled dummy scoreboard objectives add timber_prsistent dummy +scoreboard players reset * TimberSettings +scoreboard players reset * TimberSetBlocks +scoreboard players reset * TimberSetTicks +scoreboard players reset * TimberSetTreeSize +scoreboard players reset * TimberSetLeaves + # non-overriding default values function timber:settings/default_values function timber:tool/durability_max @@ -34,7 +46,7 @@ execute if score block_drops timber matches 0 run tellraw @a[tag=!noTimberWarnin # Getting the game version and checking if it is compatible with the datapack https://minecraft.fandom.com/wiki/Data_version execute store result score game_version timber run data get entity @r DataVersion -execute if score game_version timber matches ..3442 run tellraw @a[tag=!noTimberWarning] ["",{text:"Timber Datapack Warning: ",color:"red"},{text:"This datapack is not compatible with all the versions before 1.20!"}] +execute if score game_version timber matches ..4785 run tellraw @a[tag=!noTimberWarning] ["",{text:"Timber Datapack Warning: ",color:"red"},{text:"This datapack is not compatible with all the versions before 26.1!"}] # Checking if the server uses a different jar from the vanilla one function timber:utils/check_server diff --git a/data/timber/function/main.mcfunction b/data/timber/function/main.mcfunction index 70b5108..82139cc 100644 --- a/data/timber/function/main.mcfunction +++ b/data/timber/function/main.mcfunction @@ -5,7 +5,20 @@ schedule function timber:main 1t execute as @a[predicate=timber:used_axe,tag=!global.ignore] at @s run function timber:utils/check_max_command_sequence_length # toggle timber datapack per player -execute as @a[scores={TimberToggle=1..},tag=!global.ignore] run function timber:settings/toggle/timber +execute as @a[scores={TimberToggle=1},tag=!global.ignore] run function timber:settings/toggle/timber +execute as @a[scores={TimberToggle=2..},tag=!global.ignore] run function timber:settings/menu_request + +# open the settings dialog (the dialog button can only run /trigger without a confirmation screen) +execute as @a[scores={TimberSettings=1..},tag=!global.ignore] run function timber:settings/request +execute as @a[scores={TimberSetBlocks=1..},tag=!global.ignore] run function timber:settings/apply/blocks +execute as @a[scores={TimberSetTicks=1..},tag=!global.ignore] run function timber:settings/apply/ticks +execute as @a[scores={TimberSetTreeSize=1..},tag=!global.ignore] run function timber:settings/apply/treesize +execute as @a[scores={TimberSetLeaves=1..},tag=!global.ignore] run function timber:settings/apply/leaves + +# the triggers of the settings menu are only enabled while the menu is used +scoreboard players add @a[scores={timber_menu=1..}] timber_menu 1 +execute as @a[scores={timber_menu=6000..}] run function timber:settings/disable_triggers + # reset scoreboard players enable @a TimberToggle \ No newline at end of file diff --git a/data/timber/function/settings/after_set.mcfunction b/data/timber/function/settings/after_set.mcfunction new file mode 100644 index 0000000..24cb9b6 --- /dev/null +++ b/data/timber/function/settings/after_set.mcfunction @@ -0,0 +1,8 @@ +# options which exclude each other: the one that was just enabled wins +execute if score slow_chop timber matches 1 if score drop_loot timber matches 1 if score #old_drop_loot timber matches 1 run scoreboard players set drop_loot timber 0 +execute if score slow_chop timber matches 1 if score drop_loot timber matches 1 unless score #old_drop_loot timber matches 1 run scoreboard players set slow_chop timber 0 +execute if score stop_chopping timber matches 1 run scoreboard players set wear_out timber 1 + +# start optional loops +execute if score slow_chop timber matches 1 unless score #old_slow_chop timber matches 1 run function timber:slow_chop/loop +execute if score plant_sapling timber matches 1 unless score #old_plant_sapling timber matches 1 run function timber:autoplant/loop diff --git a/data/timber/function/settings/apply/blocks.mcfunction b/data/timber/function/settings/apply/blocks.mcfunction new file mode 100644 index 0000000..ce3ed53 --- /dev/null +++ b/data/timber/function/settings/apply/blocks.mcfunction @@ -0,0 +1,13 @@ +# applies the value of the "Blocks per Chop" slider: 1 followed by the value +scoreboard players operation #x timber = @s TimberSetBlocks +scoreboard players reset @s TimberSetBlocks +scoreboard players set #p timber 1 +execute if score #x timber matches 10..19 run scoreboard players set #p timber 10 +execute if score #x timber matches 100..199 run scoreboard players set #p timber 100 +execute if score #x timber matches 1000..1999 run scoreboard players set #p timber 1000 +execute if score #x timber matches 10000..19999 run scoreboard players set #p timber 10000 +scoreboard players operation #x timber -= #p timber +scoreboard players operation blocks_per_chop timber = #x timber +function timber:settings/after_set +function timber:settings/arm +function timber:settings/open/menu diff --git a/data/timber/function/settings/apply/leaves.mcfunction b/data/timber/function/settings/apply/leaves.mcfunction new file mode 100644 index 0000000..a4c17c2 --- /dev/null +++ b/data/timber/function/settings/apply/leaves.mcfunction @@ -0,0 +1,13 @@ +# applies the value of the "Min. Leaves" slider: 1 followed by the value +scoreboard players operation #x timber = @s TimberSetLeaves +scoreboard players reset @s TimberSetLeaves +scoreboard players set #p timber 1 +execute if score #x timber matches 10..19 run scoreboard players set #p timber 10 +execute if score #x timber matches 100..199 run scoreboard players set #p timber 100 +execute if score #x timber matches 1000..1999 run scoreboard players set #p timber 1000 +execute if score #x timber matches 10000..19999 run scoreboard players set #p timber 10000 +scoreboard players operation #x timber -= #p timber +scoreboard players operation min_leaves_found timber = #x timber +function timber:settings/after_set +function timber:settings/arm +function timber:settings/open/menu diff --git a/data/timber/function/settings/apply/ticks.mcfunction b/data/timber/function/settings/apply/ticks.mcfunction new file mode 100644 index 0000000..1e3d97a --- /dev/null +++ b/data/timber/function/settings/apply/ticks.mcfunction @@ -0,0 +1,13 @@ +# applies the value of the "Ticks Between Chops" slider: 1 followed by the value +scoreboard players operation #x timber = @s TimberSetTicks +scoreboard players reset @s TimberSetTicks +scoreboard players set #p timber 1 +execute if score #x timber matches 10..19 run scoreboard players set #p timber 10 +execute if score #x timber matches 100..199 run scoreboard players set #p timber 100 +execute if score #x timber matches 1000..1999 run scoreboard players set #p timber 1000 +execute if score #x timber matches 10000..19999 run scoreboard players set #p timber 10000 +scoreboard players operation #x timber -= #p timber +scoreboard players operation time_between_chops timber = #x timber +function timber:settings/after_set +function timber:settings/arm +function timber:settings/open/menu diff --git a/data/timber/function/settings/apply/treesize.mcfunction b/data/timber/function/settings/apply/treesize.mcfunction new file mode 100644 index 0000000..b40d653 --- /dev/null +++ b/data/timber/function/settings/apply/treesize.mcfunction @@ -0,0 +1,13 @@ +# applies the value of the "Max. Tree Size" slider: 1 followed by the value +scoreboard players operation #x timber = @s TimberSetTreeSize +scoreboard players reset @s TimberSetTreeSize +scoreboard players set #p timber 1 +execute if score #x timber matches 10..19 run scoreboard players set #p timber 10 +execute if score #x timber matches 100..199 run scoreboard players set #p timber 100 +execute if score #x timber matches 1000..1999 run scoreboard players set #p timber 1000 +execute if score #x timber matches 10000..19999 run scoreboard players set #p timber 10000 +scoreboard players operation #x timber -= #p timber +scoreboard players operation max_tree_size timber = #x timber +function timber:settings/after_set +function timber:settings/arm +function timber:settings/open/menu diff --git a/data/timber/function/settings/arm.mcfunction b/data/timber/function/settings/arm.mcfunction new file mode 100644 index 0000000..5627222 --- /dev/null +++ b/data/timber/function/settings/arm.mcfunction @@ -0,0 +1,3 @@ +# enable the triggers of the settings menu and start the inactivity timer +scoreboard players enable @s TimberSettings +scoreboard players set @s timber_menu 1 diff --git a/data/timber/function/settings/before_set.mcfunction b/data/timber/function/settings/before_set.mcfunction new file mode 100644 index 0000000..d0bfc54 --- /dev/null +++ b/data/timber/function/settings/before_set.mcfunction @@ -0,0 +1,4 @@ +# remember values which trigger something when they change +scoreboard players operation #old_slow_chop timber = slow_chop timber +scoreboard players operation #old_plant_sapling timber = plant_sapling timber +scoreboard players operation #old_drop_loot timber = drop_loot timber diff --git a/data/timber/function/settings/denied.mcfunction b/data/timber/function/settings/denied.mcfunction new file mode 100644 index 0000000..8cec250 --- /dev/null +++ b/data/timber/function/settings/denied.mcfunction @@ -0,0 +1,2 @@ +tellraw @s ["",{text:"Timber: ",color:"red"},{text:"Only Timber admins can change the settings. Operators can click "},{text:"[ /tag @s add timber_admin ]",color:"gray",click_event:{action:"suggest_command",command:"/tag @s add timber_admin"},hover_event:{action:"show_text",value:"Click to put the command into the chat. Only operators are allowed to run it."}},{text:" to become a Timber admin."}] +dialog clear @s diff --git a/data/timber/function/settings/disable_triggers.mcfunction b/data/timber/function/settings/disable_triggers.mcfunction new file mode 100644 index 0000000..e12aca4 --- /dev/null +++ b/data/timber/function/settings/disable_triggers.mcfunction @@ -0,0 +1,7 @@ +# disable the triggers of the settings menu again +scoreboard players reset @s TimberSettings +scoreboard players reset @s TimberSetBlocks +scoreboard players reset @s TimberSetTicks +scoreboard players reset @s TimberSetTreeSize +scoreboard players reset @s TimberSetLeaves +scoreboard players reset @s timber_menu diff --git a/data/timber/function/settings/dispatch.mcfunction b/data/timber/function/settings/dispatch.mcfunction new file mode 100644 index 0000000..a1f5f4b --- /dev/null +++ b/data/timber/function/settings/dispatch.mcfunction @@ -0,0 +1,37 @@ +# #req: 1 = menu, 2-4 = page, 6-9 = slider, 98 = back to the help, 100+ = toggle a setting (only for admins with the tag timber_admin) +execute unless entity @s[tag=timber_admin] run return run function timber:settings/denied + +execute if score #req timber matches 98 run return run function timber:settings/leave + +# the triggers stay enabled while the menu is used +function timber:settings/arm + +execute if score #req timber matches 1..2 run function timber:settings/open/menu +execute if score #req timber matches 3 run function timber:settings/open/tools +execute if score #req timber matches 6 run function timber:settings/open/blocks +execute if score #req timber matches 7 run function timber:settings/open/ticks +execute if score #req timber matches 8 run function timber:settings/open/treesize +execute if score #req timber matches 9 run function timber:settings/open/leaves +execute if score #req timber matches 100 run function timber:settings/flip/standing +execute if score #req timber matches 101 run function timber:settings/flip/sneaking +execute if score #req timber matches 102 run function timber:settings/flip/destroy_leaves +execute if score #req timber matches 103 run function timber:settings/flip/plant_sapling +execute if score #req timber matches 104 run function timber:settings/flip/destroy_roots +execute if score #req timber matches 105 run function timber:settings/flip/start_chop_on_root +execute if score #req timber matches 106 run function timber:settings/flip/slow_chop +execute if score #req timber matches 107 run function timber:settings/flip/chop_down +execute if score #req timber matches 108 run function timber:settings/flip/stop_chopping +execute if score #req timber matches 109 run function timber:settings/flip/wear_out +execute if score #req timber matches 110 run function timber:settings/flip/drop_loot +execute if score #req timber matches 111 run function timber:settings/flip/hunger +execute if score #req timber matches 112 run function timber:settings/flip/stopsound +execute if score #req timber matches 113 run function timber:settings/flip/chop_trees +execute if score #req timber matches 114 run function timber:settings/flip/chop_fungi +execute if score #req timber matches 115 run function timber:settings/flip/persistent +execute if score #req timber matches 116 run function timber:settings/flip/wooden_axe +execute if score #req timber matches 117 run function timber:settings/flip/golden_axe +execute if score #req timber matches 118 run function timber:settings/flip/stone_axe +execute if score #req timber matches 119 run function timber:settings/flip/copper_axe +execute if score #req timber matches 120 run function timber:settings/flip/iron_axe +execute if score #req timber matches 121 run function timber:settings/flip/diamond_axe +execute if score #req timber matches 122 run function timber:settings/flip/netherite_axe diff --git a/data/timber/function/settings/flip/chop_down.mcfunction b/data/timber/function/settings/flip/chop_down.mcfunction new file mode 100644 index 0000000..0af8acd --- /dev/null +++ b/data/timber/function/settings/flip/chop_down.mcfunction @@ -0,0 +1,5 @@ +# toggles "Chop Down" +function timber:settings/before_set +execute store success score chop_down timber unless score chop_down timber matches 1 +function timber:settings/after_set +function timber:settings/open/menu diff --git a/data/timber/function/settings/flip/chop_fungi.mcfunction b/data/timber/function/settings/flip/chop_fungi.mcfunction new file mode 100644 index 0000000..c30fee6 --- /dev/null +++ b/data/timber/function/settings/flip/chop_fungi.mcfunction @@ -0,0 +1,5 @@ +# toggles "Chop Fungi" +function timber:settings/before_set +execute store success score chop_fungi timber unless score chop_fungi timber matches 1 +function timber:settings/after_set +function timber:settings/open/menu diff --git a/data/timber/function/settings/flip/chop_trees.mcfunction b/data/timber/function/settings/flip/chop_trees.mcfunction new file mode 100644 index 0000000..3a399d0 --- /dev/null +++ b/data/timber/function/settings/flip/chop_trees.mcfunction @@ -0,0 +1,5 @@ +# toggles "Chop Trees" +function timber:settings/before_set +execute store success score chop_trees timber unless score chop_trees timber matches 1 +function timber:settings/after_set +function timber:settings/open/menu diff --git a/data/timber/function/settings/flip/copper_axe.mcfunction b/data/timber/function/settings/flip/copper_axe.mcfunction new file mode 100644 index 0000000..79235e9 --- /dev/null +++ b/data/timber/function/settings/flip/copper_axe.mcfunction @@ -0,0 +1,5 @@ +# toggles "Enable Copper Axe" +function timber:settings/before_set +execute store success score copper_axe timber unless score copper_axe timber matches 1 +function timber:settings/after_set +function timber:settings/open/tools diff --git a/data/timber/function/settings/flip/destroy_leaves.mcfunction b/data/timber/function/settings/flip/destroy_leaves.mcfunction new file mode 100644 index 0000000..2e7b70b --- /dev/null +++ b/data/timber/function/settings/flip/destroy_leaves.mcfunction @@ -0,0 +1,5 @@ +# toggles "Destroy Leaves" +function timber:settings/before_set +execute store success score destroy_leaves timber unless score destroy_leaves timber matches 1 +function timber:settings/after_set +function timber:settings/open/menu diff --git a/data/timber/function/settings/flip/destroy_roots.mcfunction b/data/timber/function/settings/flip/destroy_roots.mcfunction new file mode 100644 index 0000000..f8aa6e3 --- /dev/null +++ b/data/timber/function/settings/flip/destroy_roots.mcfunction @@ -0,0 +1,5 @@ +# toggles "Destroy Roots" +function timber:settings/before_set +execute store success score destroy_roots timber unless score destroy_roots timber matches 1 +function timber:settings/after_set +function timber:settings/open/menu diff --git a/data/timber/function/settings/flip/diamond_axe.mcfunction b/data/timber/function/settings/flip/diamond_axe.mcfunction new file mode 100644 index 0000000..f38a48f --- /dev/null +++ b/data/timber/function/settings/flip/diamond_axe.mcfunction @@ -0,0 +1,5 @@ +# toggles "Enable Diamond Axe" +function timber:settings/before_set +execute store success score diamond_axe timber unless score diamond_axe timber matches 1 +function timber:settings/after_set +function timber:settings/open/tools diff --git a/data/timber/function/settings/flip/drop_loot.mcfunction b/data/timber/function/settings/flip/drop_loot.mcfunction new file mode 100644 index 0000000..f35b11b --- /dev/null +++ b/data/timber/function/settings/flip/drop_loot.mcfunction @@ -0,0 +1,6 @@ +# toggles "Loot to Inventory" +execute if score slow_chop timber matches 1 run return run function timber:settings/open/menu +function timber:settings/before_set +execute store success score drop_loot timber unless score drop_loot timber matches 1 +function timber:settings/after_set +function timber:settings/open/menu diff --git a/data/timber/function/settings/flip/golden_axe.mcfunction b/data/timber/function/settings/flip/golden_axe.mcfunction new file mode 100644 index 0000000..f3fc533 --- /dev/null +++ b/data/timber/function/settings/flip/golden_axe.mcfunction @@ -0,0 +1,5 @@ +# toggles "Enable Golden Axe" +function timber:settings/before_set +execute store success score golden_axe timber unless score golden_axe timber matches 1 +function timber:settings/after_set +function timber:settings/open/tools diff --git a/data/timber/function/settings/flip/hunger.mcfunction b/data/timber/function/settings/flip/hunger.mcfunction new file mode 100644 index 0000000..cfb0f77 --- /dev/null +++ b/data/timber/function/settings/flip/hunger.mcfunction @@ -0,0 +1,5 @@ +# toggles "Hunger Effect" +function timber:settings/before_set +execute store success score hunger timber unless score hunger timber matches 1 +function timber:settings/after_set +function timber:settings/open/menu diff --git a/data/timber/function/settings/flip/iron_axe.mcfunction b/data/timber/function/settings/flip/iron_axe.mcfunction new file mode 100644 index 0000000..79c589a --- /dev/null +++ b/data/timber/function/settings/flip/iron_axe.mcfunction @@ -0,0 +1,5 @@ +# toggles "Enable Iron Axe" +function timber:settings/before_set +execute store success score iron_axe timber unless score iron_axe timber matches 1 +function timber:settings/after_set +function timber:settings/open/tools diff --git a/data/timber/function/settings/flip/netherite_axe.mcfunction b/data/timber/function/settings/flip/netherite_axe.mcfunction new file mode 100644 index 0000000..c01cac9 --- /dev/null +++ b/data/timber/function/settings/flip/netherite_axe.mcfunction @@ -0,0 +1,5 @@ +# toggles "Enable Netherite Axe" +function timber:settings/before_set +execute store success score netherite_axe timber unless score netherite_axe timber matches 1 +function timber:settings/after_set +function timber:settings/open/tools diff --git a/data/timber/function/settings/flip/persistent.mcfunction b/data/timber/function/settings/flip/persistent.mcfunction new file mode 100644 index 0000000..97139a1 --- /dev/null +++ b/data/timber/function/settings/flip/persistent.mcfunction @@ -0,0 +1,5 @@ +# toggles "Player-Placed Trees" +function timber:settings/before_set +execute store success score persistent timber unless score persistent timber matches 1 +function timber:settings/after_set +function timber:settings/open/menu diff --git a/data/timber/function/settings/flip/plant_sapling.mcfunction b/data/timber/function/settings/flip/plant_sapling.mcfunction new file mode 100644 index 0000000..d0fd46b --- /dev/null +++ b/data/timber/function/settings/flip/plant_sapling.mcfunction @@ -0,0 +1,5 @@ +# toggles "Auto Plant Saplings" +function timber:settings/before_set +execute store success score plant_sapling timber unless score plant_sapling timber matches 1 +function timber:settings/after_set +function timber:settings/open/menu diff --git a/data/timber/function/settings/flip/slow_chop.mcfunction b/data/timber/function/settings/flip/slow_chop.mcfunction new file mode 100644 index 0000000..c8da263 --- /dev/null +++ b/data/timber/function/settings/flip/slow_chop.mcfunction @@ -0,0 +1,6 @@ +# toggles "Chop Slowly" +execute if score drop_loot timber matches 1 run return run function timber:settings/open/menu +function timber:settings/before_set +execute store success score slow_chop timber unless score slow_chop timber matches 1 +function timber:settings/after_set +function timber:settings/open/menu diff --git a/data/timber/function/settings/flip/sneaking.mcfunction b/data/timber/function/settings/flip/sneaking.mcfunction new file mode 100644 index 0000000..bf0902f --- /dev/null +++ b/data/timber/function/settings/flip/sneaking.mcfunction @@ -0,0 +1,5 @@ +# toggles "Works When Sneaking" +function timber:settings/before_set +execute store success score sneaking timber unless score sneaking timber matches 1 +function timber:settings/after_set +function timber:settings/open/menu diff --git a/data/timber/function/settings/flip/standing.mcfunction b/data/timber/function/settings/flip/standing.mcfunction new file mode 100644 index 0000000..8a05b44 --- /dev/null +++ b/data/timber/function/settings/flip/standing.mcfunction @@ -0,0 +1,5 @@ +# toggles "Works When Standing" +function timber:settings/before_set +execute store success score standing timber unless score standing timber matches 1 +function timber:settings/after_set +function timber:settings/open/menu diff --git a/data/timber/function/settings/flip/start_chop_on_root.mcfunction b/data/timber/function/settings/flip/start_chop_on_root.mcfunction new file mode 100644 index 0000000..f64b133 --- /dev/null +++ b/data/timber/function/settings/flip/start_chop_on_root.mcfunction @@ -0,0 +1,5 @@ +# toggles "Chop on Root Break" +function timber:settings/before_set +execute store success score start_chop_on_root timber unless score start_chop_on_root timber matches 1 +function timber:settings/after_set +function timber:settings/open/menu diff --git a/data/timber/function/settings/flip/stone_axe.mcfunction b/data/timber/function/settings/flip/stone_axe.mcfunction new file mode 100644 index 0000000..75fea06 --- /dev/null +++ b/data/timber/function/settings/flip/stone_axe.mcfunction @@ -0,0 +1,5 @@ +# toggles "Enable Stone Axe" +function timber:settings/before_set +execute store success score stone_axe timber unless score stone_axe timber matches 1 +function timber:settings/after_set +function timber:settings/open/tools diff --git a/data/timber/function/settings/flip/stop_chopping.mcfunction b/data/timber/function/settings/flip/stop_chopping.mcfunction new file mode 100644 index 0000000..0cb5f7c --- /dev/null +++ b/data/timber/function/settings/flip/stop_chopping.mcfunction @@ -0,0 +1,6 @@ +# toggles "Stop on Axe Break" +execute unless score wear_out timber matches 1 run return run function timber:settings/open/menu +function timber:settings/before_set +execute store success score stop_chopping timber unless score stop_chopping timber matches 1 +function timber:settings/after_set +function timber:settings/open/menu diff --git a/data/timber/function/settings/flip/stopsound.mcfunction b/data/timber/function/settings/flip/stopsound.mcfunction new file mode 100644 index 0000000..73ad6f5 --- /dev/null +++ b/data/timber/function/settings/flip/stopsound.mcfunction @@ -0,0 +1,5 @@ +# toggles "Mute Breaking Sounds" +function timber:settings/before_set +execute store success score stopsound timber unless score stopsound timber matches 1 +function timber:settings/after_set +function timber:settings/open/menu diff --git a/data/timber/function/settings/flip/wear_out.mcfunction b/data/timber/function/settings/flip/wear_out.mcfunction new file mode 100644 index 0000000..065e63e --- /dev/null +++ b/data/timber/function/settings/flip/wear_out.mcfunction @@ -0,0 +1,6 @@ +# toggles "Wear Out Tool More" +execute if score stop_chopping timber matches 1 run return run function timber:settings/open/menu +function timber:settings/before_set +execute store success score wear_out timber unless score wear_out timber matches 1 +function timber:settings/after_set +function timber:settings/open/menu diff --git a/data/timber/function/settings/flip/wooden_axe.mcfunction b/data/timber/function/settings/flip/wooden_axe.mcfunction new file mode 100644 index 0000000..d2ecbae --- /dev/null +++ b/data/timber/function/settings/flip/wooden_axe.mcfunction @@ -0,0 +1,5 @@ +# toggles "Enable Wooden Axe" +function timber:settings/before_set +execute store success score wooden_axe timber unless score wooden_axe timber matches 1 +function timber:settings/after_set +function timber:settings/open/tools diff --git a/data/timber/function/settings/leave.mcfunction b/data/timber/function/settings/leave.mcfunction new file mode 100644 index 0000000..f34f935 --- /dev/null +++ b/data/timber/function/settings/leave.mcfunction @@ -0,0 +1,3 @@ +# back to the help dialog +function timber:settings/disable_triggers +function timber:settings/open/help diff --git a/data/timber/function/settings/leave_close.mcfunction b/data/timber/function/settings/leave_close.mcfunction new file mode 100644 index 0000000..edba3eb --- /dev/null +++ b/data/timber/function/settings/leave_close.mcfunction @@ -0,0 +1,3 @@ +# close the dialog +function timber:settings/disable_triggers +dialog clear @s diff --git a/data/timber/function/settings/locked/blocks.mcfunction b/data/timber/function/settings/locked/blocks.mcfunction new file mode 100644 index 0000000..9d811d6 --- /dev/null +++ b/data/timber/function/settings/locked/blocks.mcfunction @@ -0,0 +1,3 @@ +# shown instead of the slider while Chop Slowly is disabled +data modify storage timber:settings dialog set value {"type":"minecraft:multi_action","title":"Timber Settings / Blocks per Chop","external_title":"Timber Blocks per Chop","inputs":[],"can_close_with_escape":true,"pause":false,"after_action":"none","columns":1,"actions":[{"label":{"translate":"options.generic_value","with":[{"text":"Set Amount of Destroyed Blocks per Chop"},{"translate":"filled_map.locked","color":"gray"}]},"width":300,"tooltip":["",{"text":"Only used when \"Chop Slowly\" is enabled.","color":"red"}]}],"exit_action":{"label":{"translate":"gui.back"},"width":300,"action":{"type":"minecraft:run_command","command":"trigger TimberSettings set 1"}}} +function timber:settings/show with storage timber:settings diff --git a/data/timber/function/settings/locked/ticks.mcfunction b/data/timber/function/settings/locked/ticks.mcfunction new file mode 100644 index 0000000..dbc5779 --- /dev/null +++ b/data/timber/function/settings/locked/ticks.mcfunction @@ -0,0 +1,3 @@ +# shown instead of the slider while Chop Slowly is disabled +data modify storage timber:settings dialog set value {"type":"minecraft:multi_action","title":"Timber Settings / Ticks Between Chops","external_title":"Timber Ticks Between Chops","inputs":[],"can_close_with_escape":true,"pause":false,"after_action":"none","columns":1,"actions":[{"label":{"translate":"options.generic_value","with":[{"text":"Set Time in Ticks Between Chops"},{"translate":"filled_map.locked","color":"gray"}]},"width":300,"tooltip":["",{"text":"Only used when \"Chop Slowly\" is enabled.","color":"red"}]}],"exit_action":{"label":{"translate":"gui.back"},"width":300,"action":{"type":"minecraft:run_command","command":"trigger TimberSettings set 1"}}} +function timber:settings/show with storage timber:settings diff --git a/data/timber/function/settings/menu_request.mcfunction b/data/timber/function/settings/menu_request.mcfunction new file mode 100644 index 0000000..b9adc50 --- /dev/null +++ b/data/timber/function/settings/menu_request.mcfunction @@ -0,0 +1,6 @@ +# trigger TimberToggle with a value > 1 (buttons of the help dialog) +scoreboard players operation #req timber = @s TimberToggle +scoreboard players set @s TimberToggle 0 +execute if score #req timber matches 3 run return run function timber:settings/toggle_self +execute if score #req timber matches 4 run return run function timber:settings/leave_close +execute if score #req timber matches 2 run function timber:settings/dispatch diff --git a/data/timber/function/settings/open/blocks.mcfunction b/data/timber/function/settings/open/blocks.mcfunction new file mode 100644 index 0000000..41138b4 --- /dev/null +++ b/data/timber/function/settings/open/blocks.mcfunction @@ -0,0 +1,7 @@ +# opens the "Blocks per Chop" slider with the current value +# only reachable for admins, so the trigger gets enabled only for them +execute unless score slow_chop timber matches 1 run return run function timber:settings/locked/blocks +scoreboard players enable @s TimberSetBlocks +data modify storage timber:settings dialog set value {"type":"minecraft:multi_action","title":"Timber Settings / Blocks per Chop","external_title":"Timber Blocks per Chop","body":{"type":"minecraft:plain_message","contents":["",{"text":"Amount of blocks which get destroyed per chop.\nOnly used when \"Chop Slowly\" is enabled."},"\n\n",{"text":"Default: 1","color":"gray"}],"width":300},"inputs":[{"type":"minecraft:number_range","key":"blocks_per_chop","width":300,"label":["",{"text":"Set Amount of Destroyed Blocks per Chop","hover_event":{"action":"show_text","value":"Only used when \"Chop Slowly\" is enabled."}}],"start":1,"end":100,"step":1,"initial":1}],"can_close_with_escape":true,"pause":false,"after_action":"none","columns":1,"actions":[{"label":"Save","width":300,"action":{"type":"minecraft:dynamic/run_command","template":"trigger TimberSetBlocks set 1$(blocks_per_chop)"}}],"exit_action":{"label":{"translate":"gui.back"},"width":300,"action":{"type":"minecraft:run_command","command":"trigger TimberSettings set 1"}}} +execute store result storage timber:settings dialog.inputs[0].initial float 1 run scoreboard players get blocks_per_chop timber +function timber:settings/show with storage timber:settings diff --git a/data/timber/function/settings/open/help.mcfunction b/data/timber/function/settings/open/help.mcfunction new file mode 100644 index 0000000..2c3ee5f --- /dev/null +++ b/data/timber/function/settings/open/help.mcfunction @@ -0,0 +1,5 @@ +# opens the help dialog; the last button shows whether Timber is on or off for the player +data modify storage timber:settings dialog set value {"type":"minecraft:multi_action","title":"Timber Datapack","external_title":"Timber","body":{"type":"minecraft:plain_message","contents":["",{"text":"The Timber Datapack allows you to instantly chop down a tree just by breaking one log with any axe."},"\n\n",{"text":"By default, sneaking while breaking will not chop the tree."},"\n\n",{"text":"Every player can use "},{"text":"/trigger TimberToggle","color":"blue","click_event":{"action":"suggest_command","command":"/trigger TimberToggle"}},{"text":" or the button below to individually turn the datapack on or off."}],"width":300},"inputs":[],"can_close_with_escape":true,"pause":false,"actions":[{"label":"Check for New Updates","action":{"type":"minecraft:open_url","url":"https://github.com/Moggla/Timber-Datapack/releases"}},{"label":"Settings","tooltip":{"text":"Requires the tag timber_admin.","color":"gray"},"action":{"type":"minecraft:run_command","command":"trigger TimberToggle set 2"}}],"after_action":"none","exit_action":{"label":{"translate":"gui.back"},"action":{"type":"minecraft:run_command","command":"trigger TimberToggle set 4"}}} +execute unless score @s timber_disabled matches 1.. run data modify storage timber:settings dialog.actions append value {"label":{"translate":"options.generic_value","with":[{"text":"Timber"},{"translate":"options.on","color":"green"}]},"tooltip":"Turns the datapack on or off for you only.","action":{"type":"minecraft:run_command","command":"trigger TimberToggle set 3"}} +execute if score @s timber_disabled matches 1.. run data modify storage timber:settings dialog.actions append value {"label":{"translate":"options.generic_value","with":[{"text":"Timber"},{"translate":"options.off","color":"red"}]},"tooltip":"Turns the datapack on or off for you only.","action":{"type":"minecraft:run_command","command":"trigger TimberToggle set 3"}} +function timber:settings/show with storage timber:settings diff --git a/data/timber/function/settings/open/leaves.mcfunction b/data/timber/function/settings/open/leaves.mcfunction new file mode 100644 index 0000000..468e806 --- /dev/null +++ b/data/timber/function/settings/open/leaves.mcfunction @@ -0,0 +1,6 @@ +# opens the "Min. Leaves" slider with the current value +# only reachable for admins, so the trigger gets enabled only for them +scoreboard players enable @s TimberSetLeaves +data modify storage timber:settings dialog set value {"type":"minecraft:multi_action","title":"Timber Settings / Min. Leaves","external_title":"Timber Min. Leaves","body":{"type":"minecraft:plain_message","contents":["",{"text":"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."},"\n\n",{"text":"Default: 5","color":"gray"}],"width":300},"inputs":[{"type":"minecraft:number_range","key":"min_leaves_found","width":300,"label":["",{"text":"Set Min. Leaves to Valid a Tree","hover_event":{"action":"show_text","value":["",{"text":"Default: 5"},{"text":"\n\nThis 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."}]}}],"start":0,"end":10,"step":1,"initial":0}],"can_close_with_escape":true,"pause":false,"after_action":"none","columns":1,"actions":[{"label":"Save","width":300,"action":{"type":"minecraft:dynamic/run_command","template":"trigger TimberSetLeaves set 1$(min_leaves_found)"}}],"exit_action":{"label":{"translate":"gui.back"},"width":300,"action":{"type":"minecraft:run_command","command":"trigger TimberSettings set 1"}}} +execute store result storage timber:settings dialog.inputs[0].initial float 1 run scoreboard players get min_leaves_found timber +function timber:settings/show with storage timber:settings diff --git a/data/timber/function/settings/open/menu.mcfunction b/data/timber/function/settings/open/menu.mcfunction new file mode 100644 index 0000000..b27b578 --- /dev/null +++ b/data/timber/function/settings/open/menu.mcfunction @@ -0,0 +1,45 @@ +# opens the "Settings" settings page with the current values +# only reachable for admins +data modify storage timber:settings dialog set value {"type":"minecraft:multi_action","title":"Timber Settings","external_title":"Timber Settings","body":{"type":"minecraft:plain_message","contents":"Changes are saved for the whole server.","width":300},"inputs":[],"can_close_with_escape":true,"pause":false,"after_action":"none","columns":2,"actions":[],"exit_action":{"label":{"translate":"gui.back"},"width":150,"action":{"type":"minecraft:run_command","command":"trigger TimberSettings set 98"}}} +execute if score standing timber matches 1 run data modify storage timber:settings dialog.actions append value {"label":{"translate":"options.generic_value","with":[{"text":"Works When Standing"},{"translate":"options.on","color":"green"}]},"width":150,"action":{"type":"minecraft:run_command","command":"trigger TimberSettings set 100"}} +execute unless score standing timber matches 1 run data modify storage timber:settings dialog.actions append value {"label":{"translate":"options.generic_value","with":[{"text":"Works When Standing"},{"translate":"options.off","color":"red"}]},"width":150,"action":{"type":"minecraft:run_command","command":"trigger TimberSettings set 100"}} +execute if score sneaking timber matches 1 run data modify storage timber:settings dialog.actions append value {"label":{"translate":"options.generic_value","with":[{"text":"Works When Sneaking"},{"translate":"options.on","color":"green"}]},"width":150,"action":{"type":"minecraft:run_command","command":"trigger TimberSettings set 101"}} +execute unless score sneaking timber matches 1 run data modify storage timber:settings dialog.actions append value {"label":{"translate":"options.generic_value","with":[{"text":"Works When Sneaking"},{"translate":"options.off","color":"red"}]},"width":150,"action":{"type":"minecraft:run_command","command":"trigger TimberSettings set 101"}} +execute if score destroy_leaves timber matches 1 run data modify storage timber:settings dialog.actions append value {"label":{"translate":"options.generic_value","with":[{"text":"Destroy Leaves"},{"translate":"options.on","color":"green"}]},"width":150,"action":{"type":"minecraft:run_command","command":"trigger TimberSettings set 102"}} +execute unless score destroy_leaves timber matches 1 run data modify storage timber:settings dialog.actions append value {"label":{"translate":"options.generic_value","with":[{"text":"Destroy Leaves"},{"translate":"options.off","color":"red"}]},"width":150,"action":{"type":"minecraft:run_command","command":"trigger TimberSettings set 102"}} +execute if score plant_sapling timber matches 1 run data modify storage timber:settings dialog.actions append value {"label":{"translate":"options.generic_value","with":[{"text":"Auto Plant Saplings"},{"translate":"options.on","color":"green"}]},"width":150,"action":{"type":"minecraft:run_command","command":"trigger TimberSettings set 103"},"tooltip":["",{"text":"All kind of saplings laying on the ground will get planted every 2 seconds."},{"text":"\n\nWhen a sapling get placed on mud, it turns into muddy mangrove roots for a fraction of a second due to datapack limitations.","color":"gray"}]} +execute unless score plant_sapling timber matches 1 run data modify storage timber:settings dialog.actions append value {"label":{"translate":"options.generic_value","with":[{"text":"Auto Plant Saplings"},{"translate":"options.off","color":"red"}]},"width":150,"action":{"type":"minecraft:run_command","command":"trigger TimberSettings set 103"},"tooltip":["",{"text":"All kind of saplings laying on the ground will get planted every 2 seconds."},{"text":"\n\nWhen a sapling get placed on mud, it turns into muddy mangrove roots for a fraction of a second due to datapack limitations.","color":"gray"}]} +execute if score destroy_roots timber matches 1 run data modify storage timber:settings dialog.actions append value {"label":{"translate":"options.generic_value","with":[{"text":"Destroy Roots"},{"translate":"options.on","color":"green"}]},"width":150,"action":{"type":"minecraft:run_command","command":"trigger TimberSettings set 104"},"tooltip":["",{"text":"Only root blocks which are not in the ground count."}]} +execute unless score destroy_roots timber matches 1 run data modify storage timber:settings dialog.actions append value {"label":{"translate":"options.generic_value","with":[{"text":"Destroy Roots"},{"translate":"options.off","color":"red"}]},"width":150,"action":{"type":"minecraft:run_command","command":"trigger TimberSettings set 104"},"tooltip":["",{"text":"Only root blocks which are not in the ground count."}]} +execute if score start_chop_on_root timber matches 1 run data modify storage timber:settings dialog.actions append value {"label":{"translate":"options.generic_value","with":[{"text":"Chop on Root Break"},{"translate":"options.on","color":"green"}]},"width":150,"action":{"type":"minecraft:run_command","command":"trigger TimberSettings set 105"},"tooltip":["",{"text":"The datapack will chop the tree if you break its root blocks.\nOnly root blocks which are not in the ground count."}]} +execute unless score start_chop_on_root timber matches 1 run data modify storage timber:settings dialog.actions append value {"label":{"translate":"options.generic_value","with":[{"text":"Chop on Root Break"},{"translate":"options.off","color":"red"}]},"width":150,"action":{"type":"minecraft:run_command","command":"trigger TimberSettings set 105"},"tooltip":["",{"text":"The datapack will chop the tree if you break its root blocks.\nOnly root blocks which are not in the ground count."}]} +execute if score drop_loot timber matches 1 run data modify storage timber:settings dialog.actions append value {"label":{"translate":"options.generic_value","with":[{"text":"Chop Slowly"},{"translate":"filled_map.locked","color":"gray"}]},"width":150,"tooltip":["",{"text":"Can't be enabled when \"Loot to Inventory\" is enabled.","color":"red"}]} +execute unless score drop_loot timber matches 1 if score slow_chop timber matches 1 run data modify storage timber:settings dialog.actions append value {"label":{"translate":"options.generic_value","with":[{"text":"Chop Slowly"},{"translate":"options.on","color":"green"}]},"width":150,"action":{"type":"minecraft:run_command","command":"trigger TimberSettings set 106"},"tooltip":["",{"text":"The tree won't be chopped instantly anymore."},{"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 data modify storage timber:settings dialog.actions append value {"label":{"translate":"options.generic_value","with":[{"text":"Chop Slowly"},{"translate":"options.off","color":"red"}]},"width":150,"action":{"type":"minecraft:run_command","command":"trigger TimberSettings set 106"},"tooltip":["",{"text":"The tree won't be chopped instantly anymore."},{"text":"\n\nThis option can increase performance.","color":"gray"}]} +execute if score chop_down timber matches 1 run data modify storage timber:settings dialog.actions append value {"label":{"translate":"options.generic_value","with":[{"text":"Chop Down"},{"translate":"options.on","color":"green"}]},"width":150,"action":{"type":"minecraft:run_command","command":"trigger TimberSettings set 107"},"tooltip":"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 data modify storage timber:settings dialog.actions append value {"label":{"translate":"options.generic_value","with":[{"text":"Chop Down"},{"translate":"options.off","color":"red"}]},"width":150,"action":{"type":"minecraft:run_command","command":"trigger TimberSettings set 107"},"tooltip":"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 wear_out timber matches 1 run data modify storage timber:settings dialog.actions append value {"label":{"translate":"options.generic_value","with":[{"text":"Stop on Axe Break"},{"translate":"filled_map.locked","color":"gray"}]},"width":150,"tooltip":["",{"text":"Can't be enabled when \"Wear Out Tool More\" is disabled.","color":"red"}]} +execute if score wear_out timber matches 1 if score stop_chopping timber matches 1 run data modify storage timber:settings dialog.actions append value {"label":{"translate":"options.generic_value","with":[{"text":"Stop on Axe Break"},{"translate":"options.on","color":"green"}]},"width":150,"action":{"type":"minecraft:run_command","command":"trigger TimberSettings set 108"},"tooltip":"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 data modify storage timber:settings dialog.actions append value {"label":{"translate":"options.generic_value","with":[{"text":"Stop on Axe Break"},{"translate":"options.off","color":"red"}]},"width":150,"action":{"type":"minecraft:run_command","command":"trigger TimberSettings set 108"},"tooltip":"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 stop_chopping timber matches 1 run data modify storage timber:settings dialog.actions append value {"label":{"translate":"options.generic_value","with":[{"text":"Wear Out Tool More"},{"translate":"filled_map.locked","color":"gray"}]},"width":150,"tooltip":["",{"text":"Can't be disabled when \"Stop on Axe Break\" is enabled.","color":"red"}]} +execute unless score stop_chopping timber matches 1 if score wear_out timber matches 1 run data modify storage timber:settings dialog.actions append value {"label":{"translate":"options.generic_value","with":[{"text":"Wear Out Tool More"},{"translate":"options.on","color":"green"}]},"width":150,"action":{"type":"minecraft:run_command","command":"trigger TimberSettings set 109"},"tooltip":"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 stop_chopping timber matches 1 unless score wear_out timber matches 1 run data modify storage timber:settings dialog.actions append value {"label":{"translate":"options.generic_value","with":[{"text":"Wear Out Tool More"},{"translate":"options.off","color":"red"}]},"width":150,"action":{"type":"minecraft:run_command","command":"trigger TimberSettings set 109"},"tooltip":"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 slow_chop timber matches 1 run data modify storage timber:settings dialog.actions append value {"label":{"translate":"options.generic_value","with":[{"text":"Loot to Inventory"},{"translate":"filled_map.locked","color":"gray"}]},"width":150,"tooltip":["",{"text":"Can't be enabled when \"Chop Slowly\" is enabled.","color":"red"}]} +execute unless score slow_chop timber matches 1 if score drop_loot timber matches 1 run data modify storage timber:settings dialog.actions append value {"label":{"translate":"options.generic_value","with":[{"text":"Loot to Inventory"},{"translate":"options.on","color":"green"}]},"width":150,"action":{"type":"minecraft:run_command","command":"trigger TimberSettings set 110"},"tooltip":["",{"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 slow_chop timber matches 1 unless score drop_loot timber matches 1 run data modify storage timber:settings dialog.actions append value {"label":{"translate":"options.generic_value","with":[{"text":"Loot to Inventory"},{"translate":"options.off","color":"red"}]},"width":150,"action":{"type":"minecraft:run_command","command":"trigger TimberSettings set 110"},"tooltip":["",{"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 data modify storage timber:settings dialog.actions append value {"label":{"translate":"options.generic_value","with":[{"text":"Hunger Effect"},{"translate":"options.on","color":"green"}]},"width":150,"action":{"type":"minecraft:run_command","command":"trigger TimberSettings set 111"},"tooltip":"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 data modify storage timber:settings dialog.actions append value {"label":{"translate":"options.generic_value","with":[{"text":"Hunger Effect"},{"translate":"options.off","color":"red"}]},"width":150,"action":{"type":"minecraft:run_command","command":"trigger TimberSettings set 111"},"tooltip":"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 data modify storage timber:settings dialog.actions append value {"label":{"translate":"options.generic_value","with":[{"text":"Mute Breaking Sounds"},{"translate":"options.on","color":"green"}]},"width":150,"action":{"type":"minecraft:run_command","command":"trigger TimberSettings set 112"},"tooltip":["",{"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 data modify storage timber:settings dialog.actions append value {"label":{"translate":"options.generic_value","with":[{"text":"Mute Breaking Sounds"},{"translate":"options.off","color":"red"}]},"width":150,"action":{"type":"minecraft:run_command","command":"trigger TimberSettings set 112"},"tooltip":["",{"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 data modify storage timber:settings dialog.actions append value {"label":{"translate":"options.generic_value","with":[{"text":"Player-Placed Trees"},{"translate":"options.on","color":"green"}]},"width":150,"action":{"type":"minecraft:run_command","command":"trigger TimberSettings set 115"},"tooltip":["",{"text":"Player-placed trees are trees made out of player-placed leaves (Look at leaf block with F3 debug screen: persistent = true. Requires enabling looking_at_block_state via F3+F6)."},{"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 data modify storage timber:settings dialog.actions append value {"label":{"translate":"options.generic_value","with":[{"text":"Player-Placed Trees"},{"translate":"options.off","color":"red"}]},"width":150,"action":{"type":"minecraft:run_command","command":"trigger TimberSettings set 115"},"tooltip":["",{"text":"Player-placed trees are trees made out of player-placed leaves (Look at leaf block with F3 debug screen: persistent = true. Requires enabling looking_at_block_state via F3+F6)."},{"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 if score chop_trees timber matches 1 run data modify storage timber:settings dialog.actions append value {"label":{"translate":"options.generic_value","with":[{"text":"Chop Trees"},{"translate":"options.on","color":"green"}]},"width":150,"action":{"type":"minecraft:run_command","command":"trigger TimberSettings set 113"},"tooltip":"All kind of trees will get chopped."} +execute unless score chop_trees timber matches 1 run data modify storage timber:settings dialog.actions append value {"label":{"translate":"options.generic_value","with":[{"text":"Chop Trees"},{"translate":"options.off","color":"red"}]},"width":150,"action":{"type":"minecraft:run_command","command":"trigger TimberSettings set 113"},"tooltip":"All kind of trees will get chopped."} +execute if score chop_fungi timber matches 1 run data modify storage timber:settings dialog.actions append value {"label":{"translate":"options.generic_value","with":[{"text":"Chop Fungi"},{"translate":"options.on","color":"green"}]},"width":150,"action":{"type":"minecraft:run_command","command":"trigger TimberSettings set 114"},"tooltip":["",{"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 data modify storage timber:settings dialog.actions append value {"label":{"translate":"options.generic_value","with":[{"text":"Chop Fungi"},{"translate":"options.off","color":"red"}]},"width":150,"action":{"type":"minecraft:run_command","command":"trigger TimberSettings set 114"},"tooltip":["",{"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"}]} +data modify storage timber:settings dialog.actions append value {"label":"Blocks per Chop","width":150,"action":{"type":"minecraft:run_command","command":"trigger TimberSettings set 6"},"tooltip":"Amount of blocks which get destroyed per chop.\nOnly used when \"Chop Slowly\" is enabled."} +data modify storage timber:settings dialog.actions append value {"label":"Ticks Between Chops","width":150,"action":{"type":"minecraft:run_command","command":"trigger TimberSettings set 7"},"tooltip":"Time in ticks between two chops.\nOnly used when \"Chop Slowly\" is enabled."} +data modify storage timber:settings dialog.actions append value {"label":"Max. Tree Size","width":150,"action":{"type":"minecraft:run_command","command":"trigger TimberSettings set 8"},"tooltip":"Trees bigger than this set value won't get further processed."} +data modify storage timber:settings dialog.actions append value {"label":"Min. Leaves","width":150,"action":{"type":"minecraft:run_command","command":"trigger TimberSettings set 9"},"tooltip":"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."} +data modify storage timber:settings dialog.actions append value {"label":"Tools","width":150,"action":{"type":"minecraft:run_command","command":"trigger TimberSettings set 3"},"tooltip":"Axes"} +function timber:settings/show with storage timber:settings diff --git a/data/timber/function/settings/open/ticks.mcfunction b/data/timber/function/settings/open/ticks.mcfunction new file mode 100644 index 0000000..c778f8a --- /dev/null +++ b/data/timber/function/settings/open/ticks.mcfunction @@ -0,0 +1,7 @@ +# opens the "Ticks Between Chops" slider with the current value +# only reachable for admins, so the trigger gets enabled only for them +execute unless score slow_chop timber matches 1 run return run function timber:settings/locked/ticks +scoreboard players enable @s TimberSetTicks +data modify storage timber:settings dialog set value {"type":"minecraft:multi_action","title":"Timber Settings / Ticks Between Chops","external_title":"Timber Ticks Between Chops","body":{"type":"minecraft:plain_message","contents":["",{"text":"Time in ticks between two chops.\nOnly used when \"Chop Slowly\" is enabled."},"\n\n",{"text":"Default: 1","color":"gray"}],"width":300},"inputs":[{"type":"minecraft:number_range","key":"time_between_chops","width":300,"label":["",{"text":"Set Time in Ticks Between Chops","hover_event":{"action":"show_text","value":"Only used when \"Chop Slowly\" is enabled."}}],"start":1,"end":100,"step":1,"initial":1}],"can_close_with_escape":true,"pause":false,"after_action":"none","columns":1,"actions":[{"label":"Save","width":300,"action":{"type":"minecraft:dynamic/run_command","template":"trigger TimberSetTicks set 1$(time_between_chops)"}}],"exit_action":{"label":{"translate":"gui.back"},"width":300,"action":{"type":"minecraft:run_command","command":"trigger TimberSettings set 1"}}} +execute store result storage timber:settings dialog.inputs[0].initial float 1 run scoreboard players get time_between_chops timber +function timber:settings/show with storage timber:settings diff --git a/data/timber/function/settings/open/tools.mcfunction b/data/timber/function/settings/open/tools.mcfunction new file mode 100644 index 0000000..611a153 --- /dev/null +++ b/data/timber/function/settings/open/tools.mcfunction @@ -0,0 +1,18 @@ +# opens the "Tools" settings page with the current values +# only reachable for admins +data modify storage timber:settings dialog set value {"type":"minecraft:multi_action","title":"Timber Settings / Tools","external_title":"Timber Tools","inputs":[],"can_close_with_escape":true,"pause":false,"after_action":"none","columns":2,"actions":[],"exit_action":{"label":{"translate":"gui.back"},"width":150,"action":{"type":"minecraft:run_command","command":"trigger TimberSettings set 1"}}} +execute if score wooden_axe timber matches 1 run data modify storage timber:settings dialog.actions append value {"label":{"translate":"options.generic_value","with":[{"text":"Enable Wooden Axe"},{"translate":"options.on","color":"green"}]},"width":150,"action":{"type":"minecraft:run_command","command":"trigger TimberSettings set 116"}} +execute unless score wooden_axe timber matches 1 run data modify storage timber:settings dialog.actions append value {"label":{"translate":"options.generic_value","with":[{"text":"Enable Wooden Axe"},{"translate":"options.off","color":"red"}]},"width":150,"action":{"type":"minecraft:run_command","command":"trigger TimberSettings set 116"}} +execute if score golden_axe timber matches 1 run data modify storage timber:settings dialog.actions append value {"label":{"translate":"options.generic_value","with":[{"text":"Enable Golden Axe"},{"translate":"options.on","color":"green"}]},"width":150,"action":{"type":"minecraft:run_command","command":"trigger TimberSettings set 117"}} +execute unless score golden_axe timber matches 1 run data modify storage timber:settings dialog.actions append value {"label":{"translate":"options.generic_value","with":[{"text":"Enable Golden Axe"},{"translate":"options.off","color":"red"}]},"width":150,"action":{"type":"minecraft:run_command","command":"trigger TimberSettings set 117"}} +execute if score stone_axe timber matches 1 run data modify storage timber:settings dialog.actions append value {"label":{"translate":"options.generic_value","with":[{"text":"Enable Stone Axe"},{"translate":"options.on","color":"green"}]},"width":150,"action":{"type":"minecraft:run_command","command":"trigger TimberSettings set 118"}} +execute unless score stone_axe timber matches 1 run data modify storage timber:settings dialog.actions append value {"label":{"translate":"options.generic_value","with":[{"text":"Enable Stone Axe"},{"translate":"options.off","color":"red"}]},"width":150,"action":{"type":"minecraft:run_command","command":"trigger TimberSettings set 118"}} +execute if score copper_axe timber matches 1 run data modify storage timber:settings dialog.actions append value {"label":{"translate":"options.generic_value","with":[{"text":"Enable Copper Axe"},{"translate":"options.on","color":"green"}]},"width":150,"action":{"type":"minecraft:run_command","command":"trigger TimberSettings set 119"}} +execute unless score copper_axe timber matches 1 run data modify storage timber:settings dialog.actions append value {"label":{"translate":"options.generic_value","with":[{"text":"Enable Copper Axe"},{"translate":"options.off","color":"red"}]},"width":150,"action":{"type":"minecraft:run_command","command":"trigger TimberSettings set 119"}} +execute if score iron_axe timber matches 1 run data modify storage timber:settings dialog.actions append value {"label":{"translate":"options.generic_value","with":[{"text":"Enable Iron Axe"},{"translate":"options.on","color":"green"}]},"width":150,"action":{"type":"minecraft:run_command","command":"trigger TimberSettings set 120"}} +execute unless score iron_axe timber matches 1 run data modify storage timber:settings dialog.actions append value {"label":{"translate":"options.generic_value","with":[{"text":"Enable Iron Axe"},{"translate":"options.off","color":"red"}]},"width":150,"action":{"type":"minecraft:run_command","command":"trigger TimberSettings set 120"}} +execute if score diamond_axe timber matches 1 run data modify storage timber:settings dialog.actions append value {"label":{"translate":"options.generic_value","with":[{"text":"Enable Diamond Axe"},{"translate":"options.on","color":"green"}]},"width":150,"action":{"type":"minecraft:run_command","command":"trigger TimberSettings set 121"}} +execute unless score diamond_axe timber matches 1 run data modify storage timber:settings dialog.actions append value {"label":{"translate":"options.generic_value","with":[{"text":"Enable Diamond Axe"},{"translate":"options.off","color":"red"}]},"width":150,"action":{"type":"minecraft:run_command","command":"trigger TimberSettings set 121"}} +execute if score netherite_axe timber matches 1 run data modify storage timber:settings dialog.actions append value {"label":{"translate":"options.generic_value","with":[{"text":"Enable Netherite Axe"},{"translate":"options.on","color":"green"}]},"width":150,"action":{"type":"minecraft:run_command","command":"trigger TimberSettings set 122"}} +execute unless score netherite_axe timber matches 1 run data modify storage timber:settings dialog.actions append value {"label":{"translate":"options.generic_value","with":[{"text":"Enable Netherite Axe"},{"translate":"options.off","color":"red"}]},"width":150,"action":{"type":"minecraft:run_command","command":"trigger TimberSettings set 122"}} +function timber:settings/show with storage timber:settings diff --git a/data/timber/function/settings/open/treesize.mcfunction b/data/timber/function/settings/open/treesize.mcfunction new file mode 100644 index 0000000..bf16513 --- /dev/null +++ b/data/timber/function/settings/open/treesize.mcfunction @@ -0,0 +1,6 @@ +# opens the "Max. Tree Size" slider with the current value +# only reachable for admins, so the trigger gets enabled only for them +scoreboard players enable @s TimberSetTreeSize +data modify storage timber:settings dialog set value {"type":"minecraft:multi_action","title":"Timber Settings / Max. Tree Size","external_title":"Timber Max. Tree Size","body":{"type":"minecraft:plain_message","contents":["",{"text":"Trees bigger than this set value won't get further processed."},"\n\n",{"text":"Default: 555","color":"gray"}],"width":300},"inputs":[{"type":"minecraft:number_range","key":"max_tree_size","width":300,"label":["",{"text":"Set Max. Tree Size","hover_event":{"action":"show_text","value":["",{"text":"Default: 555"},{"text":"\n\nTrees bigger than this set value won't get further processed."}]}}],"start":0,"end":1000,"step":1,"initial":0}],"can_close_with_escape":true,"pause":false,"after_action":"none","columns":1,"actions":[{"label":"Save","width":300,"action":{"type":"minecraft:dynamic/run_command","template":"trigger TimberSetTreeSize set 1$(max_tree_size)"}}],"exit_action":{"label":{"translate":"gui.back"},"width":300,"action":{"type":"minecraft:run_command","command":"trigger TimberSettings set 1"}}} +execute store result storage timber:settings dialog.inputs[0].initial float 1 run scoreboard players get max_tree_size timber +function timber:settings/show with storage timber:settings diff --git a/data/timber/function/settings/request.mcfunction b/data/timber/function/settings/request.mcfunction new file mode 100644 index 0000000..f57cc3d --- /dev/null +++ b/data/timber/function/settings/request.mcfunction @@ -0,0 +1,4 @@ +# trigger TimberSettings +scoreboard players operation #req timber = @s TimberSettings +scoreboard players reset @s TimberSettings +function timber:settings/dispatch diff --git a/data/timber/function/settings/settings.mcfunction b/data/timber/function/settings/settings.mcfunction deleted file mode 100644 index 42d2588..0000000 --- a/data/timber/function/settings/settings.mcfunction +++ /dev/null @@ -1 +0,0 @@ -function timber:settings/settings1 \ No newline at end of file diff --git a/data/timber/function/settings/settings1.mcfunction b/data/timber/function/settings/settings1.mcfunction deleted file mode 100644 index 3146ddc..0000000 --- a/data/timber/function/settings/settings1.mcfunction +++ /dev/null @@ -1,57 +0,0 @@ -tellraw @s ["",{text:" "}] -tellraw @s ["",{text:" "}] -tellraw @s ["",{text:" "}] -tellraw @s ["",{text:" "}] - -tellraw @s ["",{text:"\u00A7m ",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:"\u00A7m ",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:["",{text:"All kind of saplings laying on the ground will get planted every 2 seconds."},{text:"\n\nWhen a sapling get placed on mud, it turns into muddy mangrove roots for a fraction of a second due to datapack limitations.",color:"gray"}]}}] -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:["",{text:"All kind of saplings laying on the ground will get planted every 2 seconds."},{text:"\n\nWhen a sapling get placed on mud, it turns into muddy mangrove roots for a fraction of a second due to datapack limitations.",color:"gray"}]}}] - -execute if score destroy_roots timber matches 1.. run tellraw @s ["",{text:"[ ✔ ]",color:"green",click_event:{action:"run_command",command:"/function timber:settings/toggle/destroy_roots"}},{text:" Destroy Roots",hover_event:{action:"show_text",value:["",{text:"Only root blocks which are not in the ground count."}]}}] -execute unless score destroy_roots timber matches 1.. run tellraw @s ["",{text:"[ ❌ ]",color:"red",click_event:{action:"run_command",command:"/function timber:settings/toggle/destroy_roots"}},{text:" Destroy Roots",hover_event:{action:"show_text",value:["",{text:"Only root blocks which are not in the ground count."}]}}] - -execute if score start_chop_on_root timber matches 1.. run tellraw @s ["",{text:"[ ✔ ]",color:"green",click_event:{action:"run_command",command:"/function timber:settings/toggle/start_chop_on_root"}},{text:" Chop Tree When Roots Get Destroyed",hover_event:{action:"show_text",value:["",{text:"The datapack will chop the tree if you break its root blocks.\nOnly root blocks which are not in the ground count."}]}}] -execute unless score start_chop_on_root timber matches 1.. run tellraw @s ["",{text:"[ ❌ ]",color:"red",click_event:{action:"run_command",command:"/function timber:settings/toggle/start_chop_on_root"}},{text:" Chop Tree When Roots Get Destroyed",hover_event:{action:"show_text",value:["",{text:"The datapack will chop the tree if you break its root blocks.\nOnly root blocks which are not in the ground count."}]}}] - -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"}]}}] - -tellraw @s ["",{text:"\u00A7m ",color:"dark_gray"}] - -function timber:settings/end_of_message \ No newline at end of file diff --git a/data/timber/function/settings/settings1_click.mcfunction b/data/timber/function/settings/settings1_click.mcfunction deleted file mode 100644 index 64625b3..0000000 --- a/data/timber/function/settings/settings1_click.mcfunction +++ /dev/null @@ -1,2 +0,0 @@ -function timber:settings/settings -playsound minecraft:ui.button.click master @s ~ ~ ~ .2 1.6 .2 \ No newline at end of file diff --git a/data/timber/function/settings/settings2.mcfunction b/data/timber/function/settings/settings2.mcfunction deleted file mode 100644 index 56ab2ae..0000000 --- a/data/timber/function/settings/settings2.mcfunction +++ /dev/null @@ -1,58 +0,0 @@ -tellraw @s ["",{text:" "}] -tellraw @s ["",{text:" "}] -tellraw @s ["",{text:" "}] -tellraw @s ["",{text:" "}] - -tellraw @s ["",{text:"\u00A7m ",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:"\u00A7m ",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 copper_axe timber matches 1.. run tellraw @s ["",{text:"[ ✔ ]",color:"green",click_event:{action:"run_command",command:"/function timber:settings/toggle/copper_axe"}},{text:" Enable Copper Axe"}] -execute unless score copper_axe timber matches 1.. run tellraw @s ["",{text:"[ ❌ ]",color:"red",click_event:{action:"run_command",command:"/function timber:settings/toggle/copper_axe"}},{text:" Enable Copper 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 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"}]}}] - -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:" (Currently: ",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:" (Currently: ",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:"\u00A7m ",color:"dark_gray"}] - -function timber:settings/end_of_message diff --git a/data/timber/function/settings/settings2_click.mcfunction b/data/timber/function/settings/settings2_click.mcfunction deleted file mode 100644 index 44b2ce4..0000000 --- a/data/timber/function/settings/settings2_click.mcfunction +++ /dev/null @@ -1,2 +0,0 @@ -function timber:settings/settings2 -playsound minecraft:ui.button.click master @s ~ ~ ~ .2 1.6 .2 \ No newline at end of file diff --git a/data/timber/function/settings/show.mcfunction b/data/timber/function/settings/show.mcfunction new file mode 100644 index 0000000..3422c0b --- /dev/null +++ b/data/timber/function/settings/show.mcfunction @@ -0,0 +1 @@ +$dialog show @s $(dialog) diff --git a/data/timber/function/settings/toggle/chop_down.mcfunction b/data/timber/function/settings/toggle/chop_down.mcfunction deleted file mode 100644 index e601c0c..0000000 --- a/data/timber/function/settings/toggle/chop_down.mcfunction +++ /dev/null @@ -1,7 +0,0 @@ -execute if score chop_down timber matches 1.. run scoreboard players set chop_down timber 2 -execute unless score chop_down timber matches 1.. run scoreboard players set chop_down timber 1 -execute if score chop_down timber matches 2.. run scoreboard players set chop_down timber 0 -execute if score chop_down timber matches 1 run playsound minecraft:ui.button.click master @s ~ ~ ~ .2 1.9 .2 -execute if score chop_down timber matches 0 run playsound minecraft:ui.button.click master @s ~ ~ ~ .2 1.3 .2 -function timber:settings/settings -function timber:settings/end_of_message \ No newline at end of file diff --git a/data/timber/function/settings/toggle/chop_fungi.mcfunction b/data/timber/function/settings/toggle/chop_fungi.mcfunction deleted file mode 100644 index 22614b8..0000000 --- a/data/timber/function/settings/toggle/chop_fungi.mcfunction +++ /dev/null @@ -1,7 +0,0 @@ -execute if score chop_fungi timber matches 1.. run scoreboard players set chop_fungi timber 2 -execute unless score chop_fungi timber matches 1.. run scoreboard players set chop_fungi timber 1 -execute if score chop_fungi timber matches 2.. run scoreboard players set chop_fungi timber 0 -execute if score chop_fungi timber matches 1 run playsound minecraft:ui.button.click master @s ~ ~ ~ .2 1.9 .2 -execute if score chop_fungi timber matches 0 run playsound minecraft:ui.button.click master @s ~ ~ ~ .2 1.3 .2 -function timber:settings/settings2 -function timber:settings/end_of_message \ No newline at end of file diff --git a/data/timber/function/settings/toggle/chop_trees.mcfunction b/data/timber/function/settings/toggle/chop_trees.mcfunction deleted file mode 100644 index 19fe627..0000000 --- a/data/timber/function/settings/toggle/chop_trees.mcfunction +++ /dev/null @@ -1,7 +0,0 @@ -execute if score chop_trees timber matches 1.. run scoreboard players set chop_trees timber 2 -execute unless score chop_trees timber matches 1.. run scoreboard players set chop_trees timber 1 -execute if score chop_trees timber matches 2.. run scoreboard players set chop_trees timber 0 -execute if score chop_trees timber matches 1 run playsound minecraft:ui.button.click master @s ~ ~ ~ .2 1.9 .2 -execute if score chop_trees timber matches 0 run playsound minecraft:ui.button.click master @s ~ ~ ~ .2 1.3 .2 -function timber:settings/settings2 -function timber:settings/end_of_message \ No newline at end of file diff --git a/data/timber/function/settings/toggle/copper_axe.mcfunction b/data/timber/function/settings/toggle/copper_axe.mcfunction deleted file mode 100644 index 63fac10..0000000 --- a/data/timber/function/settings/toggle/copper_axe.mcfunction +++ /dev/null @@ -1,7 +0,0 @@ -execute if score copper_axe timber matches 1.. run scoreboard players set copper_axe timber 2 -execute unless score copper_axe timber matches 1.. run scoreboard players set copper_axe timber 1 -execute if score copper_axe timber matches 2.. run scoreboard players set copper_axe timber 0 -execute if score copper_axe timber matches 1 run playsound minecraft:ui.button.click master @s ~ ~ ~ .2 1.9 .2 -execute if score copper_axe timber matches 0 run playsound minecraft:ui.button.click master @s ~ ~ ~ .2 1.3 .2 -function timber:settings/settings2 -function timber:settings/end_of_message diff --git a/data/timber/function/settings/toggle/destroy_leaves.mcfunction b/data/timber/function/settings/toggle/destroy_leaves.mcfunction deleted file mode 100644 index 346bced..0000000 --- a/data/timber/function/settings/toggle/destroy_leaves.mcfunction +++ /dev/null @@ -1,7 +0,0 @@ -execute if score destroy_leaves timber matches 1.. run scoreboard players set destroy_leaves timber 2 -execute unless score destroy_leaves timber matches 1.. run scoreboard players set destroy_leaves timber 1 -execute if score destroy_leaves timber matches 2.. run scoreboard players set destroy_leaves timber 0 -execute if score destroy_leaves timber matches 1 run playsound minecraft:ui.button.click master @s ~ ~ ~ .2 1.9 .2 -execute if score destroy_leaves timber matches 0 run playsound minecraft:ui.button.click master @s ~ ~ ~ .2 1.3 .2 -function timber:settings/settings -function timber:settings/end_of_message \ No newline at end of file diff --git a/data/timber/function/settings/toggle/destroy_roots.mcfunction b/data/timber/function/settings/toggle/destroy_roots.mcfunction deleted file mode 100644 index 87a6906..0000000 --- a/data/timber/function/settings/toggle/destroy_roots.mcfunction +++ /dev/null @@ -1,7 +0,0 @@ -execute if score destroy_roots timber matches 1.. run scoreboard players set destroy_roots timber 2 -execute unless score destroy_roots timber matches 1.. run scoreboard players set destroy_roots timber 1 -execute if score destroy_roots timber matches 2.. run scoreboard players set destroy_roots timber 0 -execute if score destroy_roots timber matches 1 run playsound minecraft:ui.button.click master @s ~ ~ ~ .2 1.9 .2 -execute if score destroy_roots timber matches 0 run playsound minecraft:ui.button.click master @s ~ ~ ~ .2 1.3 .2 -function timber:settings/settings -function timber:settings/end_of_message \ No newline at end of file diff --git a/data/timber/function/settings/toggle/diamond_axe.mcfunction b/data/timber/function/settings/toggle/diamond_axe.mcfunction deleted file mode 100644 index 83e45d8..0000000 --- a/data/timber/function/settings/toggle/diamond_axe.mcfunction +++ /dev/null @@ -1,7 +0,0 @@ -execute if score diamond_axe timber matches 1.. run scoreboard players set diamond_axe timber 2 -execute unless score diamond_axe timber matches 1.. run scoreboard players set diamond_axe timber 1 -execute if score diamond_axe timber matches 2.. run scoreboard players set diamond_axe timber 0 -execute if score diamond_axe timber matches 1 run playsound minecraft:ui.button.click master @s ~ ~ ~ .2 1.9 .2 -execute if score diamond_axe timber matches 0 run playsound minecraft:ui.button.click master @s ~ ~ ~ .2 1.3 .2 -function timber:settings/settings2 -function timber:settings/end_of_message \ No newline at end of file diff --git a/data/timber/function/settings/toggle/drop_loot.mcfunction b/data/timber/function/settings/toggle/drop_loot.mcfunction deleted file mode 100644 index dc35415..0000000 --- a/data/timber/function/settings/toggle/drop_loot.mcfunction +++ /dev/null @@ -1,7 +0,0 @@ -execute if score drop_loot timber matches 1.. run scoreboard players set drop_loot timber 2 -execute unless score drop_loot timber matches 1.. run scoreboard players set drop_loot timber 1 -execute if score drop_loot timber matches 2.. run scoreboard players set drop_loot timber 0 -execute if score drop_loot timber matches 1 run playsound minecraft:ui.button.click master @s ~ ~ ~ .2 1.9 .2 -execute if score drop_loot timber matches 0 run playsound minecraft:ui.button.click master @s ~ ~ ~ .2 1.3 .2 -function timber:settings/settings -function timber:settings/end_of_message \ No newline at end of file diff --git a/data/timber/function/settings/toggle/golden_axe.mcfunction b/data/timber/function/settings/toggle/golden_axe.mcfunction deleted file mode 100644 index f21f5b8..0000000 --- a/data/timber/function/settings/toggle/golden_axe.mcfunction +++ /dev/null @@ -1,7 +0,0 @@ -execute if score golden_axe timber matches 1.. run scoreboard players set golden_axe timber 2 -execute unless score golden_axe timber matches 1.. run scoreboard players set golden_axe timber 1 -execute if score golden_axe timber matches 2.. run scoreboard players set golden_axe timber 0 -execute if score golden_axe timber matches 1 run playsound minecraft:ui.button.click master @s ~ ~ ~ .2 1.9 .2 -execute if score golden_axe timber matches 0 run playsound minecraft:ui.button.click master @s ~ ~ ~ .2 1.3 .2 -function timber:settings/settings2 -function timber:settings/end_of_message \ No newline at end of file diff --git a/data/timber/function/settings/toggle/hunger.mcfunction b/data/timber/function/settings/toggle/hunger.mcfunction deleted file mode 100644 index b1e9543..0000000 --- a/data/timber/function/settings/toggle/hunger.mcfunction +++ /dev/null @@ -1,7 +0,0 @@ -execute if score hunger timber matches 1.. run scoreboard players set hunger timber 2 -execute unless score hunger timber matches 1.. run scoreboard players set hunger timber 1 -execute if score hunger timber matches 2.. run scoreboard players set hunger timber 0 -execute if score hunger timber matches 1 run playsound minecraft:ui.button.click master @s ~ ~ ~ .2 1.9 .2 -execute if score hunger timber matches 0 run playsound minecraft:ui.button.click master @s ~ ~ ~ .2 1.3 .2 -function timber:settings/settings1 -function timber:settings/end_of_message \ No newline at end of file diff --git a/data/timber/function/settings/toggle/interfere.mcfunction b/data/timber/function/settings/toggle/interfere.mcfunction deleted file mode 100644 index b1270d0..0000000 --- a/data/timber/function/settings/toggle/interfere.mcfunction +++ /dev/null @@ -1,7 +0,0 @@ -execute if score interfere timber matches 1.. run scoreboard players set interfere timber 2 -execute unless score interfere timber matches 1.. run scoreboard players set interfere timber 1 -execute if score interfere timber matches 2.. run scoreboard players set interfere timber 0 -execute if score interfere timber matches 1 run playsound minecraft:ui.button.click master @s ~ ~ ~ .2 1.9 .2 -execute if score interfere timber matches 0 run playsound minecraft:ui.button.click master @s ~ ~ ~ .2 1.3 .2 -function timber:settings/settings -function timber:settings/end_of_message \ No newline at end of file diff --git a/data/timber/function/settings/toggle/iron_axe.mcfunction b/data/timber/function/settings/toggle/iron_axe.mcfunction deleted file mode 100644 index bf08c1f..0000000 --- a/data/timber/function/settings/toggle/iron_axe.mcfunction +++ /dev/null @@ -1,7 +0,0 @@ -execute if score iron_axe timber matches 1.. run scoreboard players set iron_axe timber 2 -execute unless score iron_axe timber matches 1.. run scoreboard players set iron_axe timber 1 -execute if score iron_axe timber matches 2.. run scoreboard players set iron_axe timber 0 -execute if score iron_axe timber matches 1 run playsound minecraft:ui.button.click master @s ~ ~ ~ .2 1.9 .2 -execute if score iron_axe timber matches 0 run playsound minecraft:ui.button.click master @s ~ ~ ~ .2 1.3 .2 -function timber:settings/settings2 -function timber:settings/end_of_message \ No newline at end of file diff --git a/data/timber/function/settings/toggle/netherite_axe.mcfunction b/data/timber/function/settings/toggle/netherite_axe.mcfunction deleted file mode 100644 index 17f6528..0000000 --- a/data/timber/function/settings/toggle/netherite_axe.mcfunction +++ /dev/null @@ -1,7 +0,0 @@ -execute if score netherite_axe timber matches 1.. run scoreboard players set netherite_axe timber 2 -execute unless score netherite_axe timber matches 1.. run scoreboard players set netherite_axe timber 1 -execute if score netherite_axe timber matches 2.. run scoreboard players set netherite_axe timber 0 -execute if score netherite_axe timber matches 1 run playsound minecraft:ui.button.click master @s ~ ~ ~ .2 1.9 .2 -execute if score netherite_axe timber matches 0 run playsound minecraft:ui.button.click master @s ~ ~ ~ .2 1.3 .2 -function timber:settings/settings2 -function timber:settings/end_of_message \ No newline at end of file diff --git a/data/timber/function/settings/toggle/persistent.mcfunction b/data/timber/function/settings/toggle/persistent.mcfunction deleted file mode 100644 index 58bad84..0000000 --- a/data/timber/function/settings/toggle/persistent.mcfunction +++ /dev/null @@ -1,7 +0,0 @@ -execute if score persistent timber matches 1.. run scoreboard players set persistent timber 2 -execute unless score persistent timber matches 1.. run scoreboard players set persistent timber 1 -execute if score persistent timber matches 2.. run scoreboard players set persistent timber 0 -execute if score persistent timber matches 1 run playsound minecraft:ui.button.click master @s ~ ~ ~ .2 1.9 .2 -execute if score persistent timber matches 0 run playsound minecraft:ui.button.click master @s ~ ~ ~ .2 1.3 .2 -function timber:settings/settings2 -function timber:settings/end_of_message \ No newline at end of file diff --git a/data/timber/function/settings/toggle/plant_sapling.mcfunction b/data/timber/function/settings/toggle/plant_sapling.mcfunction deleted file mode 100644 index a6efdc3..0000000 --- a/data/timber/function/settings/toggle/plant_sapling.mcfunction +++ /dev/null @@ -1,8 +0,0 @@ -execute if score plant_sapling timber matches 1.. run scoreboard players set plant_sapling timber 2 -execute unless score plant_sapling timber matches 1.. run scoreboard players set plant_sapling timber 1 -execute if score plant_sapling timber matches 2.. run scoreboard players set plant_sapling timber 0 -execute if score plant_sapling timber matches 1 run playsound minecraft:ui.button.click master @s ~ ~ ~ .2 1.9 .2 -execute if score plant_sapling timber matches 1 run function timber:autoplant/loop -execute if score plant_sapling timber matches 0 run playsound minecraft:ui.button.click master @s ~ ~ ~ .2 1.3 .2 -function timber:settings/settings1 -function timber:settings/end_of_message \ No newline at end of file diff --git a/data/timber/function/settings/toggle/slow_chop.mcfunction b/data/timber/function/settings/toggle/slow_chop.mcfunction deleted file mode 100644 index 0a0989c..0000000 --- a/data/timber/function/settings/toggle/slow_chop.mcfunction +++ /dev/null @@ -1,8 +0,0 @@ -execute if score slow_chop timber matches 1.. run scoreboard players set slow_chop timber 2 -execute unless score slow_chop timber matches 1.. run scoreboard players set slow_chop timber 1 -execute if score slow_chop timber matches 2.. run scoreboard players set slow_chop timber 0 -execute if score slow_chop timber matches 1 run playsound minecraft:ui.button.click master @s ~ ~ ~ .2 1.9 .2 -execute if score slow_chop timber matches 1 run function timber:slow_chop/loop -execute if score slow_chop timber matches 0 run playsound minecraft:ui.button.click master @s ~ ~ ~ .2 1.3 .2 -function timber:settings/settings1 -function timber:settings/end_of_message \ No newline at end of file diff --git a/data/timber/function/settings/toggle/sneaking.mcfunction b/data/timber/function/settings/toggle/sneaking.mcfunction deleted file mode 100644 index 53f5141..0000000 --- a/data/timber/function/settings/toggle/sneaking.mcfunction +++ /dev/null @@ -1,7 +0,0 @@ -execute if score sneaking timber matches 1.. run scoreboard players set sneaking timber 2 -execute unless score sneaking timber matches 1.. run scoreboard players set sneaking timber 1 -execute if score sneaking timber matches 2.. run scoreboard players set sneaking timber 0 -execute if score sneaking timber matches 1 run playsound minecraft:ui.button.click master @s ~ ~ ~ .2 1.9 .2 -execute if score sneaking timber matches 0 run playsound minecraft:ui.button.click master @s ~ ~ ~ .2 1.3 .2 -function timber:settings/settings -function timber:settings/end_of_message \ No newline at end of file diff --git a/data/timber/function/settings/toggle/standing.mcfunction b/data/timber/function/settings/toggle/standing.mcfunction deleted file mode 100644 index 08c661d..0000000 --- a/data/timber/function/settings/toggle/standing.mcfunction +++ /dev/null @@ -1,7 +0,0 @@ -execute if score standing timber matches 1.. run scoreboard players set standing timber 2 -execute unless score standing timber matches 1.. run scoreboard players set standing timber 1 -execute if score standing timber matches 2.. run scoreboard players set standing timber 0 -execute if score standing timber matches 1 run playsound minecraft:ui.button.click master @s ~ ~ ~ .2 1.9 .2 -execute if score standing timber matches 0 run playsound minecraft:ui.button.click master @s ~ ~ ~ .2 1.3 .2 -function timber:settings/settings -function timber:settings/end_of_message \ No newline at end of file diff --git a/data/timber/function/settings/toggle/start_chop_on_root.mcfunction b/data/timber/function/settings/toggle/start_chop_on_root.mcfunction deleted file mode 100644 index e04a2b7..0000000 --- a/data/timber/function/settings/toggle/start_chop_on_root.mcfunction +++ /dev/null @@ -1,7 +0,0 @@ -execute if score start_chop_on_root timber matches 1.. run scoreboard players set start_chop_on_root timber 2 -execute unless score start_chop_on_root timber matches 1.. run scoreboard players set start_chop_on_root timber 1 -execute if score start_chop_on_root timber matches 2.. run scoreboard players set start_chop_on_root timber 0 -execute if score start_chop_on_root timber matches 1 run playsound minecraft:ui.button.click master @s ~ ~ ~ .2 1.9 .2 -execute if score start_chop_on_root timber matches 0 run playsound minecraft:ui.button.click master @s ~ ~ ~ .2 1.3 .2 -function timber:settings/settings -function timber:settings/end_of_message \ No newline at end of file diff --git a/data/timber/function/settings/toggle/stone_axe.mcfunction b/data/timber/function/settings/toggle/stone_axe.mcfunction deleted file mode 100644 index 641459d..0000000 --- a/data/timber/function/settings/toggle/stone_axe.mcfunction +++ /dev/null @@ -1,7 +0,0 @@ -execute if score stone_axe timber matches 1.. run scoreboard players set stone_axe timber 2 -execute unless score stone_axe timber matches 1.. run scoreboard players set stone_axe timber 1 -execute if score stone_axe timber matches 2.. run scoreboard players set stone_axe timber 0 -execute if score stone_axe timber matches 1 run playsound minecraft:ui.button.click master @s ~ ~ ~ .2 1.9 .2 -execute if score stone_axe timber matches 0 run playsound minecraft:ui.button.click master @s ~ ~ ~ .2 1.3 .2 -function timber:settings/settings2 -function timber:settings/end_of_message \ No newline at end of file diff --git a/data/timber/function/settings/toggle/stop_chopping.mcfunction b/data/timber/function/settings/toggle/stop_chopping.mcfunction deleted file mode 100644 index b13140f..0000000 --- a/data/timber/function/settings/toggle/stop_chopping.mcfunction +++ /dev/null @@ -1,7 +0,0 @@ -execute if score stop_chopping timber matches 1.. run scoreboard players set stop_chopping timber 2 -execute unless score stop_chopping timber matches 1.. run scoreboard players set stop_chopping timber 1 -execute if score stop_chopping timber matches 2.. run scoreboard players set stop_chopping timber 0 -execute if score stop_chopping timber matches 1 run playsound minecraft:ui.button.click master @s ~ ~ ~ .2 1.9 .2 -execute if score stop_chopping timber matches 0 run playsound minecraft:ui.button.click master @s ~ ~ ~ .2 1.3 .2 -function timber:settings/settings -function timber:settings/end_of_message \ No newline at end of file diff --git a/data/timber/function/settings/toggle/stopsound.mcfunction b/data/timber/function/settings/toggle/stopsound.mcfunction deleted file mode 100644 index 9418b18..0000000 --- a/data/timber/function/settings/toggle/stopsound.mcfunction +++ /dev/null @@ -1,7 +0,0 @@ -execute if score stopsound timber matches 1.. run scoreboard players set stopsound timber 2 -execute unless score stopsound timber matches 1.. run scoreboard players set stopsound timber 1 -execute if score stopsound timber matches 2.. run scoreboard players set stopsound timber 0 -execute if score stopsound timber matches 1 run playsound minecraft:ui.button.click master @s ~ ~ ~ .2 1.9 .2 -execute if score stopsound timber matches 0 run playsound minecraft:ui.button.click master @s ~ ~ ~ .2 1.3 .2 -function timber:settings/settings -function timber:settings/end_of_message \ No newline at end of file diff --git a/data/timber/function/settings/toggle/wear_out.mcfunction b/data/timber/function/settings/toggle/wear_out.mcfunction deleted file mode 100644 index 0bad5ec..0000000 --- a/data/timber/function/settings/toggle/wear_out.mcfunction +++ /dev/null @@ -1,7 +0,0 @@ -execute if score wear_out timber matches 1.. run scoreboard players set wear_out timber 2 -execute unless score wear_out timber matches 1.. run scoreboard players set wear_out timber 1 -execute if score wear_out timber matches 2.. run scoreboard players set wear_out timber 0 -execute if score wear_out timber matches 1 run playsound minecraft:ui.button.click master @s ~ ~ ~ .2 1.9 .2 -execute if score wear_out timber matches 0 run playsound minecraft:ui.button.click master @s ~ ~ ~ .2 1.3 .2 -function timber:settings/settings -function timber:settings/end_of_message \ No newline at end of file diff --git a/data/timber/function/settings/toggle/wooden_axe.mcfunction b/data/timber/function/settings/toggle/wooden_axe.mcfunction deleted file mode 100644 index cb82456..0000000 --- a/data/timber/function/settings/toggle/wooden_axe.mcfunction +++ /dev/null @@ -1,7 +0,0 @@ -execute if score wooden_axe timber matches 1.. run scoreboard players set wooden_axe timber 2 -execute unless score wooden_axe timber matches 1.. run scoreboard players set wooden_axe timber 1 -execute if score wooden_axe timber matches 2.. run scoreboard players set wooden_axe timber 0 -execute if score wooden_axe timber matches 1 run playsound minecraft:ui.button.click master @s ~ ~ ~ .2 1.9 .2 -execute if score wooden_axe timber matches 0 run playsound minecraft:ui.button.click master @s ~ ~ ~ .2 1.3 .2 -function timber:settings/settings2 -function timber:settings/end_of_message \ No newline at end of file diff --git a/data/timber/function/settings/toggle_self.mcfunction b/data/timber/function/settings/toggle_self.mcfunction new file mode 100644 index 0000000..ff98e67 --- /dev/null +++ b/data/timber/function/settings/toggle_self.mcfunction @@ -0,0 +1,3 @@ +# toggles Timber for the player and shows the help dialog again +function timber:settings/toggle/timber +function timber:settings/open/help diff --git a/data/timber/function/uninstall.mcfunction b/data/timber/function/uninstall.mcfunction index a76ceb7..bce2e88 100644 --- a/data/timber/function/uninstall.mcfunction +++ b/data/timber/function/uninstall.mcfunction @@ -11,6 +11,12 @@ scoreboard objectives remove timber_d_axe scoreboard objectives remove timber_n_axe scoreboard objectives remove timber scoreboard objectives remove TimberToggle +scoreboard objectives remove TimberSettings +scoreboard objectives remove TimberSetBlocks +scoreboard objectives remove TimberSetTicks +scoreboard objectives remove TimberSetTreeSize +scoreboard objectives remove TimberSetLeaves +scoreboard objectives remove timber_menu scoreboard objectives remove timber_disabled scoreboard objectives remove timber_prsistent diff --git a/pack.mcmeta b/pack.mcmeta index b436450..c9f3a12 100644 --- a/pack.mcmeta +++ b/pack.mcmeta @@ -2,18 +2,12 @@ "pack": { "description": "Timber Datapack allows you to instantly chop down a tree just by breaking one log", "pack_format": 121.0, - "supported_formats": [18, 121.0], - "min_format": 18, + "min_format": 101.0, "max_format": 121.0 }, "overlays": { "entries": [ - {"formats": [121, 121], "directory": "121", "min_format": 121, "max_format": 121}, - {"formats": [82, 88], "directory": "82-88", "min_format": 82, "max_format": 88}, - {"formats": [18, 81], "directory": "18-81", "min_format": 18, "max_format": 81}, - {"formats": [18, 61], "directory": "18-61"}, - {"formats": [18, 41], "directory": "18-41"}, - {"formats": [18, 26], "directory": "18-26"} + {"directory": "121", "min_format": 121, "max_format": 121} ] } -} \ No newline at end of file +} diff --git a/tests/data/timber_test/test/chop_oak_tree.mcfunction b/tests/data/timber_test/test/chop_oak_tree.mcfunction new file mode 100644 index 0000000..cccc070 --- /dev/null +++ b/tests/data/timber_test/test/chop_oak_tree.mcfunction @@ -0,0 +1,26 @@ +#> Mining the bottom log of an oak tree with an axe chops down the whole tree +# @timeout 200 +# @skyaccess true + +# platform +fill ~-3 ~-1 ~-4 ~5 ~-1 ~4 minecraft:dirt + +# oak tree: 5 logs high with leaves around the top +fill ~2 ~ ~ ~2 ~4 ~ minecraft:oak_log +fill ~1 ~3 ~-2 ~3 ~4 ~2 minecraft:oak_leaves replace minecraft:air +assert block ~2 ~4 ~ minecraft:oak_log +assert block ~1 ~3 ~ minecraft:oak_leaves + +# player mines the bottom log with an axe +dummy tester spawn +tp @e[type=minecraft:player,name=tester,limit=1] ~0.5 ~ ~0.5 +item replace entity @e[type=minecraft:player,name=tester,limit=1] weapon.mainhand with minecraft:iron_axe +dummy tester mine ~2 ~ ~ + +# the top log can only disappear when the whole tree is chopped +await delay 2s +assert not block ~2 ~4 ~ minecraft:oak_log +assert not block ~2 ~1 ~ minecraft:oak_log +assert not block ~2 ~3 ~ minecraft:oak_log +assert not block ~1 ~3 ~ minecraft:oak_leaves +assert not block ~3 ~4 ~ minecraft:oak_leaves diff --git a/tests/pack.mcmeta b/tests/pack.mcmeta new file mode 100644 index 0000000..26312cd --- /dev/null +++ b/tests/pack.mcmeta @@ -0,0 +1,8 @@ +{ + "pack": { + "description": "Tests for Timber Datapack (run with PackTest)", + "pack_format": 121.0, + "min_format": 101.0, + "max_format": 121.0 + } +}