Skip to content
This repository has been archived by the owner on Jun 8, 2022. It is now read-only.

Commit

Permalink
Fix custom durability over normal durability
Browse files Browse the repository at this point in the history
  • Loading branch information
ICY105 committed Jul 7, 2021
1 parent 1d01ecb commit 75bba56
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion data/du/advancements/base.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"display": {
"title": "Datapack Utils",
"description": "v2.3.0",
"description": "v2.3.1",
"icon": {
"item": "minecraft:redstone"
},
Expand Down
2 changes: 1 addition & 1 deletion data/du/functions/load.mcfunction
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ scoreboard objectives add pregen_radius trigger
#version
scoreboard players set $du.ver.major load.status 2
scoreboard players set $du.ver.minor load.status 3
scoreboard players set $du.ver.fix load.status 0
scoreboard players set $du.ver.fix load.status 1

#Team Data
team add du_nopush
Expand Down
4 changes: 2 additions & 2 deletions data/du/functions/load_message.mcfunction
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@ scoreboard players set $install du_data 1
execute store result score $minecraft.version du_data run data get entity @p DataVersion

#verify minecraft version
execute unless score $minecraft.version du_data matches 2724.. run scoreboard players set $install du_data 0
execute unless score $minecraft.version du_data matches 2724.. run tellraw @a [{"color":"red","text":"Error: Datapack Utils v"},{"score":{"name":"$du.ver.major","objective":"load.status"}},{"text":"."},{"score":{"name":"$du.ver.minor","objective":"load.status"}},{"text":"."},{"score":{"name":"$du.ver.fix","objective":"load.status"}},{"text":" requires Minecraft 1.17. Click [here] to go to the DU download page for alternate releases.","clickEvent":{"action":"open_url","value":"https://github.com/ImCoolYeah105/Datapack-Utilities/releases"}}]
execute unless score $minecraft.version du_data matches 2730.. run scoreboard players set $install du_data 0
execute unless score $minecraft.version du_data matches 2730.. run tellraw @a [{"color":"red","text":"Error: Datapack Utils v"},{"score":{"name":"$du.ver.major","objective":"load.status"}},{"text":"."},{"score":{"name":"$du.ver.minor","objective":"load.status"}},{"text":"."},{"score":{"name":"$du.ver.fix","objective":"load.status"}},{"text":" requires Minecraft +1.17.1. Click [here] to go to the DU download page for alternate releases.","clickEvent":{"action":"open_url","value":"https://github.com/ImCoolYeah105/Datapack-Utilities/releases"}}]
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ function du:player/durability/get_max_durability
scoreboard players operation $player.temp_1 du_data -= $player.temp_2 du_data
scoreboard players operation $player.temp_0 du_data += $player.temp_1 du_data
scoreboard players operation $player.temp_1 du_data += $player.temp_2 du_data
execute if score $player.temp_4 du_data matches 1.. if score $player.temp_0 du_data > $player.temp_4 du_data run scoreboard players operation $player.temp_0 du_data = $player.temp_4 du_data
execute if score $player.temp_4 du_data matches 1.. if score $player.temp_0 du_data > $player.temp_3 du_data run scoreboard players operation $player.temp_0 du_data = $player.temp_3 du_data
execute if score $player.temp_0 du_data matches ..-1 run scoreboard players set $player.temp_0 du_data -1
execute if score $player.temp_4 du_data matches 1.. store result storage du:temp object.tag.du_dur.dur int 1 run scoreboard players get $player.temp_0 du_data

Expand All @@ -26,7 +26,7 @@ scoreboard players operation $player.temp_4 du_data -= $player.temp_5 du_data

execute if score $player.temp_4 du_data matches 1.. if score $player.temp_4 du_data > $player.temp_6 du_data run scoreboard players operation $player.temp_4 du_data = $player.temp_6 du_data
execute if score $player.temp_4 du_data matches 1.. store result storage du:temp object.tag.Damage int 1 run scoreboard players get $player.temp_4 du_data
execute if score $player.temp_4 du_data matches 1.. store result storage du:temp object.tag.du_dur.damage int 1 run data get storage du:temp object.tag.Damage
execute if score $player.temp_4 du_data matches 1.. store result storage du:temp object.tag.du_dur.damage int 1 run scoreboard players get $player.temp_4 du_data

#change durability of unbreakable items
execute if score $player.temp_4 du_data matches 0 store result score $player.temp_0 du_data run data get storage du:temp object.tag.du_dur.dur
Expand Down

0 comments on commit 75bba56

Please sign in to comment.