minecraft-datapacks/datapacks/enchantment merger/data/ench_merger/functions/merge/check_crossbow.mcfunction

10 lines
867 B
Mcfunction
Raw Normal View History

# Desc: Checks the conditions for crossbow merging and runs the merge if possible
# Called by: ench_merger:merge/check_all
# Datapack made by FieryHammer
execute at @e[tag=fh_merger] run execute store result score @p[distance=..5] fh_em_level run experience query @p[distance=..5] levels
execute at @e[tag=fh_merger] if score @p[distance=..5] fh_em_level matches 15.. if block ~ ~1 ~ minecraft:dropper[facing=up, triggered=false]{Items:[{Slot:3b, id:"minecraft:crossbow"}, {Slot:5b, id:"minecraft:crossbow"}]} run tag @e[tag=fh_merger, limit=1, sort=nearest] add fh_merger_active
execute at @e[tag=fh_merger_active] if score @p[distance=..5] fh_em_level matches 15.. if block ~ ~1 ~ minecraft:dropper[facing=up, triggered=false]{Items:[{Slot:3b, id:"minecraft:crossbow"}, {Slot:5b, id:"minecraft:crossbow"}]} run function ench_merger:merge/merge_crossbow