Skip to content

Commit 9a07655

Browse files
runcowsBloo-dev
andauthored
New module: Reeling Rods (#1104)
* Initial Commit * Fix Version Compat * Add player gamemode check * Fix Allay HandItems[0] being removed instead of set empty * Add shulker pulling * Fix minecart fishing bobber vertical displacement off by 0.00001 * Fix Allay item summon wrong location * Add witch potion stealing * Slight python change * Add villager theft * Python changes to allow baby mobs to be processed * Add fox theft * Add witch theft limit * Add pig desaddling * Add strider desaddling * Add snow golem beheading * Add entity TODO list * Add wolf armor stealing * Add horse type mob item yoinking * Fix Donkey and Mule code a bit * Add Llama yoinking * Python refactor & the start of Dismounting work * Remove witch limit * Fix file new line issue * Switch to id based system for entity selection * Intial commit for id changes * Fix everything * overwrite old * actual overwrite old * minor text fixes * more fixes from the id change * Fix wrong command syntax :( * Re-Add smithed.entity ignore * Change id tags to be removed when unneeded * Vehicle separation passenger transfer * Add live catch to recommended * Misc comments because I need these file changes on my laptop to work on this while not at home * misc beet changes * py comment restructure * Refactor in prep for generic item yoinking * Refactor & Add Generic Hand/Armor Yoinking * Update to 1.21.5 * Some comment changes * Missed changes for 1.21.5 * Fix shulker teleporting * Fix chest boat yoinking * Rename function for clarity * Add Sheep shearing yoinking * Fix sheep wool yoinking I was rushing before * Fixes (hopefully) * Add Binding blocking for equipment theft * Add Entities - Wandering Trader: Steal Hands - Armor Stand: Steal Equipment - Camel: Steal Saddle - Mooshroom: Shear and steal shrooms - Bee: Steal honey comb and suffer the consequences * Optimize bobber id setting * single comment change because nobody can stop me * Fix my id changes & add sounds :D * Change some player selectors to `@p` * Change a few more player selectors to @p * Shorten bee anger time * Add Barbed Enchantment (#2) * Add Barbed Enchantment * Fix formatting * Update apply_barbed_damage header * Add missing comma * Remove extra line * Update non_treasure.json to include barbed Needed for it to show up in enchanting table * Fix barbed damage not running * Increase Barbed Damage * Adjust Enchantment Cost --------- Co-authored-by: runcows <124551271+runcows@users.noreply.github.com> * Fix overassigning ID causing breakage * Adjust enchantment cost & rarity * Remove excess entity_data storage * Add Barbed Delayed Damage * Fix Bleeding Damage not Starting * Adjust Damage & Particles * Add Custom Death Messages * Adjust Enchantment Weights * Fix Death Messages & Properly Reset Players on Respawn * Fix Bleeding Damage not Triggering for non-Player Entities * ID rewrite to use scores & optimization * Swap enchantment name for translation string * Big Reorganization * Add Bloo to credits * Missed renaming for reorganization * minor changes * Fix item data not being reset all the time * Change barbed to explode tnt minecarts * Rework hooked_entity/select_type to use bolt in file instead of generating file * Add drop chance usage to reeling * Drop Chance Rework - if 0%, playsound and fail - else, yoink - there are exceptions for stealing mainhand Also did some reorganization to make this easier to update in the future * Formatting Changes * Update to 1.21.6 - extend leash knot search range to 12 blocks - add happy_ghast to leashable tag list - add happy_ghast harness reeling * Fix item frame yoinking not respecting fixed tag * Set module to not run if hooked entity is Invulnerable * Upload Icon * Uncomment Icon Design in beet.yaml * Initial Guidebook and Readme * Automated Guidebook Building Stuff * Update gm4_reeling_rods/data/gm4_reeling_rods/function/id/loop.mcfunction Co-authored-by: Bloo <git@bloo.boo> * Update gm4_reeling_rods/data/gm4_reeling_rods/function/tick.mcfunction Co-authored-by: Bloo <git@bloo.boo> * A couple of header comments * Update gm4_reeling_rods/generate_files.py * Fail minecart & mooshroom if passengers * Optimize reeling/stealable/steal_hand * Clean `generate_files.py` and move a tag command * Add enderman falling block yoinking, fix a logical error with motion function, adjust a few commands * Update get_motion_to_player header comment * Update gm4_reeling_rods/data/gm4_reeling_rods/function/get_motion_to_player.mcfunction - Swear this is the last time. I got all nitpicky about the comments * Translations file * Forgot key in translations * Add Panda to steal hand - because I forgot them * Update header in get_execution_pos * Guidebook pages for reeling and barbed now unlock when getting an enchanted book with them on it * Reword Guidebook Pages * Add unreleased modrinth page id --------- Co-authored-by: Bloo <git@bloo.boo>
1 parent 0bdc20c commit 9a07655

99 files changed

Lines changed: 2130 additions & 158 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

gm4/modeldata_registry.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -534,6 +534,7 @@
534534
"fishing_rod": {
535535
"gm4_end_fishing:gui/advancement/end_fishing": 1,
536536
"gm4_end_fishing:guidebook_icon/end_fishing": 2,
537+
"gm4_reeling_rods:guidebook_icon/reeling_rods": 3,
537538
"gm4_metallurgy:shamir/hypexperia": 110,
538539
"gm4_animi_shamir:shamir/animi": 124
539540
},

gm4/utils.py

Lines changed: 183 additions & 157 deletions
Large diffs are not rendered by default.

gm4_guidebook/triggers.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"__important__": "Generated by generate_guidebooks.py. Don't manually update this",
3-
"__next__": 121,
3+
"__next__": 122,
44
"animi_shamir": 91,
55
"apple_trees": 83,
66
"arborenda_shamir": 20,
@@ -82,6 +82,7 @@
8282
"potion_liquids": 32,
8383
"potion_swords": 62,
8484
"record_crafting": 97,
85+
"reeling_rods": 121,
8586
"relocators": 70,
8687
"resurrecting_skeletons": 41,
8788
"resurrecting_zombies": 46,

gm4_reeling_rods/README.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# Reeling Rods<!--$headerTitle--><!--$pmc:delete-->
2+
3+
Reel in more than just fish with these rods. Yoink the chest from the chest boat, deal some damage, and more! <!--$pmc:headerSize-->
4+
5+
### Features
6+
- 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.
7+
8+
Adds 2 fishing rod enchantments, Reeling and Barbed.
9+
- Reeling revolves around stealing from entities. Pull the chest from chest boats and so much more!
10+
- 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.

gm4_reeling_rods/beet.yaml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
id: gm4_reeling_rods
2+
name: Reeling Rods
3+
version: 1.0.X
4+
5+
data_pack:
6+
load: .
7+
8+
pipeline:
9+
- generate_files
10+
- gm4.plugins.extend.module
11+
12+
require:
13+
- bolt
14+
15+
meta:
16+
gm4:
17+
versioning:
18+
schedule_loops: [tick]
19+
website:
20+
description: Reel in more than just fish with these rods! Yoink the chest from the chest boat and more!
21+
recommended:
22+
- gm4_end_fishing
23+
- gm4_live_catch
24+
notes: []
25+
modrinth:
26+
project_id: MWPuloVL
27+
#smithed:
28+
#pack_id:
29+
#planetminecraft:
30+
#uid:
31+
video: null
32+
wiki: https://wiki.gm4.co/wiki/Reeling_Rods
33+
credits:
34+
Creators:
35+
- runcows
36+
- Bloo
37+
Icon Design:
38+
- runcows
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
{
2+
"description": {
3+
"translate": "gm4.reeling_rods.enchantment.barbed",
4+
"fallback": "Barbed"
5+
},
6+
"exclusive_set": "gm4_reeling_rods:reeling",
7+
"supported_items": "minecraft:fishing_rod",
8+
"primary_items": "minecraft:fishing_rod",
9+
"weight": 1,
10+
"max_level": 5,
11+
"min_cost": {
12+
"base": 1,
13+
"per_level_above_first": 10
14+
},
15+
"max_cost": {
16+
"base": 51,
17+
"per_level_above_first": 10
18+
},
19+
"anvil_cost": 1,
20+
"slots": [
21+
"any"
22+
],
23+
"effects": {}
24+
}
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
{
2+
"description": {
3+
"translate": "gm4.reeling_rods.enchantment.reeling",
4+
"fallback": "Reeling"
5+
},
6+
"exclusive_set": "gm4_reeling_rods:barbed",
7+
"supported_items": "minecraft:fishing_rod",
8+
"primary_items": "minecraft:fishing_rod",
9+
"weight": 1,
10+
"max_level": 1,
11+
"min_cost": {
12+
"base": 20,
13+
"per_level_above_first": 0
14+
},
15+
"max_cost": {
16+
"base": 70,
17+
"per_level_above_first": 0
18+
},
19+
"anvil_cost": 8,
20+
"slots": [
21+
"any"
22+
],
23+
"effects": {}
24+
}
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# Applies the barbed damage to the hooked entity
2+
# @s = hooked entity
3+
# at bobber position
4+
# with {damage}
5+
# run from hooked_entity/select_type
6+
7+
# immediate damage (amount scales with enchantment level)
8+
execute store result score $show_death_messages gm4_reeling_rods.barbed_damage_timer run gamerule showDeathMessages
9+
gamerule showDeathMessages false
10+
$damage @s $(damage) cactus by @p[tag=gm4_reeling_rods.player]
11+
playsound minecraft:entity.player.attack.crit player @a[distance=..16] ~ ~ ~ 1 1.82
12+
13+
# handle death (@e only selects entities which are alive)
14+
# | this is of importance for entities which display death messages or re-spawn
15+
tag @s add gm4_reeling_rods.victim
16+
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
17+
18+
# if the victim is still alive, schedule bleeding damage
19+
execute at @s if entity @e[tag=gm4_reeling_rods.victim,distance=0,limit=1] run function gm4_reeling_rods:barbed/schedule_bleeding
20+
21+
# reset scores, gamerule and tag
22+
tag @s remove gm4_reeling_rods.victim
23+
execute if score $show_death_messages gm4_reeling_rods.barbed_damage_timer matches 1 run gamerule showDeathMessages true
24+
scoreboard players reset $show_death_messages gm4_reeling_rods.barbed_damage_timer
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
# updates the bleeding timer
2+
# @s = entity recently hit by a barbed fishing rod
3+
# at @s
4+
# run from barbed/find_affected
5+
6+
# advance timer
7+
scoreboard players add @s gm4_reeling_rods.barbed_damage_timer 1
8+
9+
# clear if timer exceeds 3s
10+
execute if score @s gm4_reeling_rods.barbed_damage_timer matches 61.. run return run function gm4_reeling_rods:barbed/clear
11+
12+
# return unless phase of timer is 0
13+
scoreboard players operation $phase gm4_reeling_rods.barbed_damage_timer = @s gm4_reeling_rods.barbed_damage_timer
14+
scoreboard players operation $phase gm4_reeling_rods.barbed_damage_timer %= @s gm4_reeling_rods.barbed_damage_period
15+
execute unless score $phase gm4_reeling_rods.barbed_damage_timer matches 0 run return fail
16+
17+
# find attacker
18+
# | tags attacker with gm4_reeling_rods.barbed_attacker
19+
# | sets $found_attacker gm4_reeling_rods.barbed_attacker_uuid0
20+
execute summon snowball run function gm4_reeling_rods:barbed/find_attacker
21+
22+
# prepare to handle player death
23+
execute store result score $show_death_messages gm4_reeling_rods.barbed_damage_timer run gamerule showDeathMessages
24+
gamerule showDeathMessages false
25+
26+
# apply damage
27+
# | if the attacker was found, attribute it to the attacker, if not do not attribute it to anyone
28+
# | use cactus damage type as it has no knockback and respects armor
29+
# | print custom death message to obscure cactus death message
30+
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]
31+
execute unless score $found_attacker gm4_reeling_rods.barbed_attacker_uuid0 matches 1.. run damage @s 2 cactus
32+
playsound minecraft:block.pointed_dripstone.drip_lava neutral @a[distance=..6] ~ ~ ~ 1 1.8
33+
execute anchored eyes run particle damage_indicator ^ ^ ^ .2 .2 .2 0 3
34+
execute anchored eyes run particle damage_indicator ^ ^ ^1 .5 .5 .5 0 8 normal @s
35+
36+
# handle death (@e only selects entities which are alive)
37+
# | this is of importance for entities which display death messages or re-spawn
38+
tag @s add gm4_reeling_rods.victim
39+
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
40+
tag @s remove gm4_reeling_rods.victim
41+
execute if score $show_death_messages gm4_reeling_rods.barbed_damage_timer matches 1 run gamerule showDeathMessages true
42+
scoreboard players reset $show_death_messages gm4_reeling_rods.barbed_damage_timer
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# stops bleeding damage
2+
# @s = entity recently hit by a barbed fishing rod
3+
# at @s
4+
# run from barbed/bleed, barbed/on_bleeding_death, and barbed/on_scratch_death
5+
6+
scoreboard players reset @s gm4_reeling_rods.barbed_attacker_uuid0
7+
scoreboard players reset @s gm4_reeling_rods.barbed_attacker_uuid1
8+
scoreboard players reset @s gm4_reeling_rods.barbed_attacker_uuid2
9+
scoreboard players reset @s gm4_reeling_rods.barbed_attacker_uuid3
10+
scoreboard players reset @s gm4_reeling_rods.barbed_damage_period
11+
scoreboard players reset @s gm4_reeling_rods.barbed_damage_timer

0 commit comments

Comments
 (0)