Added Trowel

Fixed issue with wrench
Organised tools into folders
This commit is contained in:
2025-05-15 22:24:08 +01:00
parent 444e5071d4
commit e2b221eed0
225 changed files with 1191 additions and 536 deletions

View File

@@ -0,0 +1,16 @@
# Cancel if intercepting entity
execute if entity @n[distance=..1] run return fail
# Choose Block
function lzstools_trowel:random/start
# No block, don't place and end
execute store result score @s lz_chosen_block_check run data get storage lzstools:trowel chosen_block
execute if score @s lz_chosen_block_check matches 0 run return fail
# Place block
function lzstools_trowel:block/place
# Durability
execute if entity @s[tag=lztools_trowel_mainhand,gamemode=!creative] run function lzstools_trowel:durability/mainhand/handle
execute if entity @s[tag=lztools_trowel_offhand,gamemode=!creative] run function lzstools_trowel:durability/offhand/handle

View File

@@ -0,0 +1,14 @@
## Raycast
# Set block data
execute as @s store result score @s lz_trowel_raycast_hit run loot spawn ~ -65 ~ mine ~ ~ ~ minecraft:netherite_pickaxe[minecraft:enchantments={"minecraft:silk_touch":1}]
execute as @s run kill @n[type=minecraft:item,distance=..0.5,y=-65]
execute as @s if score @s lz_trowel_raycast_hit matches 1 positioned ^ ^ ^-0.01 run function lzstools_trowel:raycast/hit
execute if score @s lz_trowel_raycast_hit matches 1 run tag @s remove lzstools_trowel_mainhand
execute if score @s lz_trowel_raycast_hit matches 1 run tag @s remove lzstools_trowel_offhand
# Advance forward and if nothing found
scoreboard players add #distance lz_trowel_raycast 1
execute if score @s lz_trowel_raycast_hit matches 0 if score #distance lz_trowel_raycast matches ..451 positioned ^ ^ ^0.01 run function lzstools_trowel:raycast/rayloop

View File

@@ -0,0 +1,9 @@
#Setting up the raycasting data.
scoreboard players set #distance lz_trowel_raycast 0
tag @s add lz_trowel_raycast
#Activating the raycast. This function will call itself until it is done.
execute as @e[tag=lz_trowel_raycast] at @s anchored eyes positioned ^ ^ ^ run function lzstools_trowel:raycast/rayloop
#Raycasting finished, removing tag from the raycaster.
tag @s remove lz_trowel_raycast