Skip to content

Commit

Permalink
two small fixes
Browse files Browse the repository at this point in the history
- fix unbreakable check to only allow numeric tags (int, short, long, byte)
- remove unnecessary xp scoreboards
  • Loading branch information
BPR02 committed Aug 5, 2023
1 parent 28e6624 commit 113f7f0
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ execute store result score $unbreaking_lvl smithed.item run data get storage smi

# check if the item is unbreakable
scoreboard players set $unbreakable smithed.item 0
execute store result score $unbreakable smithed.item run data get storage smithed.item:main item.tag.Unbreakable
execute store result score $unbreakable smithed.item run data get storage smithed.item:main item.tag.Unbreakable 1
execute unless score $unbreakable smithed.item matches 0 run scoreboard players set $unbreaking_lvl smithed.item -1

# if delta is positive (i.e. adding durability), ignore unbreaking
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,4 @@ scoreboard players set 16 smithed.const 16
scoreboard players set 2 smithed.const 2
scoreboard players set 0 smithed.const 0

scoreboard objectives add smithed.xp xp
scoreboard objectives add smithed.item.prev_xp dummy

#declare storage smithed.item:main

0 comments on commit 113f7f0

Please sign in to comment.