-
-
Notifications
You must be signed in to change notification settings - Fork 68
Reeling Rods - Module #1104
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
Reeling Rods - Module #1104
Changes from all commits
Commits
Show all changes
108 commits
Select commit
Hold shift + click to select a range
7d48d9b
Initial Commit
runcows 0e7c731
Fix Version Compat
runcows aaed0f7
Add player gamemode check
runcows 11e7606
Fix Allay HandItems[0] being removed instead of set empty
runcows a4a3b57
Add shulker pulling
runcows ac894ad
Fix minecart fishing bobber vertical displacement off by 0.00001
runcows 5f94a20
Fix Allay item summon wrong location
runcows a5c5e14
Add witch potion stealing
runcows 216f956
Slight python change
runcows 0f37745
Add villager theft
runcows b116175
Python changes to allow baby mobs to be processed
runcows 7c22088
Add fox theft
runcows 2bffbbe
Add witch theft limit
runcows 72be04a
Add pig desaddling
runcows 96857d5
Add strider desaddling
runcows f33d99e
Add snow golem beheading
runcows 0b10b51
Add entity TODO list
runcows 340319a
Add wolf armor stealing
runcows 7f4c66e
Add horse type mob item yoinking
runcows 5cc0086
Fix Donkey and Mule code a bit
runcows ca05491
Add Llama yoinking
runcows cd3233e
Python refactor & the start of Dismounting work
runcows 94e5950
Remove witch limit
runcows 1145e15
Fix file new line issue
runcows 04739d7
Switch to id based system for entity selection
runcows 1f0d012
minor text fixes
runcows ec84e1e
more fixes from the id change
runcows 013328e
Fix wrong command syntax :(
runcows 419ede3
Re-Add smithed.entity ignore
runcows 1546ed1
Change id tags to be removed when unneeded
runcows 15ba57d
Merge branch 'master' of https://github.com/Gamemode4Dev/GM4_Datapack…
runcows c1a4249
Vehicle separation passenger transfer
runcows f0f3f64
Add live catch to recommended
runcows 68173db
Misc comments because I need these file changes on my laptop to work …
runcows f2014ee
misc beet changes
runcows 2c59b25
py comment restructure
runcows 1d2df27
Refactor in prep for generic item yoinking
runcows 3910c3c
Refactor & Add Generic Hand/Armor Yoinking
runcows c8c8c6c
Merge branch 'master' of https://github.com/Gamemode4Dev/GM4_Datapack…
runcows dab75bf
Update to 1.21.5
runcows ffa53ba
Merge branch 'master' of https://github.com/Gamemode4Dev/GM4_Datapack…
runcows f2243f0
Some comment changes
runcows d2a9cb1
Missed changes for 1.21.5
runcows d53ceee
Fix shulker teleporting
runcows 6e6f754
Fix chest boat yoinking
runcows dd86466
Rename function for clarity
runcows 3897558
Add Sheep shearing yoinking
runcows 7070c5a
Fix sheep wool yoinking
runcows 6705fbd
Fixes (hopefully)
runcows 1f75214
Add Binding blocking for equipment theft
runcows 2e75cfa
Add Entities
runcows 897c8f0
Optimize bobber id setting
runcows f0214d8
single comment change because nobody can stop me
runcows 96e1209
Fix my id changes & add sounds :D
runcows cbd7dae
Change some player selectors to `@p`
runcows 4b300db
Change a few more player selectors to @p
runcows 2808e2e
Shorten bee anger time
runcows 3982751
Add Barbed Enchantment (#2)
Bloo-dev f2cb1ff
Fix overassigning ID causing breakage
runcows 5df7186
Adjust enchantment cost & rarity
runcows 6954f8d
Remove excess entity_data storage
runcows b1bb5ce
Add Barbed Delayed Damage
Bloo-dev 3994e72
Fix Bleeding Damage not Starting
Bloo-dev 8129bce
Adjust Damage & Particles
Bloo-dev 7697bd7
Add Custom Death Messages
Bloo-dev b9ee649
Adjust Enchantment Weights
Bloo-dev 71bbf4a
Fix Death Messages & Properly Reset Players on Respawn
Bloo-dev eb64212
Fix Bleeding Damage not Triggering for non-Player Entities
Bloo-dev 3d3acff
ID rewrite to use scores & optimization
runcows 8ca0478
Swap enchantment name for translation string
runcows e5340a8
Big Reorganization
runcows a1f8bdd
Add Bloo to credits
runcows d6f68b4
Missed renaming for reorganization
runcows 0c0f6a6
minor changes
runcows fc7a39a
Fix item data not being reset all the time
runcows 54110bb
Change barbed to explode tnt minecarts
runcows 7cd9565
Rework hooked_entity/select_type to use bolt in file instead of gener…
runcows ec3c853
Add drop chance usage to reeling
runcows aa51550
Drop Chance Rework
runcows 488b456
Formatting Changes
runcows 57c7a8c
Merge branch 'master' of https://github.com/Gamemode4Dev/GM4_Datapack…
runcows 4e6c945
Update to 1.21.6
runcows dd5665a
Fix item frame yoinking not respecting fixed tag
runcows 7b53154
Set module to not run if hooked entity is Invulnerable
runcows ec6b70f
Upload Icon
runcows 95c1e10
Merge branch 'fishing-rod-module' of https://github.com/runcows/GM4_D…
runcows c795a35
Uncomment Icon Design in beet.yaml
runcows 56a137b
Initial Guidebook and Readme
runcows 7681105
Merge branch 'master' of https://github.com/Gamemode4Dev/GM4_Datapack…
runcows c4668b2
Automated Guidebook Building Stuff
runcows 03b6570
Update gm4_reeling_rods/data/gm4_reeling_rods/function/id/loop.mcfunc…
runcows 5964b5f
Update gm4_reeling_rods/data/gm4_reeling_rods/function/tick.mcfunction
runcows 71e90bd
A couple of header comments
runcows f9805b1
Update gm4_reeling_rods/generate_files.py
runcows 888e1d3
Fail minecart & mooshroom if passengers
runcows f35b237
Optimize reeling/stealable/steal_hand
runcows 0aa96fc
Clean `generate_files.py` and move a tag command
runcows 9e7ac70
Add enderman falling block yoinking, fix a logical error with motion …
runcows 96c9c22
Update get_motion_to_player header comment
runcows 3d4f199
Update gm4_reeling_rods/data/gm4_reeling_rods/function/get_motion_to_…
runcows 9059bcb
Merge branch 'master' of https://github.com/Gamemode4Dev/GM4_Datapack…
runcows 6543e66
Translations file
runcows f36adad
Forgot key in translations
runcows 2dbdd91
Add Panda to steal hand
runcows 121b468
Update header in get_execution_pos
runcows e93ff91
Guidebook pages for reeling and barbed now unlock when getting an enc…
runcows 0a265c6
Reword Guidebook Pages
Bloo-dev afc9279
Add unreleased modrinth page id
runcows 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
Large diffs are not rendered by default.
Oops, something went wrong.
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| # Reeling Rods<!--$headerTitle--><!--$pmc:delete--> | ||
|
|
||
| Reel in more than just fish with these rods. Yoink the chest from the chest boat, deal some damage, and more! <!--$pmc:headerSize--> | ||
|
|
||
| ### Features | ||
| - All fishing rods have extra abilities when hooking Paintings, Item Frames, Leash Knots, Shulkers and End Crystals. Hooking any entity will also dismount them from their vehicle. | ||
|
|
||
| Adds 2 fishing rod enchantments, Reeling and Barbed. | ||
| - Reeling revolves around stealing from entities. Pull the chest from chest boats and so much more! | ||
| - Barbed turns a fishing rod into a lethal weapon. With 5 levels, it applies a scratching damage to the hooked mob and then bleeding damage. |
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,38 @@ | ||
| id: gm4_reeling_rods | ||
| name: Reeling Rods | ||
| version: 1.0.X | ||
|
|
||
| data_pack: | ||
| load: . | ||
|
|
||
| pipeline: | ||
| - generate_files | ||
| - gm4.plugins.extend.module | ||
|
|
||
| require: | ||
| - bolt | ||
|
|
||
| meta: | ||
| gm4: | ||
| versioning: | ||
| schedule_loops: [tick] | ||
| website: | ||
| description: Reel in more than just fish with these rods! Yoink the chest from the chest boat and more! | ||
| recommended: | ||
| - gm4_end_fishing | ||
| - gm4_live_catch | ||
| notes: [] | ||
| modrinth: | ||
| project_id: MWPuloVL | ||
| #smithed: | ||
| #pack_id: | ||
| #planetminecraft: | ||
| #uid: | ||
| video: null | ||
| wiki: https://wiki.gm4.co/wiki/Reeling_Rods | ||
| credits: | ||
| Creators: | ||
| - runcows | ||
| - Bloo | ||
| Icon Design: | ||
| - runcows |
24 changes: 24 additions & 0 deletions
24
gm4_reeling_rods/data/gm4_reeling_rods/enchantment/barbed.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,24 @@ | ||
| { | ||
| "description": { | ||
| "translate": "gm4.reeling_rods.enchantment.barbed", | ||
| "fallback": "Barbed" | ||
| }, | ||
| "exclusive_set": "gm4_reeling_rods:reeling", | ||
| "supported_items": "minecraft:fishing_rod", | ||
| "primary_items": "minecraft:fishing_rod", | ||
| "weight": 1, | ||
| "max_level": 5, | ||
| "min_cost": { | ||
| "base": 1, | ||
| "per_level_above_first": 10 | ||
| }, | ||
| "max_cost": { | ||
| "base": 51, | ||
| "per_level_above_first": 10 | ||
| }, | ||
| "anvil_cost": 1, | ||
| "slots": [ | ||
| "any" | ||
| ], | ||
| "effects": {} | ||
| } |
24 changes: 24 additions & 0 deletions
24
gm4_reeling_rods/data/gm4_reeling_rods/enchantment/reeling.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,24 @@ | ||
| { | ||
| "description": { | ||
| "translate": "gm4.reeling_rods.enchantment.reeling", | ||
| "fallback": "Reeling" | ||
| }, | ||
| "exclusive_set": "gm4_reeling_rods:barbed", | ||
| "supported_items": "minecraft:fishing_rod", | ||
| "primary_items": "minecraft:fishing_rod", | ||
| "weight": 1, | ||
| "max_level": 1, | ||
| "min_cost": { | ||
| "base": 20, | ||
| "per_level_above_first": 0 | ||
| }, | ||
| "max_cost": { | ||
| "base": 70, | ||
| "per_level_above_first": 0 | ||
| }, | ||
| "anvil_cost": 8, | ||
| "slots": [ | ||
| "any" | ||
| ], | ||
| "effects": {} | ||
| } |
24 changes: 24 additions & 0 deletions
24
gm4_reeling_rods/data/gm4_reeling_rods/function/barbed/apply.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,24 @@ | ||
| # Applies the barbed damage to the hooked entity | ||
| # @s = hooked entity | ||
| # at bobber position | ||
| # with {damage} | ||
| # run from hooked_entity/select_type | ||
|
|
||
| # immediate damage (amount scales with enchantment level) | ||
| execute store result score $show_death_messages gm4_reeling_rods.barbed_damage_timer run gamerule showDeathMessages | ||
| gamerule showDeathMessages false | ||
| $damage @s $(damage) cactus by @p[tag=gm4_reeling_rods.player] | ||
| playsound minecraft:entity.player.attack.crit player @a[distance=..16] ~ ~ ~ 1 1.82 | ||
|
|
||
| # handle death (@e only selects entities which are alive) | ||
| # | this is of importance for entities which display death messages or re-spawn | ||
| tag @s add gm4_reeling_rods.victim | ||
| execute if entity @s[type=#gm4_reeling_rods:support_death_message] at @s unless entity @e[type=#gm4_reeling_rods:support_death_message,tag=gm4_reeling_rods.victim,distance=0,limit=1] run function gm4_reeling_rods:barbed/on_scratch_death | ||
|
|
||
| # if the victim is still alive, schedule bleeding damage | ||
| execute at @s if entity @e[tag=gm4_reeling_rods.victim,distance=0,limit=1] run function gm4_reeling_rods:barbed/schedule_bleeding | ||
|
|
||
| # reset scores, gamerule and tag | ||
| tag @s remove gm4_reeling_rods.victim | ||
| execute if score $show_death_messages gm4_reeling_rods.barbed_damage_timer matches 1 run gamerule showDeathMessages true | ||
| scoreboard players reset $show_death_messages gm4_reeling_rods.barbed_damage_timer |
42 changes: 42 additions & 0 deletions
42
gm4_reeling_rods/data/gm4_reeling_rods/function/barbed/bleed.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,42 @@ | ||
| # updates the bleeding timer | ||
| # @s = entity recently hit by a barbed fishing rod | ||
| # at @s | ||
| # run from barbed/find_affected | ||
|
|
||
| # advance timer | ||
| scoreboard players add @s gm4_reeling_rods.barbed_damage_timer 1 | ||
|
|
||
| # clear if timer exceeds 3s | ||
| execute if score @s gm4_reeling_rods.barbed_damage_timer matches 61.. run return run function gm4_reeling_rods:barbed/clear | ||
|
|
||
| # return unless phase of timer is 0 | ||
| scoreboard players operation $phase gm4_reeling_rods.barbed_damage_timer = @s gm4_reeling_rods.barbed_damage_timer | ||
| scoreboard players operation $phase gm4_reeling_rods.barbed_damage_timer %= @s gm4_reeling_rods.barbed_damage_period | ||
| execute unless score $phase gm4_reeling_rods.barbed_damage_timer matches 0 run return fail | ||
|
|
||
| # find attacker | ||
| # | tags attacker with gm4_reeling_rods.barbed_attacker | ||
| # | sets $found_attacker gm4_reeling_rods.barbed_attacker_uuid0 | ||
| execute summon snowball run function gm4_reeling_rods:barbed/find_attacker | ||
|
|
||
| # prepare to handle player death | ||
| execute store result score $show_death_messages gm4_reeling_rods.barbed_damage_timer run gamerule showDeathMessages | ||
| gamerule showDeathMessages false | ||
|
|
||
| # apply damage | ||
| # | if the attacker was found, attribute it to the attacker, if not do not attribute it to anyone | ||
| # | use cactus damage type as it has no knockback and respects armor | ||
| # | print custom death message to obscure cactus death message | ||
| execute if score $found_attacker gm4_reeling_rods.barbed_attacker_uuid0 matches 1.. run damage @s 2 cactus by @p[tag=gm4_reeling_rods.barbed_attacker] | ||
| execute unless score $found_attacker gm4_reeling_rods.barbed_attacker_uuid0 matches 1.. run damage @s 2 cactus | ||
| playsound minecraft:block.pointed_dripstone.drip_lava neutral @a[distance=..6] ~ ~ ~ 1 1.8 | ||
| execute anchored eyes run particle damage_indicator ^ ^ ^ .2 .2 .2 0 3 | ||
| execute anchored eyes run particle damage_indicator ^ ^ ^1 .5 .5 .5 0 8 normal @s | ||
|
|
||
| # handle death (@e only selects entities which are alive) | ||
| # | this is of importance for entities which display death messages or re-spawn | ||
| tag @s add gm4_reeling_rods.victim | ||
| execute if entity @s[type=#gm4_reeling_rods:support_death_message] at @s unless entity @e[type=#gm4_reeling_rods:support_death_message,tag=gm4_reeling_rods.victim,distance=0,limit=1] run function gm4_reeling_rods:barbed/on_bleeding_death | ||
| tag @s remove gm4_reeling_rods.victim | ||
| execute if score $show_death_messages gm4_reeling_rods.barbed_damage_timer matches 1 run gamerule showDeathMessages true | ||
| scoreboard players reset $show_death_messages gm4_reeling_rods.barbed_damage_timer |
11 changes: 11 additions & 0 deletions
11
gm4_reeling_rods/data/gm4_reeling_rods/function/barbed/clear.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,11 @@ | ||
| # stops bleeding damage | ||
| # @s = entity recently hit by a barbed fishing rod | ||
| # at @s | ||
| # run from barbed/bleed, barbed/on_bleeding_death, and barbed/on_scratch_death | ||
|
|
||
| scoreboard players reset @s gm4_reeling_rods.barbed_attacker_uuid0 | ||
| scoreboard players reset @s gm4_reeling_rods.barbed_attacker_uuid1 | ||
| scoreboard players reset @s gm4_reeling_rods.barbed_attacker_uuid2 | ||
| scoreboard players reset @s gm4_reeling_rods.barbed_attacker_uuid3 | ||
| scoreboard players reset @s gm4_reeling_rods.barbed_damage_period | ||
| scoreboard players reset @s gm4_reeling_rods.barbed_damage_timer |
10 changes: 10 additions & 0 deletions
10
gm4_reeling_rods/data/gm4_reeling_rods/function/barbed/find_affected.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,10 @@ | ||
| # initiates bleeding damage on affected entities, de-schedules if no more entities are affected | ||
| # @s = undefined | ||
| # at undefined | ||
| # scheduled from barbed/schedule_bleeding and self | ||
|
|
||
| # apply barbed damage | ||
| execute as @e[scores={gm4_reeling_rods.barbed_damage_timer=0..}] at @s run function gm4_reeling_rods:barbed/bleed | ||
|
|
||
| # reschedule if there are still barbed entities | ||
| execute if entity @e[scores={gm4_reeling_rods.barbed_damage_timer=0..},limit=1] run schedule function gm4_reeling_rods:barbed/find_affected 1t replace |
21 changes: 21 additions & 0 deletions
21
gm4_reeling_rods/data/gm4_reeling_rods/function/barbed/find_attacker.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,21 @@ | ||
| # locates the attacker, as commands do not accept int-array formatted strings in macros | ||
| # @s = temporary snowball | ||
| # at location of snowball | ||
| # run from barbed/bleed | ||
|
|
||
| # build uuid array | ||
| data modify storage gm4_reeling_rods:temp barbed_attacker_uuid set value [I;0,0,0,0] | ||
| execute store result storage gm4_reeling_rods:temp barbed_attacker_uuid[0] int 1 run scoreboard players get @s gm4_reeling_rods.barbed_attacker_uuid0 | ||
| execute store result storage gm4_reeling_rods:temp barbed_attacker_uuid[1] int 1 run scoreboard players get @s gm4_reeling_rods.barbed_attacker_uuid1 | ||
| execute store result storage gm4_reeling_rods:temp barbed_attacker_uuid[2] int 1 run scoreboard players get @s gm4_reeling_rods.barbed_attacker_uuid2 | ||
| execute store result storage gm4_reeling_rods:temp barbed_attacker_uuid[3] int 1 run scoreboard players get @s gm4_reeling_rods.barbed_attacker_uuid3 | ||
|
|
||
| # move uuid to snowball | ||
| data modify entity @s Owner set from storage gm4_reeling_rods:temp barbed_attacker_uuid | ||
|
|
||
| # tag owner | ||
| scoreboard players set $found_attacker gm4_reeling_rods.barbed_attacker_uuid0 0 | ||
| execute on origin store success score $found_attacker gm4_reeling_rods.barbed_attacker_uuid0 run tag @s add gm4_reeling_rods.barbed_attacker | ||
|
|
||
| # remove snowball | ||
| kill @s |
13 changes: 13 additions & 0 deletions
13
gm4_reeling_rods/data/gm4_reeling_rods/function/barbed/on_bleeding_death.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,13 @@ | ||
| # handles entities bleeding to death | ||
| # @s = entity who died by bleeding to death from barbed damage | ||
| # at @s | ||
| # run from barbed/bleed | ||
|
|
||
| # death message | ||
| execute if entity @s[type=player] run tellraw @a ["",{"translate":"text.gm4.reeling_rods.death.bleeding","fallback":"%s succumbed to their injuries",with:[{"selector":"@s"}]}] | ||
| execute unless entity @s[type=player] on owner run tag @s add gm4_reeling_rods.owner | ||
| execute unless entity @s[type=player] run tellraw @p[tag=gm4_reeling_rods.owner] ["",{"translate":"text.gm4.reeling_rods.death.bleeding","fallback":"%s succumbed to their injuries",with:[{"selector":"@s"}]}] | ||
| execute unless entity @s[type=player] on owner run tag @s remove gm4_reeling_rods.owner | ||
|
|
||
| # reset barbed state | ||
| function gm4_reeling_rods:barbed/clear |
13 changes: 13 additions & 0 deletions
13
gm4_reeling_rods/data/gm4_reeling_rods/function/barbed/on_scratch_death.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,13 @@ | ||
| # handles entities scratched to death | ||
| # @s = entity who died by immediate damage from a barbed rod | ||
| # at @s | ||
| # run from barbed/apply | ||
|
|
||
| # death message | ||
| execute if entity @s[type=player] run tellraw @a ["",{"translate":"text.gm4.reeling_rods.death.scratch","fallback":"%s was scratched to death by %s",with:[{"selector":"@s"},{"selector":"@p[tag=gm4_reeling_rods.player]"}]}] | ||
| execute unless entity @s[type=player] on owner run tag @s add gm4_reeling_rods.owner | ||
| execute unless entity @s[type=player] run tellraw @p[tag=gm4_reeling_rods.owner] ["",{"translate":"text.gm4.reeling_rods.death.scratch","fallback":"%s was scratched to death by %s",with:[{"selector":"@s"},{"selector":"@p[tag=gm4_reeling_rods.player]"}]}] | ||
| execute unless entity @s[type=player] on owner run tag @s remove gm4_reeling_rods.owner | ||
|
|
||
| # reset barbed state | ||
| function gm4_reeling_rods:barbed/clear |
16 changes: 16 additions & 0 deletions
16
gm4_reeling_rods/data/gm4_reeling_rods/function/barbed/schedule_bleeding.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,16 @@ | ||
| # schedules bleeding damage for the entity that was just hit by barbed | ||
| # @s = entity just hit by barbed that has not died from the immediate damage | ||
| # at bobber position | ||
| # run from barbed/apply | ||
|
|
||
| # store attacker uuid and period | ||
| data modify storage gm4_reeling_rods:temp enchanted.barbed.attacker_uuid set from entity @a[limit=1,tag=gm4_reeling_rods.player] UUID | ||
| execute store result score @s gm4_reeling_rods.barbed_attacker_uuid0 run data get storage gm4_reeling_rods:temp enchanted.barbed.attacker_uuid[0] | ||
| execute store result score @s gm4_reeling_rods.barbed_attacker_uuid1 run data get storage gm4_reeling_rods:temp enchanted.barbed.attacker_uuid[1] | ||
| execute store result score @s gm4_reeling_rods.barbed_attacker_uuid2 run data get storage gm4_reeling_rods:temp enchanted.barbed.attacker_uuid[2] | ||
| execute store result score @s gm4_reeling_rods.barbed_attacker_uuid3 run data get storage gm4_reeling_rods:temp enchanted.barbed.attacker_uuid[3] | ||
| execute store result score @s gm4_reeling_rods.barbed_damage_period run data get storage gm4_reeling_rods:temp enchanted.barbed.period | ||
|
|
||
| # initiate timer | ||
| scoreboard players set @s gm4_reeling_rods.barbed_damage_timer 0 | ||
| schedule function gm4_reeling_rods:barbed/find_affected 1t replace |
7 changes: 7 additions & 0 deletions
7
gm4_reeling_rods/data/gm4_reeling_rods/function/get_execution_pos.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,7 @@ | ||
| # stores position of a newly summoned marker and kills it | ||
| # @s = new marker | ||
| # at @s | ||
| # run from get_motion_to_player and reeling/enderman/action | ||
|
|
||
| data modify storage gm4_reeling_rods:temp position set from entity @s Pos | ||
| kill @s |
5 changes: 5 additions & 0 deletions
5
gm4_reeling_rods/data/gm4_reeling_rods/function/get_lookup.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,5 @@ | ||
| # Adds a value from the lookup table to Y motion | ||
| # with {lookup_key} | ||
| # run from get_motion_to_player | ||
|
|
||
| $scoreboard players operation $motionY gm4_reeling_rods.math += $$(lookup_key) gm4_reeling_rods.lookup |
45 changes: 45 additions & 0 deletions
45
gm4_reeling_rods/data/gm4_reeling_rods/function/get_motion_to_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 |
|---|---|---|
| @@ -0,0 +1,45 @@ | ||
| # Gets motion vector to launch entity to player. X and Z motion is 10% the block distance between the player and current position. Y motion uses the sum of the squares of position deltas as a lookup table key, the value of which is added to the Y position delta to get the Y motion. | ||
| # @s = entity with items to be yoinked | ||
| # at bobber in @s (most of the time) | ||
| # run from pull_items | ||
|
|
||
| data modify storage gm4_reeling_rods:temp item_data.Motion set value [0d,0d,0d] | ||
|
|
||
| # Store current position | ||
| execute summon marker run function gm4_reeling_rods:get_execution_pos | ||
| # | position stored in storage gm4_reeling_rods:temp position | ||
| execute store result score $currentX gm4_reeling_rods.math run data get storage gm4_reeling_rods:temp position[0] 1 | ||
| execute store result score $currentY gm4_reeling_rods.math run data get storage gm4_reeling_rods:temp position[1] 1 | ||
| execute store result score $currentZ gm4_reeling_rods.math run data get storage gm4_reeling_rods:temp position[2] 1 | ||
|
|
||
| # Player postion is stored in $motionX... ect from player/find_hooked_entity | ||
|
|
||
| # Get distance from current position to player | ||
| scoreboard players operation $motionX gm4_reeling_rods.math -= $currentX gm4_reeling_rods.math | ||
| scoreboard players operation $motionY gm4_reeling_rods.math -= $currentY gm4_reeling_rods.math | ||
| scoreboard players operation $motionZ gm4_reeling_rods.math -= $currentZ gm4_reeling_rods.math | ||
|
|
||
| # store Motion, y to be edited after | ||
| execute store result storage gm4_reeling_rods:temp item_data.Motion[0] double 0.1 run scoreboard players get $motionX gm4_reeling_rods.math | ||
| execute store result storage gm4_reeling_rods:temp item_data.Motion[1] double 0.1 run scoreboard players get $motionY gm4_reeling_rods.math | ||
| execute store result storage gm4_reeling_rods:temp item_data.Motion[2] double 0.1 run scoreboard players get $motionZ gm4_reeling_rods.math | ||
|
|
||
| # Square the distances on each axis | ||
| scoreboard players operation $motionX gm4_reeling_rods.math *= $motionX gm4_reeling_rods.math | ||
| scoreboard players operation $motionY gm4_reeling_rods.math *= $motionY gm4_reeling_rods.math | ||
| scoreboard players operation $motionZ gm4_reeling_rods.math *= $motionZ gm4_reeling_rods.math | ||
|
|
||
| # Add the squares | ||
| scoreboard players operation $lookup_key gm4_reeling_rods.math = $motionX gm4_reeling_rods.math | ||
| scoreboard players operation $lookup_key gm4_reeling_rods.math += $motionY gm4_reeling_rods.math | ||
| execute store result storage gm4_reeling_rods:temp lookup_key int 1 \ | ||
| run scoreboard players operation $lookup_key gm4_reeling_rods.math += $motionZ gm4_reeling_rods.math | ||
|
|
||
| # Get Y motion, scaled up to match the squared values of before | ||
| execute store result score $motionY gm4_reeling_rods.math run data get storage gm4_reeling_rods:temp item_data.Motion[1] 100 | ||
|
|
||
| # Add looked up value to motionY above | ||
| function gm4_reeling_rods:get_lookup with storage gm4_reeling_rods:temp | ||
|
|
||
| # Store the Completed motionY | ||
| execute store result storage gm4_reeling_rods:temp item_data.Motion[1] double 0.01 run scoreboard players get $motionY gm4_reeling_rods.math |
6 changes: 6 additions & 0 deletions
6
gm4_reeling_rods/data/gm4_reeling_rods/function/hooked_entity/end_crystal.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 @@ | ||
| # Action for hooked end_crystal | ||
| # @s = end_crystal | ||
| # at bobber in @s | ||
| # run from hooked_entity/select_type | ||
|
|
||
| damage @s 1 minecraft:player_attack by @p[tag=gm4_reeling_rods.player] |
6 changes: 6 additions & 0 deletions
6
gm4_reeling_rods/data/gm4_reeling_rods/function/hooked_entity/is_passenger.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 @@ | ||
| # checks if @s is a passenger | ||
| # @s = entity to check | ||
| # at @s | ||
| # run from hooked_entity/select_type | ||
|
|
||
| return run execute on vehicle if entity @s |
19 changes: 19 additions & 0 deletions
19
gm4_reeling_rods/data/gm4_reeling_rods/function/hooked_entity/item_frame.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,19 @@ | ||
| # Action for hooked item frame or glow item frame | ||
| # @s = item frame or glow item frame | ||
| # at bobber in @s | ||
| # with {type} | ||
| # run from hooked_entity/select_type | ||
|
|
||
| # fail if fixed | ||
| execute if data entity @s {Fixed:1b} run return fail | ||
|
|
||
| $data modify storage gm4_reeling_rods:temp item_data.Item set value {id:"$(type)",count:1} | ||
| data modify storage gm4_reeling_rods:temp item_data.Item set from entity @s Item | ||
| execute at @s align xz positioned ~0.5 ~ ~0.5 run function gm4_reeling_rods:pull_items | ||
| execute unless data entity @s Item run return run kill @s | ||
| data remove entity @s Item | ||
|
|
||
| $execute if data storage gm4_reeling_rods:temp {item_data:{Item:{id:"$(type)"}}} \ | ||
| run return run playsound minecraft:entity.item_frame.break neutral @a[distance=..16] ~ ~ ~ | ||
|
|
||
| playsound minecraft:entity.item_frame.remove_item neutral @a[distance=..16] ~ ~ ~ | ||
15 changes: 15 additions & 0 deletions
15
gm4_reeling_rods/data/gm4_reeling_rods/function/hooked_entity/leash_knot/action.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,15 @@ | ||
| # Action for hooked leash knot | ||
| # @s = leash knot | ||
| # at bobber in @s | ||
| # run from hooked_entity/select_type | ||
|
|
||
| tag @s add gm4_reeling_rods.leash_knot | ||
|
|
||
| # distance=..12 is leash distance | ||
| execute at @s as @e[type=#gm4_reeling_rods:leashable,distance=..12] \ | ||
| if function gm4_reeling_rods:hooked_entity/leash_knot/leaded_by_knot \ | ||
| run function gm4_reeling_rods:hooked_entity/leash_knot/change_leader | ||
|
|
||
| kill @s | ||
|
|
||
| execute at @p[tag=gm4_reeling_rods.player] run playsound minecraft:entity.leash_knot.place neutral @a[distance=..16] ~ ~ ~ |
7 changes: 7 additions & 0 deletions
7
...ing_rods/data/gm4_reeling_rods/function/hooked_entity/leash_knot/change_leader.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,7 @@ | ||
| # Changes a leashed entities leader from a leash knot to a tagged player | ||
| # @s = entity leaded to leash knot | ||
| # at leash knot | ||
| # run from hooked_entity/leash_knot/action | ||
|
|
||
| data remove entity @s leash | ||
| data modify entity @s leash.UUID set from entity @p[tag=gm4_reeling_rods.player] UUID |
Oops, something went wrong.
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.