-
-
Notifications
You must be signed in to change notification settings - Fork 66
26.2 crossbow cartridges sulfur cube #1298
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
Merged
Changes from all commits
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
16 changes: 9 additions & 7 deletions
16
gm4_crossbow_cartridges/data/gm4_crossbow_cartridges/function/projectile/bucket.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,19 +1,21 @@ | ||
| # Check fish/axolotl and shoot | ||
| # Check bucket type and shoot | ||
| # @s = player using the crossbow | ||
| # at arrow | ||
| # run from check_projectile | ||
|
|
||
| tag @s add gm4_cb_use | ||
|
|
||
| execute if predicate gm4_crossbow_cartridges:items/axolotl run function gm4_crossbow_cartridges:projectile/bucket/axolotl | ||
| execute if predicate gm4_crossbow_cartridges:items/cod run function gm4_crossbow_cartridges:projectile/bucket/cod | ||
| execute if predicate gm4_crossbow_cartridges:items/salmon run function gm4_crossbow_cartridges:projectile/bucket/salmon | ||
| execute if predicate gm4_crossbow_cartridges:items/pufferfish run function gm4_crossbow_cartridges:projectile/bucket/pufferfish | ||
| execute if predicate gm4_crossbow_cartridges:items/tropical run function gm4_crossbow_cartridges:projectile/bucket/tropical | ||
| execute if predicate gm4_crossbow_cartridges:items/axolotl run function gm4_crossbow_cartridges:projectile/bucket/axolotl | ||
| execute if predicate gm4_crossbow_cartridges:items/salmon run function gm4_crossbow_cartridges:projectile/bucket/salmon | ||
| execute if predicate gm4_crossbow_cartridges:items/sulfur_cube run function gm4_crossbow_cartridges:projectile/bucket/sulfur_cube | ||
| execute if predicate gm4_crossbow_cartridges:items/tadpole run function gm4_crossbow_cartridges:projectile/bucket/tadpole | ||
| execute if predicate gm4_crossbow_cartridges:items/tropical run function gm4_crossbow_cartridges:projectile/bucket/tropical | ||
|
|
||
| # give advancement for launching mob in a bucket | ||
| execute unless predicate gm4_crossbow_cartridges:items/sulfur_cube run advancement grant @s only gm4:crossbow_cartridges_bucket | ||
|
|
||
| # replace filled bucket in player's offhand with water bucket | ||
| execute if predicate gm4_crossbow_cartridges:items/sulfur_cube run return run item replace entity @s[gamemode=!creative] weapon.offhand with minecraft:bucket | ||
| item replace entity @s[gamemode=!creative] weapon.offhand with minecraft:water_bucket | ||
|
misode marked this conversation as resolved.
|
||
|
|
||
| # give advancement for launching mob in a bucket | ||
| advancement grant @s only gm4:crossbow_cartridges_bucket | ||
12 changes: 12 additions & 0 deletions
12
.../data/gm4_crossbow_cartridges/function/projectile/bucket/multishot/sulfur_cube.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,12 @@ | ||
| # Summon sulfur cube | ||
| # @s = player using the crossbow | ||
| # at @s | ||
| # run from projectile/bucket | ||
|
|
||
| # replace arrow with sulfur cube and copy data | ||
| summon minecraft:sulfur_cube ~ ~ ~ {FromBucket:1b,Tags:["gm4_cb_projectile"],active_effects:[{id:'minecraft:instant_damage',amplifier:10,duration:1}],Silent:1b,DeathLootTable:"gm4:empty"} | ||
|
|
||
| execute as @e[type=minecraft:sulfur_cube,tag=gm4_cb_projectile,limit=1,distance=..1] run function gm4_crossbow_cartridges:projectile/arrow_motion | ||
|
|
||
| # sulfur cube sound | ||
| playsound minecraft:entity.sulfur_cube.squish player @a[distance=..15] ^ ^ ^1 2 1 |
18 changes: 18 additions & 0 deletions
18
...cartridges/data/gm4_crossbow_cartridges/function/projectile/bucket/sulfur_cube.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,18 @@ | ||
| # Summon sulfur cube | ||
| # @s = player using the crossbow | ||
| # at arrow | ||
| # run from projectile/bucket | ||
|
|
||
| # replace arrow with sulfur cube and copy data | ||
| summon minecraft:sulfur_cube ~ ~ ~ {FromBucket:1b,Tags:["gm4_cb_projectile"],active_effects:[{id:'minecraft:regeneration',amplifier:10,duration:200,show_particles:0b}]} | ||
|
|
||
| data modify storage gm4_crossbow_cartridges:temp projectile.Age merge from entity @s equipment.offhand.components."minecraft:bucket_entity_data".age | ||
| data modify storage gm4_crossbow_cartridges:temp projectile.AgeLocked merge from entity @s equipment.offhand.components."minecraft:bucket_entity_data".age_locked | ||
| data modify storage gm4_crossbow_cartridges:temp projectile.equipment.body set from entity @s equipment.offhand.components."minecraft:sulfur_cube_content" | ||
| execute as @e[type=minecraft:sulfur_cube,tag=gm4_cb_projectile,limit=1,distance=..1] run function gm4_crossbow_cartridges:projectile/arrow_motion | ||
|
|
||
| # sulfur cube sound | ||
| playsound minecraft:entity.sulfur_cube.squish player @a[distance=..15] ^ ^ ^1 2 1 | ||
|
|
||
| # shoot 2 more if using multishot | ||
| execute at @e[tag=gm4_cb_arrow,distance=..1,limit=2] run function gm4_crossbow_cartridges:projectile/bucket/multishot/sulfur_cube |
23 changes: 8 additions & 15 deletions
23
gm4_crossbow_cartridges/data/gm4_crossbow_cartridges/predicate/items/bucket.json
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,18 +1,11 @@ | ||
| { | ||
| "condition": "minecraft:entity_properties", | ||
| "entity": "this", | ||
| "predicate": { | ||
| "equipment": { | ||
| "offhand": { | ||
| "items": [ | ||
| "minecraft:cod_bucket", | ||
| "minecraft:salmon_bucket", | ||
| "minecraft:pufferfish_bucket", | ||
| "minecraft:tropical_fish_bucket", | ||
| "minecraft:axolotl_bucket", | ||
| "minecraft:tadpole_bucket" | ||
| ] | ||
| } | ||
| "condition": "minecraft:entity_properties", | ||
| "entity": "this", | ||
| "predicate": { | ||
| "equipment": { | ||
| "offhand": { | ||
| "items": "#gm4_crossbow_cartridges:bucket" | ||
| } | ||
| } | ||
| } | ||
| } | ||
| } |
13 changes: 13 additions & 0 deletions
13
gm4_crossbow_cartridges/data/gm4_crossbow_cartridges/predicate/items/sulfur_cube.json
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,13 @@ | ||
| { | ||
| "condition": "minecraft:entity_properties", | ||
| "entity": "this", | ||
| "predicate": { | ||
| "equipment": { | ||
| "offhand": { | ||
| "items": [ | ||
| "minecraft:sulfur_cube_bucket" | ||
| ] | ||
| } | ||
| } | ||
| } | ||
| } |
9 changes: 5 additions & 4 deletions
9
gm4_crossbow_cartridges/data/gm4_crossbow_cartridges/tags/item/bucket.json
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,10 +1,11 @@ | ||
| { | ||
| "values": [ | ||
| "minecraft:axolotl_bucket", | ||
| "minecraft:cod_bucket", | ||
| "minecraft:salmon_bucket", | ||
| "minecraft:pufferfish_bucket", | ||
| "minecraft:tropical_fish_bucket", | ||
| "minecraft:axolotl_bucket", | ||
| "minecraft:tadpole_bucket" | ||
| "minecraft:salmon_bucket", | ||
| "minecraft:sulfur_cube_bucket", | ||
| "minecraft:tadpole_bucket", | ||
| "minecraft:tropical_fish_bucket" | ||
| ] | ||
| } |
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.