Skip to content
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

Fix End Fishing Bobber #317

Merged
merged 4 commits into from
Oct 30, 2019
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
20 changes: 10 additions & 10 deletions gm4_end_fishing/data/end_fishing/advancements/set_id.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
{
"criteria":{
"join_world":{
"trigger":"location"
}
},
"rewards":{
"function":"end_fishing:set_id"
}
}
{
"criteria":{
"join_world":{
"trigger":"location"
}
},
"rewards":{
"function":"end_fishing:set_id"
}
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#@s = fishing bobber
#@s = fishing bobber positioned ^ ^ ^-4.5
#run from pulse_check

summon minecraft:armor_stand ^ ^ ^-2 {DisabledSlots:2039552,Small:1,Invisible:1,NoGravity:1b,Tags:["gm4_no_edit","gm4_fishing_bait_set"]}
summon minecraft:armor_stand ~ ~ ~ {DisabledSlots:2039552,Small:1,Invisible:1,NoGravity:1b,Tags:["gm4_no_edit","gm4_fishing_bait_set"]}

scoreboard players operation @e[type=armor_stand,limit=1,sort=nearest,tag=gm4_fishing_bait_set] gm4_ef_id = @s gm4_ef_id

Expand All @@ -10,6 +10,6 @@ scoreboard players operation @e[type=armor_stand,limit=1,sort=nearest,tag=gm4_fi
execute as @e[type=armor_stand,limit=1,sort=nearest,tag=gm4_fishing_bait_set] run function end_fishing:cast_rod/randomize_timer

tag @e[type=armor_stand,limit=1,sort=nearest,tag=gm4_fishing_bait_set] add gm4_fishing_bait
tag @e[type=armor_stand,limit=1,sort=nearest,tag=gm4_fishing_bait_set] remove gm4_fishing_bait_set
tag @e[type=armor_stand,limit=1,sort=nearest,tag=gm4_fishing_bait_set,tag=gm4_fishing_bait] remove gm4_fishing_bait_set

tag @s add gm4_ef_casted
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#@s = fishing bait armor stand (every 3 clock cycles)
#run from process

scoreboard players reset @s gm4_ef_up_bait

#destruction
execute if entity @s[tag=gm4_ef_marker] positioned ~ ~ ~ unless entity @e[type=minecraft:fishing_bobber,distance=..0.0001] run kill @s
execute unless block ~ ~ ~ #end_fishing:traversable run kill @s

#make marker
execute unless entity @s[tag=gm4_ef_marker] positioned ~ ~0.79 ~ if entity @e[type=minecraft:fishing_bobber,limit=1,sort=nearest,distance=..0.0001] run function end_fishing:cast_rod/marker
kill @s[tag=!gm4_ef_marker]
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
#@s = fishing bait armor stand with fish
#run from pulse_check

scoreboard players add @s gm4_ef_data 1
execute if score @s gm4_ef_data matches 1 at @s run playsound minecraft:entity.ender_dragon.flap neutral @a[distance=..50] ~ ~ ~ 4 0.7
#@s = fishing bait armor stand with fish
#run from pulse_check
scoreboard players add @s gm4_ef_data 1
execute if score @s gm4_ef_data matches 1 at @s run playsound minecraft:entity.ender_dragon.flap neutral @a[distance=..50] ~ ~ ~ 4 0.7
execute if score @s gm4_ef_data matches 1..5 at @s run tp @s ~ ~-0.1 ~
execute if score @s gm4_ef_data matches 5 at @e[type=minecraft:fishing_bobber,limit=1,distance=..0.0001] run summon item ~ ~ ~ {NoGravity:1,PickupDelay:32767,Age:6000,Item:{id:"minecraft:stone_button",Count:1}}
execute if score @s gm4_ef_data matches 5 at @e[type=minecraft:fishing_bobber,limit=1,distance=..0.0001] run summon item ~ ~ ~ {NoGravity:1,PickupDelay:32767,Age:6000,Item:{id:"minecraft:stone_button",Count:1}}
execute if score @s gm4_ef_data matches 11..15 at @s run tp @s ~ ~0.1 ~
execute if score @s gm4_ef_data matches 15 at @e[type=minecraft:fishing_bobber,limit=1,distance=..0.0001] run summon item ~ ~ ~ {NoGravity:1,PickupDelay:32767,Age:6000,Item:{id:"minecraft:stone_button",Count:1}}
execute if score @s gm4_ef_data matches 30.. run function end_fishing:cast_rod/randomize_timer
execute if score @s gm4_ef_data matches 30.. run tag @s add gm4_fishing_bait
execute if score @s gm4_ef_data matches 30.. run tag @s remove gm4_ef_has_fish
execute if score @s gm4_ef_data matches 15 at @e[type=minecraft:fishing_bobber,limit=1,distance=..0.0001] run summon item ~ ~ ~ {NoGravity:1,PickupDelay:32767,Age:6000,Item:{id:"minecraft:stone_button",Count:1}}
execute if score @s gm4_ef_data matches 30.. run function end_fishing:cast_rod/randomize_timer
execute if score @s gm4_ef_data matches 30.. run tag @s add gm4_fishing_bait
execute if score @s gm4_ef_data matches 30.. run tag @s remove gm4_ef_has_fish
execute if score @s gm4_ef_data matches 30.. run scoreboard players reset @s gm4_ef_data
1 change: 1 addition & 0 deletions gm4_end_fishing/data/end_fishing/functions/init.mcfunction
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ scoreboard objectives add gm4_cast_rod minecraft.used:minecraft.fishing_rod
scoreboard objectives add gm4_ef_timer dummy
scoreboard objectives add gm4_ef_id dummy
scoreboard objectives add gm4_ef_lure dummy
scoreboard objectives add gm4_ef_up_bait dummy
scoreboard objectives add gm4_ef_data dummy
execute unless score seed gm4_ef_data matches 0.. run scoreboard players set seed gm4_ef_data 731031
scoreboard players set mult gm4_ef_data 1664525
Expand Down
8 changes: 2 additions & 6 deletions gm4_end_fishing/data/end_fishing/functions/process.mcfunction
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
#@s = fishing bait armor stand
#run from main

#make marker
execute unless entity @s[tag=gm4_ef_marker] positioned ~ ~0.79 ~ if entity @e[type=minecraft:fishing_bobber,limit=1,sort=nearest,distance=..0.0001] run function end_fishing:cast_rod/marker

#timer and loot
scoreboard players remove @s[scores={gm4_ef_timer=0..}] gm4_ef_timer 1
execute if score @s gm4_ef_timer matches 3 run function end_fishing:go_fish/summon_fish_particle
Expand All @@ -13,6 +10,5 @@ execute if score @s gm4_ef_timer matches ..0 unless entity @s[tag=gm4_ef_has_fis
#particle
execute positioned ~ ~ ~ at @e[type=minecraft:fishing_bobber,limit=1,sort=nearest,distance=..0.0001] run particle minecraft:end_rod ~ ~ ~ 0 0 0 .02 1 force

#destruction
execute positioned ~ ~0.8 ~ unless entity @e[type=minecraft:fishing_bobber,distance=..1.5] run kill @s
execute unless block ~ ~ ~ #end_fishing:traversable run kill @s
scoreboard players add @s gm4_ef_up_bait 1
execute if score @s gm4_ef_up_bait matches 2.. run function end_fishing:cast_rod/update_bait
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
execute if score current_tick gm4_clock_tick = end_fishing gm4_clock_tick run function end_fishing:main

#catch fishing bobber in the end
execute in minecraft:the_end as @e[type=minecraft:fishing_bobber,tag=!gm4_ef_casted,x_rotation=-90..-89,distance=0..] at @s unless entity @e[type=minecraft:armor_stand,tag=gm4_fishing_bait,distance=..3] run function end_fishing:cast_rod/summon_bait
execute in minecraft:the_end as @e[type=minecraft:fishing_bobber,tag=!gm4_ef_casted,x_rotation=-90..-85,distance=0..] at @s positioned ~ ~-5 ~ run function end_fishing:cast_rod/summon_bait

#store bobber data
execute in minecraft:the_end as @e[type=minecraft:fishing_bobber,tag=!gm4_ef_set,distance=0..] at @s run function end_fishing:cast_rod/store_data
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#@s = item that is to gain lore
#run from reel_in/reel_loot

execute store result score @s gm4_ef_data run data get entity @s UUIDMost 0.00000000023283064365386962890625
execute store result score @s gm4_ef_data run data get entity @s UUIDMost 0.00000000023283064365386962890625
scoreboard players operation @s gm4_ef_data %= #100 gm4_ef_data

execute if entity @s[nbt={Item:{tag:{gm4_ef_lore:{id:"end_city_tool"}}}}] run function end_fishing:reel_in/lore/tool
Expand Down
Loading