Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
4 changes: 3 additions & 1 deletion gm4_reeling_rods/beet.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,16 @@ data_pack:
pipeline:
- generate_files
- gm4.plugins.extend.module
- gm4.plugins.include.lib_hooked_entity

require:
- bolt

meta:
gm4:
versioning:
schedule_loops: [tick]
required:
lib_hooked_entity: 1.0.0
website:
description: Steal Villager's wares, scratch up your foes! Fishing rods have never been more useful!
recommended:
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"values": [
"gm4_reeling_rods:hooked_entity/select_type"
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"values": [
"gm4_reeling_rods:get_player_data"
]
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
# immediate damage (amount scales with enchantment level)
execute store result score $show_death_messages gm4_reeling_rods.barbed_damage_timer run gamerule show_death_messages
gamerule show_death_messages false
$damage @s $(damage) cactus by @p[tag=gm4_reeling_rods.player]
$damage @s $(damage) cactus by @p[tag=gm4_hooked_entity.player]
playsound minecraft:entity.player.attack.crit player @a[distance=..16] ~ ~ ~ 1 1.82

# handle death (@e only selects entities which are alive)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
# 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 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_hooked_entity.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] 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_hooked_entity.player]"}]}]
execute unless entity @s[type=player] on owner run tag @s remove gm4_reeling_rods.owner

# reset barbed state
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
# 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
data modify storage gm4_reeling_rods:temp enchanted.barbed.attacker_uuid set from entity @a[limit=1,tag=gm4_hooked_entity.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]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
# Finds the entity the player hooked
# Gets data for later logic
# @s = player who fished
# at @s
# with {bit_0, bit_1, bit_2, bit_3, bit_4, bit_5, bit_6, bit_7, bit_8, bit_9, bit_10, bit_11, bit_12, bit_13, bit_14, bit_15}
# run from player/received_bit
# run from #gm4_hooked_entity:pre_hook_on_player

# store fishing rod & caster properties
execute store success score $adventure gm4_reeling_rods.math if entity @s[gamemode=adventure]
data remove storage gm4_reeling_rods:temp enchanted
execute if predicate gm4_reeling_rods:holding_reeling_rod run data modify storage gm4_reeling_rods:temp enchanted.reeling set value 1
execute if predicate gm4_reeling_rods:holding_barbed_rod/level_1 run data modify storage gm4_reeling_rods:temp enchanted.barbed set value {period: 31,damage:3}
Expand All @@ -16,16 +15,3 @@ data modify storage gm4_reeling_rods:temp player_data.Pos set from entity @s Pos
execute store result score $motionX gm4_reeling_rods.math run data get storage gm4_reeling_rods:temp player_data.Pos[0] 1
execute store result score $motionY gm4_reeling_rods.math run data get storage gm4_reeling_rods:temp player_data.Pos[1] 1
execute store result score $motionZ gm4_reeling_rods.math run data get storage gm4_reeling_rods:temp player_data.Pos[2] 1

tag @s add gm4_reeling_rods.player

# distance from bobber to entity is ..42 as that represents a vanilla entity of 3.28 blocks tall at a max of 16x scale and then 80% of the height to find the fishing bobber
$execute as @e[type=minecraft:fishing_bobber,distance=..33] \
if function gm4_reeling_rods:player/owns_bobber \
at @s as @e[\
distance=..42, limit=1, type=!#gm4_reeling_rods:ignore, \
scores={$(bit_0),$(bit_1),$(bit_2),$(bit_3),$(bit_4),$(bit_5),$(bit_6),$(bit_7),$(bit_8),$(bit_9),$(bit_10),$(bit_11),$(bit_12),$(bit_13),$(bit_14),$(bit_15)}\
] unless entity @s[tag=smithed.entity] unless data entity @s {Invulnerable:1b} \
run function gm4_reeling_rods:hooked_entity/select_type

tag @s remove gm4_reeling_rods.player
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@
# at bobber in @s
# run from hooked_entity/select_type

damage @s 1 minecraft:player_attack by @p[tag=gm4_reeling_rods.player]
damage @s 1 minecraft:player_attack by @p[tag=gm4_hooked_entity.player]
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@
# 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
data modify entity @s leash.UUID set from entity @p[tag=gm4_hooked_entity.player] UUID
Original file line number Diff line number Diff line change
@@ -1,7 +1,13 @@
# Selects the right entity type or dismounts the entity.
# Dispatch function for logic on hooked entity
# @s = hooked entity
# at bobber in entity
# run from player/find_hooked_entity
# run from #gm4_hooked_entity:on_hooked_entity

# fails
execute if score $adventure gm4_reeling_rods.math matches 1 run return fail
execute if entity @s[type=#gm4_reeling_rods:ignore] run return fail
execute if entity @s[tag=smithed.entity] run return fail
execute if data entity @s {Invulnerable:1b} run return fail

# apply barbed damage
execute if data storage gm4_reeling_rods:temp enchanted.barbed if data entity @s Health unless entity @s[type=player,gamemode=creative] \
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@
# at bobber in @s
# run from hooked_entity/select_type

execute at @s facing entity @a[tag=gm4_reeling_rods.player,distance=..33,limit=1] eyes if block ^ ^ ^1 #gm4:replaceable run tp @s ^ ^ ^1
execute at @s facing entity @a[tag=gm4_hooked_entity.player,distance=..33,limit=1] eyes if block ^ ^ ^1 #gm4:replaceable run tp @s ^ ^ ^1

This file was deleted.

This file was deleted.

26 changes: 0 additions & 26 deletions gm4_reeling_rods/data/gm4_reeling_rods/function/id/set.mcfunction

This file was deleted.

20 changes: 0 additions & 20 deletions gm4_reeling_rods/data/gm4_reeling_rods/function/init.mcfunction
Original file line number Diff line number Diff line change
Expand Up @@ -10,26 +10,6 @@ scoreboard objectives add gm4_reeling_rods.barbed_attacker_uuid0 dummy
scoreboard objectives add gm4_reeling_rods.barbed_attacker_uuid1 dummy
scoreboard objectives add gm4_reeling_rods.barbed_attacker_uuid2 dummy
scoreboard objectives add gm4_reeling_rods.barbed_attacker_uuid3 dummy
scoreboard objectives add gm4_reeling_rods.rods_cast minecraft.used:minecraft.fishing_rod
# id
scoreboard objectives add gm4_reeling_rods.id_bit.0 dummy
scoreboard objectives add gm4_reeling_rods.id_bit.1 dummy
scoreboard objectives add gm4_reeling_rods.id_bit.2 dummy
scoreboard objectives add gm4_reeling_rods.id_bit.3 dummy
scoreboard objectives add gm4_reeling_rods.id_bit.4 dummy
scoreboard objectives add gm4_reeling_rods.id_bit.5 dummy
scoreboard objectives add gm4_reeling_rods.id_bit.6 dummy
scoreboard objectives add gm4_reeling_rods.id_bit.7 dummy
scoreboard objectives add gm4_reeling_rods.id_bit.8 dummy
scoreboard objectives add gm4_reeling_rods.id_bit.9 dummy
scoreboard objectives add gm4_reeling_rods.id_bit.10 dummy
scoreboard objectives add gm4_reeling_rods.id_bit.11 dummy
scoreboard objectives add gm4_reeling_rods.id_bit.12 dummy
scoreboard objectives add gm4_reeling_rods.id_bit.13 dummy
scoreboard objectives add gm4_reeling_rods.id_bit.14 dummy
scoreboard objectives add gm4_reeling_rods.id_bit.15 dummy

# set_lookup_table is generated in generate_files.py
function gm4_reeling_rods:set_lookup_table

schedule function gm4_reeling_rods:tick 5t

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ execute unless data entity @s {HasNectar:1b} run return fail
# Steal
data modify storage gm4_reeling_rods:temp item_data set value {}
data modify entity @s HasNectar set value 0b
data modify entity @s angry_at set from entity @p[tag=gm4_reeling_rods.player] UUID
data modify entity @s angry_at set from entity @p[tag=gm4_hooked_entity.player] UUID
execute store result score $anger_end_time gm4_reeling_rods.math run time query gametime
scoreboard players add $anger_end_time gm4_reeling_rods.math 300
execute store result entity @s anger_end_time long 1 run scoreboard players get $anger_end_time gm4_reeling_rods.math
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ execute unless score $slot gm4_reeling_rods.math matches 1 run return fail
function gm4_reeling_rods:reeling/villager/sell_out with storage gm4_reeling_rods:temp entity_data

# add 20 "major_negative" gossip of the player to the villager
data modify storage gm4_reeling_rods:temp entity_data.gossip.Target set from entity @p[tag=gm4_reeling_rods.player] UUID
data modify storage gm4_reeling_rods:temp entity_data.gossip.Target set from entity @p[tag=gm4_hooked_entity.player] UUID
function gm4_reeling_rods:reeling/villager/add_gossip with storage gm4_reeling_rods:temp entity_data.gossip

# feedback
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,39 +1,13 @@
{
"values": [
"minecraft:area_effect_cloud",
"minecraft:arrow",
"minecraft:block_display",
"minecraft:breeze_wind_charge",
"minecraft:command_block_minecart",
"minecraft:dragon_fireball",
"minecraft:egg",
"minecraft:ender_pearl",
"minecraft:evoker_fangs",
"minecraft:experience_bottle",
"minecraft:experience_orb",
"minecraft:eye_of_ender",
"minecraft:falling_block",
"minecraft:fireball",
"minecraft:firework_rocket",
"minecraft:fishing_bobber",
"minecraft:interaction",
"minecraft:item",
"minecraft:item_display",
"minecraft:lightning_bolt",
"minecraft:lingering_potion",
"minecraft:llama_spit",
"minecraft:marker",
"minecraft:ominous_item_spawner",
"minecraft:splash_potion",
"minecraft:shulker_bullet",
"minecraft:small_fireball",
"minecraft:snowball",
"minecraft:spawner_minecart",
"minecraft:spectral_arrow",
"minecraft:text_display",
"minecraft:tnt",
"minecraft:trident",
"minecraft:wind_charge",
"minecraft:wither_skull"
"minecraft:wind_charge"
]
}
Loading
Loading