Skip to content

Commit 25e7293

Browse files
authored
Fix Tipped Arrows and Beehives (#1121)
1 parent 4fd26ce commit 25e7293

6 files changed

Lines changed: 77 additions & 74 deletions

File tree

gm4_crossbow_cartridges/data/gm4_crossbow_cartridges/function/projectile/beehive.mcfunction

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55

66
tag @s add gm4_cb_use
77
data modify storage gm4_crossbow_cartridges:temp bees set from entity @s equipment.offhand.components."minecraft:bees"
8+
execute unless data storage gm4_crossbow_cartridges:temp bees run return fail
89
data modify storage gm4_crossbow_cartridges:temp projectile set from storage gm4_crossbow_cartridges:temp bees[0].entity_data
910
data remove storage gm4_crossbow_cartridges:temp bees[0]
1011

gm4_crossbow_cartridges/data/gm4_crossbow_cartridges/function/shoot/any_arrow.mcfunction

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,10 @@ execute anchored eyes positioned ^ ^ ^ if entity @e[type=minecraft:spectral_arro
99
# tag arrow, 3 if multishot
1010
execute anchored eyes positioned ^ ^ ^ run tag @e[type=minecraft:arrow,nbt={inGround:0b},distance=..0.2,sort=nearest,limit=3] add gm4_cb_arrow
1111

12-
# check offhand item and replace arrow by projectile
13-
execute positioned as @e[type=arrow,tag=gm4_cb_arrow,limit=1,distance=..2,sort=nearest] run function gm4_crossbow_cartridges:check_projectile
12+
# check if arrow was tipped
13+
execute anchored eyes positioned ^ ^ ^ run data modify storage gm4_crossbow_cartridges:temp potion_contents set from entity @e[type=minecraft:arrow,tag=gm4_cb_arrow,distance=..0.2,limit=1] item.components."minecraft:potion_contents"
14+
execute if data storage gm4_crossbow_cartridges:temp potion_contents run function gm4_crossbow_cartridges:shoot/tipped
15+
data remove storage gm4_crossbow_cartridges:temp potion_contents
1416

15-
tag @s remove gm4_cb_shot_spectral
16-
tag @s remove gm4_cb_shot_tipped
17+
# check offhand item and replace arrow by projectile
18+
execute positioned as @e[tag=gm4_cb_arrow,limit=1,distance=..2,sort=nearest] run function gm4_crossbow_cartridges:check_projectile

gm4_crossbow_cartridges/data/gm4_crossbow_cartridges/function/shoot/effect.mcfunction

Lines changed: 0 additions & 51 deletions
This file was deleted.
Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
# @s = player using the crossbow with a tipped arrow
2+
# at @s
3+
# run from shoot/tipped
4+
5+
execute if data storage gm4_crossbow_cartridges:temp potion_contents{potion:"minecraft:swiftness"} run data modify storage gm4_crossbow_cartridges:temp projectile.active_effects set value [{id:'minecraft:speed',amplifier:0b,duration:440}]
6+
execute if data storage gm4_crossbow_cartridges:temp potion_contents{potion:"minecraft:long_swiftness"} run data modify storage gm4_crossbow_cartridges:temp projectile.active_effects set value [{id:'minecraft:speed',amplifier:0b,duration:1200}]
7+
execute if data storage gm4_crossbow_cartridges:temp potion_contents{potion:"minecraft:strong_swiftness"} run data modify storage gm4_crossbow_cartridges:temp projectile.active_effects set value [{id:'minecraft:speed',amplifier:1b,duration:220}]
8+
9+
execute if data storage gm4_crossbow_cartridges:temp potion_contents{potion:"minecraft:slowness"} run data modify storage gm4_crossbow_cartridges:temp projectile.active_effects set value [{id:'minecraft:slowness',amplifier:0b,duration:220}]
10+
execute if data storage gm4_crossbow_cartridges:temp potion_contents{potion:"minecraft:long_slowness"} run data modify storage gm4_crossbow_cartridges:temp projectile.active_effects set value [{id:'minecraft:slowness',amplifier:0b,duration:600}]
11+
execute if data storage gm4_crossbow_cartridges:temp potion_contents{potion:"minecraft:strong_slowness"} run data modify storage gm4_crossbow_cartridges:temp projectile.active_effects set value [{id:'minecraft:slowness',amplifier:3b,duration:40}]
12+
13+
execute if data storage gm4_crossbow_cartridges:temp potion_contents{potion:"minecraft:strength"} run data modify storage gm4_crossbow_cartridges:temp projectile.active_effects set value [{id:'minecraft:strength',amplifier:0b,duration:440}]
14+
execute if data storage gm4_crossbow_cartridges:temp potion_contents{potion:"minecraft:long_strength"} run data modify storage gm4_crossbow_cartridges:temp projectile.active_effects set value [{id:'minecraft:strength',amplifier:0b,duration:1200}]
15+
execute if data storage gm4_crossbow_cartridges:temp potion_contents{potion:"minecraft:strong_strength"} run data modify storage gm4_crossbow_cartridges:temp projectile.active_effects set value [{id:'minecraft:strength',amplifier:1b,duration:220}]
16+
17+
execute if data storage gm4_crossbow_cartridges:temp potion_contents{potion:"minecraft:healing"} run data modify storage gm4_crossbow_cartridges:temp projectile.active_effects set value [{id:'minecraft:instant_health',amplifier:0b,duration:1}]
18+
execute if data storage gm4_crossbow_cartridges:temp potion_contents{potion:"minecraft:strong_healing"} run data modify storage gm4_crossbow_cartridges:temp projectile.active_effects set value [{id:'minecraft:instant_health',amplifier:1b,duration:1}]
19+
20+
execute if data storage gm4_crossbow_cartridges:temp potion_contents{potion:"minecraft:harming"} run data modify storage gm4_crossbow_cartridges:temp projectile.active_effects set value [{id:'minecraft:instant_damage',amplifier:0b,duration:1}]
21+
execute if data storage gm4_crossbow_cartridges:temp potion_contents{potion:"minecraft:strong_harming"} run data modify storage gm4_crossbow_cartridges:temp projectile.active_effects set value [{id:'minecraft:instant_damage',amplifier:1b,duration:1}]
22+
23+
execute if data storage gm4_crossbow_cartridges:temp potion_contents{potion:"minecraft:leaping"} run data modify storage gm4_crossbow_cartridges:temp projectile.active_effects set value [{id:'minecraft:jump_boost',amplifier:0b,duration:440}]
24+
execute if data storage gm4_crossbow_cartridges:temp potion_contents{potion:"minecraft:long_leaping"} run data modify storage gm4_crossbow_cartridges:temp projectile.active_effects set value [{id:'minecraft:jump_boost',amplifier:0b,duration:1200}]
25+
execute if data storage gm4_crossbow_cartridges:temp potion_contents{potion:"minecraft:strong_leaping"} run data modify storage gm4_crossbow_cartridges:temp projectile.active_effects set value [{id:'minecraft:jump_boost',amplifier:1b,duration:220}]
26+
27+
execute if data storage gm4_crossbow_cartridges:temp potion_contents{potion:"minecraft:regeneration"} run data modify storage gm4_crossbow_cartridges:temp projectile.active_effects set value [{id:'minecraft:regeneration',amplifier:0b,duration:100}]
28+
execute if data storage gm4_crossbow_cartridges:temp potion_contents{potion:"minecraft:long_regeneration"} run data modify storage gm4_crossbow_cartridges:temp projectile.active_effects set value [{id:'minecraft:regeneration',amplifier:0b,duration:220}]
29+
execute if data storage gm4_crossbow_cartridges:temp potion_contents{potion:"minecraft:strong_regeneration"} run data modify storage gm4_crossbow_cartridges:temp projectile.active_effects set value [{id:'minecraft:regeneration',amplifier:1b,duration:40}]
30+
31+
execute if data storage gm4_crossbow_cartridges:temp potion_contents{potion:"minecraft:fire_resistance"} run data modify storage gm4_crossbow_cartridges:temp projectile.active_effects set value [{id:'minecraft:fire_resistance',amplifier:0b,duration:440}]
32+
execute if data storage gm4_crossbow_cartridges:temp potion_contents{potion:"minecraft:long_fire_resistance"} run data modify storage gm4_crossbow_cartridges:temp projectile.active_effects set value [{id:'minecraft:fire_resistance',amplifier:0b,duration:1200}]
33+
34+
execute if data storage gm4_crossbow_cartridges:temp potion_contents{potion:"minecraft:water_breathing"} run data modify storage gm4_crossbow_cartridges:temp projectile.active_effects set value [{id:'minecraft:water_breathing',amplifier:0b,duration:440}]
35+
execute if data storage gm4_crossbow_cartridges:temp potion_contents{potion:"minecraft:long_water_breathing"} run data modify storage gm4_crossbow_cartridges:temp projectile.active_effects set value [{id:'minecraft:water_breathing',amplifier:0b,duration:1200}]
36+
37+
execute if data storage gm4_crossbow_cartridges:temp potion_contents{potion:"minecraft:invisibility"} run data modify storage gm4_crossbow_cartridges:temp projectile.active_effects set value [{id:'minecraft:invisibility',amplifier:0b,duration:440}]
38+
execute if data storage gm4_crossbow_cartridges:temp potion_contents{potion:"minecraft:long_invisibility"} run data modify storage gm4_crossbow_cartridges:temp projectile.active_effects set value [{id:'minecraft:invisibility',amplifier:0b,duration:1200}]
39+
40+
execute if data storage gm4_crossbow_cartridges:temp potion_contents{potion:"minecraft:night_vision"} run data modify storage gm4_crossbow_cartridges:temp projectile.active_effects set value [{id:'minecraft:night_vision',amplifier:0b,duration:440}]
41+
execute if data storage gm4_crossbow_cartridges:temp potion_contents{potion:"minecraft:long_night_vision"} run data modify storage gm4_crossbow_cartridges:temp projectile.active_effects set value [{id:'minecraft:night_vision',amplifier:0b,duration:1200}]
42+
43+
execute if data storage gm4_crossbow_cartridges:temp potion_contents{potion:"minecraft:weakness"} run data modify storage gm4_crossbow_cartridges:temp projectile.active_effects set value [{id:'minecraft:weakness',amplifier:0b,duration:220}]
44+
execute if data storage gm4_crossbow_cartridges:temp potion_contents{potion:"minecraft:long_weakness"} run data modify storage gm4_crossbow_cartridges:temp projectile.active_effects set value [{id:'minecraft:weakness',amplifier:0b,duration:600}]
45+
46+
execute if data storage gm4_crossbow_cartridges:temp potion_contents{potion:"minecraft:poison"} run data modify storage gm4_crossbow_cartridges:temp projectile.active_effects set value [{id:'minecraft:poison',amplifier:0b,duration:100}]
47+
execute if data storage gm4_crossbow_cartridges:temp potion_contents{potion:"minecraft:long_poison"} run data modify storage gm4_crossbow_cartridges:temp projectile.active_effects set value [{id:'minecraft:poison',amplifier:0b,duration:220}]
48+
execute if data storage gm4_crossbow_cartridges:temp potion_contents{potion:"minecraft:strong_poison"} run data modify storage gm4_crossbow_cartridges:temp projectile.active_effects set value [{id:'minecraft:poison',amplifier:1b,duration:40}]
49+
50+
execute if data storage gm4_crossbow_cartridges:temp potion_contents{potion:"minecraft:slow_falling"} run data modify storage gm4_crossbow_cartridges:temp projectile.active_effects set value [{id:'minecraft:slow_falling',amplifier:0b,duration:220}]
51+
execute if data storage gm4_crossbow_cartridges:temp potion_contents{potion:"minecraft:long_slow_falling"} run data modify storage gm4_crossbow_cartridges:temp projectile.active_effects set value [{id:'minecraft:slow_falling',amplifier:0b,duration:600}]
52+
53+
execute if data storage gm4_crossbow_cartridges:temp potion_contents{potion:"minecraft:turtle_master"} run data modify storage gm4_crossbow_cartridges:temp projectile.active_effects set value [{id:'minecraft:slowness',amplifier:3b,duration:40},{id:'minecraft:resistance',amplifier:2b,duration:40}]
54+
execute if data storage gm4_crossbow_cartridges:temp potion_contents{potion:"minecraft:long_turtle_master"} run data modify storage gm4_crossbow_cartridges:temp projectile.active_effects set value [{id:'minecraft:slowness',amplifier:3b,duration:100},{id:'minecraft:resistance',amplifier:2b,duration:100}]
55+
execute if data storage gm4_crossbow_cartridges:temp potion_contents{potion:"minecraft:strong_turtle_master"} run data modify storage gm4_crossbow_cartridges:temp projectile.active_effects set value [{id:'minecraft:slowness',amplifier:5b,duration:40},{id:'minecraft:resistance',amplifier:3b,duration:40}]
56+
57+
execute if data storage gm4_crossbow_cartridges:temp potion_contents{potion:"minecraft:luck"} run data modify storage gm4_crossbow_cartridges:temp projectile.active_effects set value [{id:'minecraft:luck',amplifier:0b,duration:740}]
58+
59+
execute if data storage gm4_crossbow_cartridges:temp potion_contents{potion:"minecraft:wind_charged"} run data modify storage gm4_crossbow_cartridges:temp projectile.active_effects set value [{id:'minecraft:wind_charged',amplifier:0b,duration:440}]
60+
61+
execute if data storage gm4_crossbow_cartridges:temp potion_contents{potion:"minecraft:weaving"} run data modify storage gm4_crossbow_cartridges:temp projectile.active_effects set value [{id:'minecraft:weaving',amplifier:0b,duration:440}]
62+
63+
execute if data storage gm4_crossbow_cartridges:temp potion_contents{potion:"minecraft:ozzing"} run data modify storage gm4_crossbow_cartridges:temp projectile.active_effects set value [{id:'minecraft:ozzing',amplifier:0b,duration:440}]
64+
65+
execute if data storage gm4_crossbow_cartridges:temp potion_contents{potion:"minecraft:infestation"} run data modify storage gm4_crossbow_cartridges:temp projectile.active_effects set value [{id:'minecraft:infestation',amplifier:0b,duration:440}]

0 commit comments

Comments
 (0)