Skip to content

Commit 9bf3e40

Browse files
committed
Fix modules using Inventory for armor or offhand
1 parent 29fc856 commit 9bf3e40

18 files changed

Lines changed: 21 additions & 20 deletions

File tree

gm4_better_armour_stands/data/gm4_better_armour_stands/function/pose/paste.mcfunction

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
scoreboard players set $valid_code gm4_bas_data 1
66

77
# copy item data to armor_stand
8-
data modify entity @s {} merge from entity @a[tag=gm4_bas_active,limit=1] Inventory[-1].components."minecraft:entity_data"
8+
data modify entity @s {} merge from entity @a[tag=gm4_bas_active,limit=1] equipment.offhand.components."minecraft:entity_data"
99

1010
# play a sound to confirm
1111
playsound minecraft:entity.armor_stand.fall block @a[distance=..6] ~ ~ ~ 0.5 1

gm4_crossbow_cartridges/data/gm4_crossbow_cartridges/function/cables/shoot_arrow.mcfunction

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
tag @s add gm4_cb_use
77

88
# store amount of string on the player, with max value of 40
9-
execute store result score @s gm4_cb_string run data get entity @s Inventory[-1].count
9+
execute store result score @s gm4_cb_string run data get entity @s equipment.offhand.count
1010

1111
# check for tripwire hook on the player
1212
execute store success score @s gm4_cb_tw_hook run clear @s minecraft:tripwire_hook 0

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
# run from check_projectile
55

66
tag @s add gm4_cb_use
7-
data modify storage gm4_crossbow_cartridges:temp bees set from entity @s Inventory[{Slot:-106b}].components."minecraft:bees"
7+
data modify storage gm4_crossbow_cartridges:temp bees set from entity @s equipment.offhand.components."minecraft:bees"
88
data modify storage gm4_crossbow_cartridges:temp projectile set from storage gm4_crossbow_cartridges:temp bees[0].entity_data
99
data remove storage gm4_crossbow_cartridges:temp bees[0]
1010

gm4_crossbow_cartridges/data/gm4_crossbow_cartridges/function/projectile/bucket/axolotl.mcfunction

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
summon minecraft:axolotl ~ ~ ~ {FromBucket:1b,Tags:["gm4_cb_projectile"],active_effects:[{id:'minecraft:regeneration',amplifier:10,duration:200,show_particles:0b}]}
88

99
# TODO 1.20.5: changed to copy all bucket entity data, check if this causes problems
10-
data modify storage gm4_crossbow_cartridges:temp projectile merge from entity @s Inventory[{Slot:-106b}].components."minecraft:bucket_entity_data"
10+
data modify storage gm4_crossbow_cartridges:temp projectile merge from entity @s equipment.offhand.components."minecraft:bucket_entity_data"
1111
execute as @e[type=minecraft:axolotl,tag=gm4_cb_projectile,limit=1,distance=..1] run function gm4_crossbow_cartridges:projectile/arrow_motion
1212

1313
# axolotl sound

gm4_crossbow_cartridges/data/gm4_crossbow_cartridges/function/projectile/bucket/cod.mcfunction

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
# replace arrow with cod and copy data
77
summon minecraft:cod ~ ~ ~ {FromBucket:1b,Tags:["gm4_cb_projectile"],active_effects:[{id:'minecraft:regeneration',amplifier:10,duration:200,show_particles:0b}]}
88

9-
data modify storage gm4_crossbow_cartridges:temp projectile merge from entity @s Inventory[{Slot:-106b}].components."minecraft.bucket_entity_data"
9+
data modify storage gm4_crossbow_cartridges:temp projectile merge from entity @s equipment.offhand.components."minecraft.bucket_entity_data"
1010
execute as @e[type=minecraft:cod,tag=gm4_cb_projectile,limit=1,distance=..1] run function gm4_crossbow_cartridges:projectile/arrow_motion
1111

1212
# fish flop sound

gm4_crossbow_cartridges/data/gm4_crossbow_cartridges/function/projectile/bucket/pufferfish.mcfunction

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
# replace arrow with pufferfish and copy data
77
summon minecraft:pufferfish ~ ~ ~ {FromBucket:1b,Tags:["gm4_cb_projectile"],active_effects:[{id:'minecraft:regeneration',amplifier:10,duration:200,show_particles:0b}]}
88

