|
1 | 1 | # gets called for every player with at least 1 heart canister item |
2 | 2 |
|
3 | 3 | # tier 1 |
4 | | -scoreboard players set $count_total gm4_heart_can 0 |
5 | | -data modify storage gm4_heart_cannisters:temp heart_cannister_data set value [] |
6 | | -data modify storage gm4_heart_cannisters:temp heart_cannister_data append from entity @s Inventory[{components:{"minecraft:custom_data":{gm4_heart_canister_tier:1b}}}] |
7 | | -execute store result score $count_add gm4_heart_can run data get entity @s equipment.offhand{components:{"minecraft:custom_data":{gm4_heart_canister_tier:1b}}}.count |
8 | | -scoreboard players operation $count_total gm4_heart_can += $count_add gm4_heart_can |
9 | | -function gm4_heart_canisters:count_heart_canisters |
10 | | -scoreboard players operation $count_total gm4_heart_can < $heart_cannister_cap gm4_heart_can |
11 | | -scoreboard players operation @s gm4_heart_can += $count_total gm4_heart_can |
| 4 | +execute store result score @s gm4_heart_can if items entity @s container.* player_head[custom_data~{gm4_heart_canister_tier:1b}] |
| 5 | +execute store result score $count_add gm4_heart_can if items entity @s weapon.offhand player_head[custom_data~{gm4_heart_canister_tier:1b}] |
| 6 | +scoreboard players operation @s gm4_heart_can += $count_add gm4_heart_can |
| 7 | +scoreboard players operation @s gm4_heart_can < $heart_cannister_cap gm4_heart_can |
12 | 8 |
|
13 | 9 | # tier 2 |
14 | | -scoreboard players set $count_total gm4_heart_can 0 |
15 | | -data modify storage gm4_heart_cannisters:temp heart_cannister_data set value [] |
16 | | -data modify storage gm4_heart_cannisters:temp heart_cannister_data append from entity @s Inventory[{components:{"minecraft:custom_data":{gm4_heart_canister_tier:2b}}}] |
17 | | -execute store result score $count_add gm4_heart_can run data get entity @s equipment.offhand{components:{"minecraft:custom_data":{gm4_heart_canister_tier:2b}}}.count |
18 | | -scoreboard players operation $count_total gm4_heart_can += $count_add gm4_heart_can |
19 | | -function gm4_heart_canisters:count_heart_canisters |
20 | | -scoreboard players operation $count_total gm4_heart_can < $heart_cannister_cap gm4_heart_can |
21 | | -scoreboard players operation @s gm4_heart_can += $count_total gm4_heart_can |
| 10 | +execute store result score $count_tier2 gm4_heart_can if items entity @s container.* player_head[custom_data~{gm4_heart_canister_tier:2b}] |
| 11 | +execute store result score $count_add gm4_heart_can if items entity @s weapon.offhand player_head[custom_data~{gm4_heart_canister_tier:2b}] |
| 12 | +scoreboard players operation $count_tier2 gm4_heart_can += $count_add gm4_heart_can |
| 13 | +scoreboard players operation $count_tier2 gm4_heart_can < $heart_cannister_cap gm4_heart_can |
| 14 | +scoreboard players operation @s gm4_heart_can += $count_tier2 gm4_heart_can |
0 commit comments