updated tags and scoreboards
added sound to action fixed damage when in offhand
This commit is contained in:
@@ -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/mainhand/all] run function lzstools_trowel:durability/mainhand/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
|
||||
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/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
|
||||
execute if score @s lzt_trowel_damage >= @s lzt_trowel_max_damage run function lzstools_trowel:durability/mainhand/break
|
@@ -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/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
|
||||
execute store result score @s lzt_trowel_unbreaking_chance run random value 1..100
|
||||
execute if entity @s[predicate=lzstools:unbreaking/mainhand/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/mainhand/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/mainhand/1] if score @s lzt_trowel_unbreaking_chance matches ..50 run return run scoreboard players set @s lzt_trowel_unbreaking_check 1
|
||||
|
@@ -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
|
@@ -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
|
||||
|
Reference in New Issue
Block a user