9-
data modify storage gm4_crossbow_cartridges:temp projectile merge from entity @s Inventory[{Slot:-106b}].components."minecraft.bucket_entity_data"
9+
data modify storage gm4_crossbow_cartridges:temp projectile merge from entity @s equipment.offhand.components."minecraft.bucket_entity_data"
1010
execute as @e[type=minecraft:pufferfish,tag=gm4_cb_projectile,limit=1,distance=..1] run function gm4_crossbow_cartridges:projectile/arrow_motion
1111

1212
# fish flop sound

gm4_crossbow_cartridges/data/gm4_crossbow_cartridges/function/projectile/bucket/salmon.mcfunction

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
# replace arrow with salmon and copy data
77
summon minecraft:salmon ~ ~ ~ {FromBucket:1b,Tags:["gm4_cb_projectile"],active_effects:[{id:'minecraft:regeneration',amplifier:10,duration:200,show_particles:0b}]}
88

9-
data modify storage gm4_crossbow_cartridges:temp projectile merge from entity @s Inventory[{Slot:-106b}].components."minecraft.bucket_entity_data"
9+
data modify storage gm4_crossbow_cartridges:temp projectile merge from entity @s equipment.offhand.components."minecraft.bucket_entity_data"
1010
execute as @e[type=minecraft:salmon,tag=gm4_cb_projectile,limit=1,distance=..1] run function gm4_crossbow_cartridges:projectile/arrow_motion
1111

1212
# fish flop sound

gm4_crossbow_cartridges/data/gm4_crossbow_cartridges/function/projectile/bucket/tadpole.mcfunction

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
# replace arrow with tadpole and copy data
77
summon minecraft:tadpole ~ ~ ~ {FromBucket:1b,Tags:["gm4_cb_projectile"],active_effects:[{id:'minecraft:regeneration',amplifier:10,duration:200,show_particles:0b}]}
88

9-
data modify storage gm4_crossbow_cartridges:temp projectile merge from entity @s Inventory[{Slot:-106b}].components."minecraft.bucket_entity_data"
9+
data modify storage gm4_crossbow_cartridges:temp projectile merge from entity @s equipment.offhand.components."minecraft.bucket_entity_data"
1010
execute as @e[type=minecraft:tadpole,tag=gm4_cb_projectile,limit=1,distance=..1] run function gm4_crossbow_cartridges:projectile/arrow_motion
1111

1212
# fish flop sound

gm4_crossbow_cartridges/data/gm4_crossbow_cartridges/function/projectile/bucket/tropical.mcfunction

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
# replace arrow with tropical fish and copy data
77
summon minecraft:tropical_fish ~ ~ ~ {FromBucket:1b,Tags:["gm4_cb_projectile"],active_effects:[{id:'minecraft:regeneration',amplifier:10,duration:200,show_particles:0b}]}
88

9-
data modify storage gm4_crossbow_cartridges:temp projectile merge from entity @s Inventory[{Slot:-106b}].components."minecraft.bucket_entity_data"
9+
data modify storage gm4_crossbow_cartridges:temp projectile merge from entity @s equipment.offhand.components."minecraft.bucket_entity_data"
1010
execute as @e[type=minecraft:tropical_fish,tag=gm4_cb_projectile,limit=1,distance=..1] run function gm4_crossbow_cartridges:projectile/arrow_motion
1111

1212
# fish flop sound

gm4_crossbow_cartridges/data/gm4_crossbow_cartridges/function/projectile/potions.mcfunction

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
# run from check_projectile
55

66
tag @s add gm4_cb_use
7-
data modify storage gm4_crossbow_cartridges:temp projectile.Item.components set from entity @s Inventory[{Slot:-106b}].components
7+
data modify storage gm4_crossbow_cartridges:temp projectile.Item.components set from entity @s equipment.offhand.components
88
data modify storage gm4_crossbow_cartridges:temp projectile.Owner set from entity @s UUID
99

1010
# replace arrow with splash/lingering potion and copy data

0 commit comments

Comments
 (0)