Skip to content

Commit 2f7503f

Browse files
authored
Add offhand support to lib trees (#1223)
1 parent 47c1e94 commit 2f7503f

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

lib_trees/data/gm4_trees/function/sapling/summon_marker.mcfunction

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,16 @@
44
# run from gm4_trees:sapling/place_sapling
55

66
# set up storage to be read from
7+
# mainhand
78
data modify storage gm4_trees:temp sapling.type set from entity @s SelectedItem.components."minecraft:custom_data".gm4_trees.item.type
89
## backwards compatibility with old items
910
execute unless data storage gm4_trees:temp sapling run data modify storage gm4_trees:temp sapling.type set from entity @s SelectedItem.components."minecraft:custom_data".gm4_fruiting_trees.item.type
1011

12+
# offhand
13+
execute unless data storage gm4_trees:temp sapling run data modify storage gm4_trees:temp sapling.type set from entity @s equipment.offhand.components."minecraft:custom_data".gm4_trees.item.type
14+
## backwards compatibility with old items
15+
execute unless data storage gm4_trees:temp sapling run data modify storage gm4_trees:temp sapling.type set from entity @s equipment.offhand.components."minecraft:custom_data".gm4_fruiting_trees.item.type
16+
1117
# call initialize function so other modules can add their markers
1218
# | NOTE positioned ~.5 ~.5 ~.5 to not break data packs that relied on this behavior of old versions of this library
1319
execute positioned ~.5 ~.5 ~.5 run function #gm4_trees:initialize_sapling

0 commit comments

Comments
 (0)