Skip to content

Commit

Permalink
modular chestplate with elytra damages elytra instead of plates
Browse files Browse the repository at this point in the history
  • Loading branch information
ICY105 committed Aug 29, 2022
1 parent 3bb5388 commit da529f8
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ scoreboard players operation #shield mechanization.data += #value mechanization.

execute store result score #damage mechanization.data run data get entity @s Inventory[{Slot:102b}].tag.Damage
execute if score #damage mechanization.data matches 1.. run item replace block -30000000 0 3201 container.0 from entity @s armor.chest
execute if score #damage mechanization.data matches 1.. if entity @s[gamemode=!creative] run function mechanization:gadgets/player/damage_upgrades
execute if score #damage mechanization.data matches 1.. if entity @s[gamemode=!creative,tag=!player_action.elyra_flying] run function mechanization:gadgets/player/damage_upgrades
execute if score #damage mechanization.data matches 1.. if entity @s[gamemode=!creative,tag=player_action.elyra_flying] run function mechanization:gadgets/player/modular_armor/damage_elytra
execute if score #damage mechanization.data matches 1.. run item replace entity @s armor.chest from block -30000000 0 3201 container.0
execute if score #damage mechanization.data matches 1.. run item modify entity @s armor.chest mechanization:remove_damage

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@

#store data
scoreboard players set #broken mechanization.data 0
data modify storage mechanization:temp list set from block -30000000 0 3201 Items[0].tag.mechanization.upgrades.items

#add damage
execute store result score #durability mechanization.data run data get storage mechanization:temp list[{id:"minecraft:elytra"}].tag.Damage
execute if score #durability mechanization.data matches ..431 run scoreboard players add #durability mechanization.data 1
execute unless data storage mechanization:temp list[{id:"minecraft:elytra"}].tag{Unbreakable:1b} store result storage mechanization:temp list[{id:"minecraft:elytra"}].tag.Damage int 1 run scoreboard players get #durability mechanization.data
execute if score #durability mechanization.data matches 432.. run scoreboard players set #broken mechanization.data 1

#set data
data modify block -30000000 0 3201 Items[0].tag.mechanization.upgrades.items set from storage mechanization:temp list
execute if score #broken mechanization.data matches 1 run playsound minecraft:entity.item.break player @s
execute if score #broken mechanization.data matches 1 run data modify block -30000000 0 3201 Items[0].id set value "minecraft:leather_chestplate"

0 comments on commit da529f8

Please sign in to comment.