Skip to content

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

Open
wants to merge 90 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
90 commits
Select commit Hold shift + click to select a range
7d48d9b
Initial Commit
runcows Mar 8, 2025
0e7c731
Fix Version Compat
runcows Mar 8, 2025
aaed0f7
Add player gamemode check
runcows Mar 10, 2025
11e7606
Fix Allay HandItems[0] being removed instead of set empty
runcows Mar 10, 2025
a4a3b57
Add shulker pulling
runcows Mar 10, 2025
ac894ad
Fix minecart fishing bobber vertical displacement off by 0.00001
runcows Mar 10, 2025
5f94a20
Fix Allay item summon wrong location
runcows Mar 10, 2025
a5c5e14
Add witch potion stealing
runcows Mar 10, 2025
216f956
Slight python change
runcows Mar 10, 2025
0f37745
Add villager theft
runcows Mar 11, 2025
b116175
Python changes to allow baby mobs to be processed
runcows Mar 11, 2025
7c22088
Add fox theft
runcows Mar 11, 2025
2bffbbe
Add witch theft limit
runcows Mar 11, 2025
72be04a
Add pig desaddling
runcows Mar 11, 2025
96857d5
Add strider desaddling
runcows Mar 11, 2025
f33d99e
Add snow golem beheading
runcows Mar 12, 2025
0b10b51
Add entity TODO list
runcows Mar 12, 2025
340319a
Add wolf armor stealing
runcows Mar 13, 2025
7f4c66e
Add horse type mob item yoinking
runcows Mar 13, 2025
5cc0086
Fix Donkey and Mule code a bit
runcows Mar 13, 2025
ca05491
Add Llama yoinking
runcows Mar 13, 2025
cd3233e
Python refactor & the start of Dismounting work
runcows Mar 15, 2025
94e5950
Remove witch limit
runcows Mar 16, 2025
1145e15
Fix file new line issue
runcows Mar 16, 2025
04739d7
Switch to id based system for entity selection
runcows Mar 18, 2025
1f0d012
minor text fixes
runcows Mar 18, 2025
ec84e1e
more fixes from the id change
runcows Mar 18, 2025
013328e
Fix wrong command syntax :(
runcows Mar 18, 2025
419ede3
Re-Add smithed.entity ignore
runcows Mar 18, 2025
1546ed1
Change id tags to be removed when unneeded
runcows Mar 18, 2025
15ba57d
Merge branch 'master' of https://github.com/Gamemode4Dev/GM4_Datapack…
runcows Mar 18, 2025
c1a4249
Vehicle separation passenger transfer
runcows Mar 19, 2025
f0f3f64
Add live catch to recommended
runcows Mar 19, 2025
68173db
Misc comments because I need these file changes on my laptop to work …
runcows Mar 23, 2025
f2014ee
misc beet changes
runcows Mar 25, 2025
2c59b25
py comment restructure
runcows Apr 14, 2025
1d2df27
Refactor in prep for generic item yoinking
runcows Apr 29, 2025
3910c3c
Refactor & Add Generic Hand/Armor Yoinking
runcows May 1, 2025
c8c8c6c
Merge branch 'master' of https://github.com/Gamemode4Dev/GM4_Datapack…
runcows May 26, 2025
dab75bf
Update to 1.21.5
runcows May 26, 2025
ffa53ba
Merge branch 'master' of https://github.com/Gamemode4Dev/GM4_Datapack…
runcows May 26, 2025
f2243f0
Some comment changes
runcows May 26, 2025
d2a9cb1
Missed changes for 1.21.5
runcows May 26, 2025
d53ceee
Fix shulker teleporting
runcows May 26, 2025
6e6f754
Fix chest boat yoinking
runcows May 26, 2025
dd86466
Rename function for clarity
runcows May 27, 2025
3897558
Add Sheep shearing yoinking
runcows May 27, 2025
7070c5a
Fix sheep wool yoinking
runcows May 27, 2025
6705fbd
Fixes (hopefully)
runcows Jun 3, 2025
1f75214
Add Binding blocking for equipment theft
runcows Jun 3, 2025
2e75cfa
Add Entities
runcows Jun 6, 2025
897c8f0
Optimize bobber id setting
runcows Jun 6, 2025
f0214d8
single comment change because nobody can stop me
runcows Jun 6, 2025
96e1209
Fix my id changes & add sounds :D
runcows Jun 7, 2025
cbd7dae
Change some player selectors to `@p`
runcows Jun 7, 2025
4b300db
Change a few more player selectors to @p
runcows Jun 7, 2025
2808e2e
Shorten bee anger time
runcows Jun 7, 2025
3982751
Add Barbed Enchantment (#2)
Bloo-dev Jun 8, 2025
f2cb1ff
Fix overassigning ID causing breakage
runcows Jun 8, 2025
5df7186
Adjust enchantment cost & rarity
runcows Jun 8, 2025
6954f8d
Remove excess entity_data storage
runcows Jun 8, 2025
b1bb5ce
Add Barbed Delayed Damage
Bloo-dev Jun 8, 2025
3994e72
Fix Bleeding Damage not Starting
Bloo-dev Jun 8, 2025
8129bce
Adjust Damage & Particles
Bloo-dev Jun 8, 2025
7697bd7
Add Custom Death Messages
Bloo-dev Jun 8, 2025
b9ee649
Adjust Enchantment Weights
Bloo-dev Jun 8, 2025
71bbf4a
Fix Death Messages & Properly Reset Players on Respawn
Bloo-dev Jun 8, 2025
eb64212
Fix Bleeding Damage not Triggering for non-Player Entities
Bloo-dev Jun 8, 2025
3d3acff
ID rewrite to use scores & optimization
runcows Jun 9, 2025
8ca0478
Swap enchantment name for translation string
runcows Jun 9, 2025
e5340a8
Big Reorganization
runcows Jun 9, 2025
a1f8bdd
Add Bloo to credits
runcows Jun 9, 2025
d6f68b4
Missed renaming for reorganization
runcows Jun 9, 2025
0c0f6a6
minor changes
runcows Jun 9, 2025
fc7a39a
Fix item data not being reset all the time
runcows Jun 9, 2025
54110bb
Change barbed to explode tnt minecarts
runcows Jun 9, 2025
7cd9565
Rework hooked_entity/select_type to use bolt in file instead of gener…
runcows Jun 10, 2025
ec3c853
Add drop chance usage to reeling
runcows Jun 11, 2025
aa51550
Drop Chance Rework
runcows Jun 27, 2025
488b456
Formatting Changes
runcows Jun 27, 2025
57c7a8c
Merge branch 'master' of https://github.com/Gamemode4Dev/GM4_Datapack…
runcows Jun 27, 2025
4e6c945
Update to 1.21.6
runcows Jun 27, 2025
dd5665a
Fix item frame yoinking not respecting fixed tag
runcows Jun 30, 2025
7b53154
Set module to not run if hooked entity is Invulnerable
runcows Jun 30, 2025
ec6b70f
Upload Icon
runcows Jun 30, 2025
95c1e10
Merge branch 'fishing-rod-module' of https://github.com/runcows/GM4_D…
runcows Jun 30, 2025
c795a35
Uncomment Icon Design in beet.yaml
runcows Jul 1, 2025
56a137b
Initial Guidebook and Readme
runcows Jul 7, 2025
7681105
Merge branch 'master' of https://github.com/Gamemode4Dev/GM4_Datapack…
runcows Jul 7, 2025
c4668b2
Automated Guidebook Building Stuff
runcows Jul 7, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions gm4/modeldata_registry.json
Original file line number Diff line number Diff line change
Expand Up @@ -527,6 +527,7 @@
"fishing_rod": {
"gm4_end_fishing:gui/advancement/end_fishing": 1,
"gm4_end_fishing:guidebook_icon/end_fishing": 2,
"gm4_reeling_rods:guidebook_icon/reeling_rods": 3,
"gm4_metallurgy:shamir/hypexperia": 110,
"gm4_animi_shamir:shamir/animi": 124
},
Expand Down
340 changes: 183 additions & 157 deletions gm4/utils.py

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion gm4_guidebook/triggers.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"__important__": "Generated by generate_guidebooks.py. Don't manually update this",
"__next__": 119,
"__next__": 120,
"animi_shamir": 91,
"apple_trees": 83,
"arborenda_shamir": 20,
Expand Down Expand Up @@ -81,6 +81,7 @@
"potion_liquids": 32,
"potion_swords": 62,
"record_crafting": 97,
"reeling_rods": 119,
"relocators": 70,
"resurrecting_skeletons": 41,
"resurrecting_zombies": 46,
Expand Down
10 changes: 10 additions & 0 deletions gm4_reeling_rods/README.md
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.
38 changes: 38 additions & 0 deletions gm4_reeling_rods/beet.yaml
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:
#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 gm4_reeling_rods/data/gm4_reeling_rods/enchantment/barbed.json
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 gm4_reeling_rods/data/gm4_reeling_rods/enchantment/reeling.json
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": {}
}
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
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
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
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
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
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.scratch","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.scratch","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
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
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
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
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# Gets motion vector to launch item to player
# run from pull_items

data modify storage gm4_reeling_rods:temp item_data.Motion set value [0d,0d,0d]

# Store item pos
data modify storage gm4_reeling_rods:temp item_data.Pos set from entity @s Pos
execute store result score $itemX gm4_reeling_rods.math run data get storage gm4_reeling_rods:temp item_data.Pos[0] 1
execute store result score $itemY gm4_reeling_rods.math run data get storage gm4_reeling_rods:temp item_data.Pos[1] 1
execute store result score $itemZ gm4_reeling_rods.math run data get storage gm4_reeling_rods:temp item_data.Pos[2] 1

# Player postion is stored in $motionX... ect from player/find_hooked_entity

# Get delta from item to player
scoreboard players operation $motionX gm4_reeling_rods.math -= $itemX gm4_reeling_rods.math
scoreboard players operation $motionY gm4_reeling_rods.math -= $itemY gm4_reeling_rods.math
scoreboard players operation $motionZ gm4_reeling_rods.math -= $itemZ 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
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

# store motion Y, scaled up
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
function gm4_reeling_rods:get_lookup with storage gm4_reeling_rods:temp

# Store the Completed YMotion
execute store result storage gm4_reeling_rods:temp item_data.Motion[1] double 0.01 run scoreboard players get $motionY gm4_reeling_rods.math
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]
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
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] ~ ~ ~
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] ~ ~ ~
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
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Checks if an entity is leashed by the knot in question
# @s = a leashable entity
# at owner
# run from hooked_entity/leash_knot/action

return run execute on leasher if entity @s[tag=gm4_reeling_rods.leash_knot]
Loading
Loading