updated tags and scoreboards

added sound to action
fixed damage when in offhand
This commit is contained in:
2025-05-15 23:20:41 +01:00
parent e2b221eed0
commit 329f879cd8
133 changed files with 1287 additions and 1284 deletions

View File

@@ -1,13 +1,13 @@
scoreboard players reset @s lz_trowel_unbreaking_check
scoreboard players reset @s lzt_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
execute if score @s lzt_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
data modify storage lzstools:trowel components set from entity @s equipment.offhand.components
execute store result score @s lzt_trowel_damage run data get storage lzstools:trowel components."minecraft:damage"
execute store result score @s lzt_trowel_max_damage run data get storage lzstools:trowel components."minecraft:max_damage"
scoreboard players add @s lzt_trowel_damage 1
execute store result storage lzstools:trowel damage int 1 run scoreboard players get @s lzt_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
execute if score @s lzt_trowel_damage >= @s lzt_trowel_max_damage run function lzstools_trowel:durability/offhand/break

View File

@@ -1,4 +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
execute store result score @s lzt_trowel_unbreaking_chance run random value 1..100
execute if entity @s[predicate=lzstools:unbreaking/offhand/3] if score @s lzt_trowel_unbreaking_chance matches ..75 run return run scoreboard players set @s lzt_trowel_unbreaking_check 1
execute if entity @s[predicate=lzstools:unbreaking/offhand/2] if score @s lzt_trowel_unbreaking_chance matches ..66 run return run scoreboard players set @s lzt_trowel_unbreaking_check 1
execute if entity @s[predicate=lzstools:unbreaking/offhand/1] if score @s lzt_trowel_unbreaking_chance matches ..50 run return run scoreboard players set @s lzt_trowel_unbreaking_check 1