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

Draft
wants to merge 38 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
38 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
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
13 changes: 13 additions & 0 deletions gm4_reeling_rods/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Reeling Rods<!--$headerTitle--><!--$pmc:delete-->

Reel in more than just fish with these rods! Yoink the chest from the chest boat and more! <!--$pmc:headerSize-->

### Features
Fishing Rods can now yoink many more things!
- Pull Paintings off walls
- Reel in items from Item Frames
- Snatch leashed mobs from leash knots
- Try and fail to pull in an end crystal
Adds a new enchantment for fishing rods to take your yoinking up a notch! With it you can
- Separate chest boats and all minecart variants
- Steal items from allays
47 changes: 47 additions & 0 deletions gm4_reeling_rods/beet.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
id: gm4_reeling_rods
name: Reeling Rods
version: 1.0.X

data_pack:
load: .
overlays:
- formats:
min_inclusive: 61
max_inclusive: 61
directory: since_61
- formats:
min_inclusive: 57
max_inclusive: 61
directory: since_57
- formats:
min_inclusive: 48
max_inclusive: 48
directory: backport_48

pipeline:
- generate_files
- gm4.plugins.extend.module

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:
Creator:
- runcows
#Icon Design:
#- runcows
22 changes: 22 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,22 @@
{
"description":{
"text": "Reeling"
},
"supported_items": "minecraft:fishing_rod",
"primary_items": "minecraft:fishing_rod",
"weight": 3,
"max_level": 1,
"min_cost": {
"base": 5,
"per_level_above_first": 8
},
"max_cost": {
"base": 55,
"per_level_above_first": 8
},
"anvil_cost": 2,
"slots": [
"any"
],
"effects": {}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# Loops through Items[] and creates an item entity for each item, setting a slightly random motion
# @s = entity with an Items[] tag
# at @s
# run from separate

# Assumptions
# storage gm4_reeling_rods:temp motion_vector is a Motion[] vector that reaches player
# in storage gm4_reeling_rods:temp entity_data is an Items[] array of item data objects

# pull item data to be processed
data modify storage gm4_reeling_rods:temp item_data.Item set from storage gm4_reeling_rods:temp entity_data.Items[0]

# randomize motion slightly....
# this is the complicated bit
execute store result score $motionX gm4_reeling_rods.math run data get storage gm4_reeling_rods:temp motion_vector[0] 100
execute store result score $motionY gm4_reeling_rods.math run data get storage gm4_reeling_rods:temp motion_vector[1] 100
execute store result score $motionZ gm4_reeling_rods.math run data get storage gm4_reeling_rods:temp motion_vector[2] 100
execute store result score $randomX gm4_reeling_rods.math run random value -10..10
execute store result score $randomY gm4_reeling_rods.math run random value 0..10
execute store result score $randomZ gm4_reeling_rods.math run random value -10..10
execute store result storage gm4_reeling_rods:temp item_data.Motion[0] double 0.006 run \
scoreboard players operation $motionX gm4_reeling_rods.math += $randomX gm4_reeling_rods.math
execute store result storage gm4_reeling_rods:temp item_data.Motion[1] double 0.006 run \
scoreboard players operation $motionY gm4_reeling_rods.math += $randomY gm4_reeling_rods.math
execute store result storage gm4_reeling_rods:temp item_data.Motion[2] double 0.006 run \
scoreboard players operation $motionZ gm4_reeling_rods.math += $randomZ gm4_reeling_rods.math
# scale 0.01 for same magnitude as main item, currently 0.006 to be slower

# summon item with data
function gm4_reeling_rods:summon_item with storage gm4_reeling_rods:temp

# remove processed item
data remove storage gm4_reeling_rods:temp entity_data.Items[0]

# run again if needed
execute if data storage gm4_reeling_rods:temp entity_data.Items[] run function gm4_reeling_rods:empty_container_entity
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Action for reeled chest_boat
# @s = chest_boat type
# at @s
# with {boat_type}
# run from fished/select_type

data modify storage gm4_reeling_rods:temp entity_data set from entity @s
data modify storage gm4_reeling_rods:temp item_data.Item set value {id:"minecraft:chest",count:1}
execute positioned ~ ~0.75 ~ run function gm4_reeling_rods:separate
data remove storage gm4_reeling_rods:temp entity_data.UUID
data remove storage gm4_reeling_rods:temp entity_data.Passengers
$data modify storage gm4_reeling_rods:temp entity_type set value "$(boat_type)"
function gm4_reeling_rods:summon_entity with storage gm4_reeling_rods:temp
execute on passengers run function gm4_reeling_rods:fished/chest_boat/passenger_transfer
tp @s ~ -1000 ~
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# transfer old passenger to new boat
# @s = passengers of chest boat type
# at old chest boat type
# run from fished/chest_boat/action

ride @s dismount
ride @s mount @e[type=#gm4:boats,distance=..0.00001,limit=1]
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Action for reeled donkey
# @s = donkey
# at @s
# run from fished/selec_type

data modify storage gm4_reeling_rods:temp entity_data set from entity @s
data modify storage gm4_reeling_rods:temp item_data set value {}
data modify storage gm4_reeling_rods:temp item_data.Item set from entity @s SaddleItem
execute if data entity @s {ChestedHorse:1b} run data modify storage gm4_reeling_rods:temp item_data.Item set value {id:"minecraft:chest",count:1}
execute positioned ~ ~0.7 ~ run function gm4_reeling_rods:separate
execute if data entity @s {ChestedHorse:1b} run return run data modify entity @s ChestedHorse set value 0b
item replace entity @s horse.saddle with minecraft:air
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Action for reeled horse
# @s = horse
# at @s
# run from fished/select_type

data modify storage gm4_reeling_rods:temp item_data set value {}
data modify storage gm4_reeling_rods:temp item_data.Item set from entity @s SaddleItem
execute store result score $armored gm4_reeling_rods.math if data entity @s body_armor_item run data modify storage gm4_reeling_rods:temp item_data.Item set from entity @s body_armor_item
execute positioned ~ ~0.8 ~ run function gm4_reeling_rods:separate
execute if data storage gm4_reeling_rods:temp {item_data:{Item:{id:"minecraft:saddle"}}} run item replace entity @s horse.saddle with minecraft:air
execute if score $armored gm4_reeling_rods.math matches 1 run item replace entity @s armor.body with minecraft:air
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Action for reeled item frame or glow item frame
# @s = item frame or glow item frame
# at @s
# with {type}
# run from fished/select_type

$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 align xz positioned ~0.5 ~ ~0.5 run function gm4_reeling_rods:separate
execute unless data entity @s Item run return run kill @s
data remove entity @s Item
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Action for reeled leash knot
# @s = leash knot
# at @s
# run from fished/select_type

tag @s add gm4_reeling_rods.leash_knot

# distance=..10 is leash distance UNTIL 1.21.6
execute as @e[type=#gm4_reeling_rods:leashable,distance=..10] \
if function gm4_reeling_rods:fished/leash_knot/leaded_by_knot \
run function gm4_reeling_rods:fished/leash_knot/change_leader


kill @s
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 fished/leash_knot/action

data remove entity @s leash
data modify entity @s leash.UUID set from entity @e[type=player,tag=gm4_reeling_rods.player,distance=..45,limit=1] 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 fished/leash_knot/action

return run execute on leasher if entity @s[tag=gm4_reeling_rods.leash_knot]
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Action for reeled llama or trader llama
# @s = llama or trader llama
# at @s
# run from fished/select_type

data modify storage gm4_reeling_rods:temp entity_data set from entity @s
data modify storage gm4_reeling_rods:temp item_data set value {}
data modify storage gm4_reeling_rods:temp item_data.Item set from entity @s body_armor_item
execute if data entity @s {ChestedHorse:1b} run data modify storage gm4_reeling_rods:temp item_data.Item set value {id:"minecraft:chest",count:1}
execute positioned ~ ~1 ~ run function gm4_reeling_rods:separate
execute if data entity @s {ChestedHorse:1b} run return run data modify entity @s ChestedHorse set value 0b
item replace entity @s armor.body with minecraft:air
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Action for reeled *_minecart
# @s = *_minecart
# at @s
# with {block}
# run from fished/select_type

data modify storage gm4_reeling_rods:temp entity_data set from entity @s
$data modify storage gm4_reeling_rods:temp item_data.Item set value {id:"$(block)",count:1}
function gm4_reeling_rods:separate
data remove storage gm4_reeling_rods:temp entity_data.UUID
data remove storage gm4_reeling_rods:temp entity_data.Passengers
data modify storage gm4_reeling_rods:temp entity_type set value "minecraft:minecart"
function gm4_reeling_rods:summon_entity with storage gm4_reeling_rods:temp
execute on passengers run function gm4_reeling_rods:fished/minecart/passenger_transfer
tp @s ~ -1000 ~
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# transfer old passenger to new minecart
# @s = passengers of *_minecart
# at old *_minecart
# run from fished/minecart/action

ride @s dismount
ride @s mount @e[type=minecraft:minecart,distance=..0.00001,limit=1]
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Action for reeled mule
# @s = mule
# at @s
# run from fished/select_type

data modify storage gm4_reeling_rods:temp entity_data set from entity @s
data modify storage gm4_reeling_rods:temp item_data set value {}
data modify storage gm4_reeling_rods:temp item_data.Item set from entity @s SaddleItem
execute if data entity @s {ChestedHorse:1b} run data modify storage gm4_reeling_rods:temp item_data.Item set value {id:"minecraft:chest",count:1}
execute positioned ~ ~0.8 ~ run function gm4_reeling_rods:separate
execute if data entity @s {ChestedHorse:1b} run return run data modify entity @s ChestedHorse set value 0b
item replace entity @s horse.saddle with minecraft:air
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Action for reeled painting
# @s = painting
# at @s
# run from fished/select_type

data modify storage gm4_reeling_rods:temp item_data.Item set value {id:"minecraft:painting",count:1}
execute align xz positioned ~0.5 ~ ~0.5 run function gm4_reeling_rods:separate
kill @s
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Action for reeled pig
# @s = pig
# at @s
# run from fished/select_type

# fail if no saddle
execute unless data entity @s {Saddle:1b} run return fail

data modify entity @s Saddle set value 0b
data modify storage gm4_reeling_rods:temp item_data.Item set value {id:"minecraft:saddle",count:1}
execute positioned ~ ~0.5 ~ run function gm4_reeling_rods:separate
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Action for reeled snow_golem
# @s = snow_golem
# at @s
# run from fished/select_type

# fail if no Pumpkin
execute unless data entity @s {Pumpkin:1b} run return fail

data modify entity @s Pumpkin set value 0b
data modify storage gm4_reeling_rods:temp item_data.Item set value {id:"minecraft:carved_pumpkin",count:1}
execute positioned ~ ~1.2 ~ run function gm4_reeling_rods:separate
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Checks slots to steal
# @s = #gm4_reeling_rods:steal_equipment
# at @s
# run from fished/stealable/steal_equipment

# 1
execute if items entity @s weapon.mainhand * run return run function gm4_reeling_rods:fished/stealable/steal_slot/mainhand
# 3
execute if items entity @s armor.head * run return run function gm4_reeling_rods:fished/stealable/steal_slot/head
# 5
execute if items entity @s armor.legs * run return run function gm4_reeling_rods:fished/stealable/steal_slot/legs
# 2
execute if items entity @s weapon.offhand * run return run function gm4_reeling_rods:fished/stealable/steal_slot/offhand
# 4
execute if items entity @s armor.chest * run return run function gm4_reeling_rods:fished/stealable/steal_slot/chest
# 6
execute if items entity @s armor.feet * run return run function gm4_reeling_rods:fished/stealable/steal_slot/feet

return fail
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Checks slots to steal
# @s = #gm4_reeling_rods:steal_equipment
# at @s
# run from fished/stealable/steal_equipment

# 2
execute if items entity @s weapon.offhand * run return run function gm4_reeling_rods:fished/stealable/steal_slot/offhand
# 4
execute if items entity @s armor.chest * run return run function gm4_reeling_rods:fished/stealable/steal_slot/chest
# 6
execute if items entity @s armor.feet * run return run function gm4_reeling_rods:fished/stealable/steal_slot/feet
# 1
execute if items entity @s weapon.mainhand * run return run function gm4_reeling_rods:fished/stealable/steal_slot/mainhand
# 3
execute if items entity @s armor.head * run return run function gm4_reeling_rods:fished/stealable/steal_slot/head
# 5
execute if items entity @s armor.legs * run return run function gm4_reeling_rods:fished/stealable/steal_slot/legs

return fail
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Checks slots to steal
# @s = #gm4_reeling_rods:steal_equipment
# at @s
# run from fished/stealable/steal_equipment

# 3
execute if items entity @s armor.head * run return run function gm4_reeling_rods:fished/stealable/steal_slot/head
# 5
execute if items entity @s armor.legs * run return run function gm4_reeling_rods:fished/stealable/steal_slot/legs
# 2
execute if items entity @s weapon.offhand * run return run function gm4_reeling_rods:fished/stealable/steal_slot/offhand
# 4
execute if items entity @s armor.chest * run return run function gm4_reeling_rods:fished/stealable/steal_slot/chest
# 6
execute if items entity @s armor.feet * run return run function gm4_reeling_rods:fished/stealable/steal_slot/feet
# 1
execute if items entity @s weapon.mainhand * run return run function gm4_reeling_rods:fished/stealable/steal_slot/mainhand

return fail
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Checks slots to steal
# @s = #gm4_reeling_rods:steal_equipment
# at @s
# run from fished/stealable/steal_equipment

# 4
execute if items entity @s armor.chest * run return run function gm4_reeling_rods:fished/stealable/steal_slot/chest
# 6
execute if items entity @s armor.feet * run return run function gm4_reeling_rods:fished/stealable/steal_slot/feet
# 1
execute if items entity @s weapon.mainhand * run return run function gm4_reeling_rods:fished/stealable/steal_slot/mainhand
# 3
execute if items entity @s armor.head * run return run function gm4_reeling_rods:fished/stealable/steal_slot/head
# 5
execute if items entity @s armor.legs * run return run function gm4_reeling_rods:fished/stealable/steal_slot/legs
# 2
execute if items entity @s weapon.offhand * run return run function gm4_reeling_rods:fished/stealable/steal_slot/offhand

return fail
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Checks slots to steal
# @s = #gm4_reeling_rods:steal_equipment
# at @s
# run from fished/stealable/steal_equipment

# 5
execute if items entity @s armor.legs * run return run function gm4_reeling_rods:fished/stealable/steal_slot/legs
# 2
execute if items entity @s weapon.offhand * run return run function gm4_reeling_rods:fished/stealable/steal_slot/offhand
# 4
execute if items entity @s armor.chest * run return run function gm4_reeling_rods:fished/stealable/steal_slot/chest
# 6
execute if items entity @s armor.feet * run return run function gm4_reeling_rods:fished/stealable/steal_slot/feet
# 1
execute if items entity @s weapon.mainhand * run return run function gm4_reeling_rods:fished/stealable/steal_slot/mainhand
# 3
execute if items entity @s armor.head * run return run function gm4_reeling_rods:fished/stealable/steal_slot/head

return fail
Loading
Loading