-
-
Notifications
You must be signed in to change notification settings - Fork 68
1.21.5 heart canisters update #1122
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
misode
merged 4 commits into
Gamemode4Dev:update-1.21.5
from
TheThanathor:update-1.21.5-heart-canisters-update
May 10, 2025
Merged
Changes from 1 commit
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
30 changes: 19 additions & 11 deletions
30
gm4_heart_canisters/data/gm4_heart_canisters/function/check_heart_canisters.mcfunction
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,13 +1,21 @@ | ||
| # gets called for every player with at least 1 heart canister tier 1 item | ||
| # gets called for every player with at least 1 heart canister item | ||
|
|
||
| scoreboard players set @s[nbt={Inventory:[{count:1,components:{"minecraft:custom_data":{gm4_heart_canister_tier:1b}}}]}] gm4_heart_can 1 | ||
| scoreboard players set @s[nbt={Inventory:[{count:2,components:{"minecraft:custom_data":{gm4_heart_canister_tier:1b}}}]}] gm4_heart_can 2 | ||
| scoreboard players set @s[nbt={Inventory:[{count:3,components:{"minecraft:custom_data":{gm4_heart_canister_tier:1b}}}]}] gm4_heart_can 3 | ||
| scoreboard players set @s[nbt={Inventory:[{count:4,components:{"minecraft:custom_data":{gm4_heart_canister_tier:1b}}}]}] gm4_heart_can 4 | ||
| scoreboard players set @s[nbt={Inventory:[{count:5,components:{"minecraft:custom_data":{gm4_heart_canister_tier:1b}}}]}] gm4_heart_can 5 | ||
| # tier 1 | ||
| scoreboard players set $count_total gm4_heart_can 0 | ||
| data modify storage gm4_heart_cannisters:temp heart_cannister_data set value [] | ||
| data modify storage gm4_heart_cannisters:temp heart_cannister_data append from entity @s Inventory[{components:{"minecraft:custom_data":{gm4_heart_canister_tier:1b}}}] | ||
| 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 | ||
| scoreboard players operation $count_total gm4_heart_can += $count_add gm4_heart_can | ||
| function gm4_heart_canisters:count_heart_canisters | ||
| scoreboard players operation $count_total gm4_heart_can < $heart_cannister_cap gm4_heart_can | ||
| scoreboard players operation @s gm4_heart_can += $count_total gm4_heart_can | ||
|
|
||
| scoreboard players set @s[scores={gm4_heart_can=5..},nbt={Inventory:[{count:1,components:{"minecraft:custom_data":{gm4_heart_canister_tier:2b}}}]}] gm4_heart_can 6 | ||
| scoreboard players set @s[scores={gm4_heart_can=5..},nbt={Inventory:[{count:2,components:{"minecraft:custom_data":{gm4_heart_canister_tier:2b}}}]}] gm4_heart_can 7 | ||
| scoreboard players set @s[scores={gm4_heart_can=5..},nbt={Inventory:[{count:3,components:{"minecraft:custom_data":{gm4_heart_canister_tier:2b}}}]}] gm4_heart_can 8 | ||
| scoreboard players set @s[scores={gm4_heart_can=5..},nbt={Inventory:[{count:4,components:{"minecraft:custom_data":{gm4_heart_canister_tier:2b}}}]}] gm4_heart_can 9 | ||
| scoreboard players set @s[scores={gm4_heart_can=5..},nbt={Inventory:[{count:5,components:{"minecraft:custom_data":{gm4_heart_canister_tier:2b}}}]}] gm4_heart_can 10 | ||
| # tier 2 | ||
| scoreboard players set $count_total gm4_heart_can 0 | ||
| data modify storage gm4_heart_cannisters:temp heart_cannister_data set value [] | ||
| data modify storage gm4_heart_cannisters:temp heart_cannister_data append from entity @s Inventory[{components:{"minecraft:custom_data":{gm4_heart_canister_tier:2b}}}] | ||
| 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 | ||
| scoreboard players operation $count_total gm4_heart_can += $count_add gm4_heart_can | ||
| function gm4_heart_canisters:count_heart_canisters | ||
| scoreboard players operation $count_total gm4_heart_can < $heart_cannister_cap gm4_heart_can | ||
| scoreboard players operation @s gm4_heart_can += $count_total gm4_heart_can | ||
6 changes: 6 additions & 0 deletions
6
gm4_heart_canisters/data/gm4_heart_canisters/function/count_heart_canisters.mcfunction
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| # count all heart canisters of this tier in the inventory | ||
|
|
||
| execute store result score $count_add gm4_heart_can run data get storage gm4_heart_cannisters:temp heart_cannister_data[0].count | ||
| scoreboard players operation $count_total gm4_heart_can += $count_add gm4_heart_can | ||
| data remove storage gm4_heart_cannisters:temp heart_cannister_data[0] | ||
| execute if data storage gm4_heart_cannisters:temp heart_cannister_data[0] run function gm4_heart_canisters:count_heart_canisters |
2 changes: 2 additions & 0 deletions
2
gm4_heart_canisters/data/gm4_heart_canisters/function/eval_health_boost.mcfunction
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,2 @@ | ||
|
|
||
| $attribute @s minecraft:max_health modifier add minecraft:38a576e7-341b-46ed-a9e3-7b7291beae72 $(amount) add_value |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
gm4_heart_canisters/data/gm4_heart_canisters/function/player.mcfunction
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,6 +1,6 @@ | ||
| # check how many heart canisters the player has | ||
| scoreboard players operation $heart_can_last gm4_heart_can = @s gm4_heart_can | ||
| scoreboard players set @s gm4_heart_can 0 | ||
| execute if predicate gm4_heart_canisters:carries_tier_1 run function gm4_heart_canisters:check_heart_canisters | ||
| execute if predicate gm4_heart_canisters:carries_heart_canister run function gm4_heart_canisters:check_heart_canisters | ||
|
|
||
| execute unless score @s gm4_heart_can = $heart_can_last gm4_heart_can run function gm4_heart_canisters:apply_health_boost |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.