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 @@
$item modify entity @s weapon.mainhand {"function":"minecraft:set_components","components":{"minecraft:damage":$(damage)}}

View File

@@ -0,0 +1,4 @@
execute if entity @s[predicate=lzstools_trowel:mainhand/iron] at @s anchored eyes run particle minecraft:item{item:"minecraft:iron_sword"} ^ ^-0.35 ^0.65 0.1 0.1 0.1 0.06 10 force
execute if entity @s[predicate=lzstools_trowel:mainhand/diamond] at @s anchored eyes run particle minecraft:item{item:"minecraft:diamond_sword"} ^ ^-0.35 ^0.65 0.1 0.1 0.1 0.06 10 force
item replace entity @s weapon.mainhand with minecraft:air
playsound minecraft:entity.item.break master @a ~ ~ ~ 1 1

View File

@@ -0,0 +1,13 @@
scoreboard players reset @s lz_trowel_unbreaking_check
execute if entity @s[predicate=lzstools:unbreaking/mainhand/all] run function lzstools_trowel:durability/mainhand/unbreaking
execute if score @s lz_trowel_unbreaking_check matches 1 run return fail
# Handle Damage
data modify storage lzstools:trowel components set from entity @s SelectedItem.components
execute store result score @s lz_trowel_damage run data get storage lzstools:trowel components."minecraft:damage"
execute store result score @s lz_trowel_max_damage run data get storage lzstools:trowel components."minecraft:max_damage"
scoreboard players add @s lz_trowel_damage 1
execute store result storage lzstools:trowel damage int 1 run scoreboard players get @s lz_trowel_damage
function lzstools_trowel:durability/mainhand/apply with storage lzstools:trowel
execute if score @s lz_trowel_damage >= @s lz_trowel_max_damage run function lzstools_trowel:durability/mainhand/break

View File

@@ -0,0 +1,4 @@
execute store result score @s lz_trowel_unbreaking_chance run random value 1..100
execute if entity @s[predicate=lzstools:unbreaking/mainhand/3] if score @s lz_trowel_unbreaking_chance matches ..75 run return run scoreboard players set @s lz_trowel_unbreaking_check 1
execute if entity @s[predicate=lzstools:unbreaking/mainhand/2] if score @s lz_trowel_unbreaking_chance matches ..66 run return run scoreboard players set @s lz_trowel_unbreaking_check 1
execute if entity @s[predicate=lzstools:unbreaking/mainhand/1] if score @s lz_trowel_unbreaking_chance matches ..50 run return run scoreboard players set @s lz_trowel_unbreaking_check 1

View File

@@ -0,0 +1 @@
$item modify entity @s weapon.offhand {"function":"minecraft:set_components","components":{"minecraft:damage":$(damage)}}

View File

@@ -0,0 +1,4 @@
execute if entity @s[predicate=lzstools_trowel:offhand/iron] at @s anchored eyes run particle minecraft:item{item:"minecraft:iron_sword"} ^ ^-0.35 ^0.65 0.1 0.1 0.1 0.06 10 force
execute if entity @s[predicate=lzstools_trowel:offhand/diamond] at @s anchored eyes run particle minecraft:item{item:"minecraft:diamond_sword"} ^ ^-0.35 ^0.65 0.1 0.1 0.1 0.06 10 force
item replace entity @s weapon.offhand with minecraft:air
playsound minecraft:entity.item.break master @a ~ ~ ~ 1 1

View File

@@ -0,0 +1,13 @@
scoreboard players reset @s lz_trowel_unbreaking_check
execute if entity @s[predicate=lzstools:unbreaking/offhand/all] run function lzstools_trowel:durability/offhand/unbreaking
execute if score @s lz_trowel_unbreaking_check matches 1 run return fail
# Handle Damage
data modify storage lzstools:trowel components set from entity @s SelectedItem.components
execute store result score @s lz_trowel_damage run data get storage lzstools:trowel components."minecraft:damage"
execute store result score @s lz_trowel_max_damage run data get storage lzstools:trowel components."minecraft:max_damage"
scoreboard players add @s lz_trowel_damage 1
execute store result storage lzstools:trowel damage int 1 run scoreboard players get @s lz_trowel_damage
function lzstools_trowel:durability/offhand/apply with storage lzstools:trowel
execute if score @s lz_trowel_damage >= @s lz_trowel_max_damage run function lzstools_trowel:durability/offhand/break

View File

@@ -0,0 +1,4 @@
execute store result score @s lz_trowel_unbreaking_chance run random value 1..100
execute if entity @s[predicate=lzstools:unbreaking/offhand/3] if score @s lz_trowel_unbreaking_chance matches ..75 run return run scoreboard players set @s lz_trowel_unbreaking_check 1
execute if entity @s[predicate=lzstools:unbreaking/offhand/2] if score @s lz_trowel_unbreaking_chance matches ..66 run return run scoreboard players set @s lz_trowel_unbreaking_check 1
execute if entity @s[predicate=lzstools:unbreaking/offhand/1] if score @s lz_trowel_unbreaking_chance matches ..50 run return run scoreboard players set @s lz_trowel_unbreaking_check 1