24 lines
6.1 KiB
Mcfunction
24 lines
6.1 KiB
Mcfunction
# Desc: Merge instructions for efficiency
|
|
# Called by: ench_merge:merge/merge_*
|
|
# Datapack made by FieryHammer
|
|
|
|
# Checking left item
|
|
execute if entity @e[tag=left_item, nbt={Item:{tag:{Enchantments:[{id:"minecraft:efficiency", lvl:1s}]}}}] if entity @e[tag=right_item, nbt=!{Item:{tag:{Enchantments:[{id:"minecraft:efficiency", lvl:1s}]}}}, nbt=!{Item:{tag:{Enchantments:[{id:"minecraft:efficiency", lvl:2s}]}}}, nbt=!{Item:{tag:{Enchantments:[{id:"minecraft:efficiency", lvl:3s}]}}}, nbt=!{Item:{tag:{Enchantments:[{id:"minecraft:efficiency", lvl:4s}]}}}, nbt=!{Item:{tag:{Enchantments:[{id:"minecraft:efficiency", lvl:5s}]}}}] run data modify entity @e[tag=new_item, limit=1] Item.tag.Enchantments append value {id:"minecraft:efficiency", lvl:1s}
|
|
execute if entity @e[tag=left_item, nbt={Item:{tag:{Enchantments:[{id:"minecraft:efficiency", lvl:2s}]}}}] if entity @e[tag=right_item, nbt=!{Item:{tag:{Enchantments:[{id:"minecraft:efficiency", lvl:2s}]}}}, nbt=!{Item:{tag:{Enchantments:[{id:"minecraft:efficiency", lvl:3s}]}}}, nbt=!{Item:{tag:{Enchantments:[{id:"minecraft:efficiency", lvl:4s}]}}}, nbt=!{Item:{tag:{Enchantments:[{id:"minecraft:efficiency", lvl:5s}]}}}] run data modify entity @e[tag=new_item, limit=1] Item.tag.Enchantments append value {id:"minecraft:efficiency", lvl:2s}
|
|
execute if entity @e[tag=left_item, nbt={Item:{tag:{Enchantments:[{id:"minecraft:efficiency", lvl:3s}]}}}] if entity @e[tag=right_item, nbt=!{Item:{tag:{Enchantments:[{id:"minecraft:efficiency", lvl:3s}]}}}, nbt=!{Item:{tag:{Enchantments:[{id:"minecraft:efficiency", lvl:4s}]}}}, nbt=!{Item:{tag:{Enchantments:[{id:"minecraft:efficiency", lvl:5s}]}}}] run data modify entity @e[tag=new_item, limit=1] Item.tag.Enchantments append value {id:"minecraft:efficiency", lvl:3s}
|
|
execute if entity @e[tag=left_item, nbt={Item:{tag:{Enchantments:[{id:"minecraft:efficiency", lvl:4s}]}}}] if entity @e[tag=right_item, nbt=!{Item:{tag:{Enchantments:[{id:"minecraft:efficiency", lvl:4s}]}}}, nbt=!{Item:{tag:{Enchantments:[{id:"minecraft:efficiency", lvl:5s}]}}}] run data modify entity @e[tag=new_item, limit=1] Item.tag.Enchantments append value {id:"minecraft:efficiency", lvl:4s}
|
|
execute if entity @e[tag=left_item, nbt={Item:{tag:{Enchantments:[{id:"minecraft:efficiency", lvl:5s}]}}}] if entity @e[tag=right_item, nbt=!{Item:{tag:{Enchantments:[{id:"minecraft:efficiency", lvl:5s}]}}}] run data modify entity @e[tag=new_item, limit=1] Item.tag.Enchantments append value {id:"minecraft:efficiency", lvl:5s}
|
|
|
|
# Checking level matching
|
|
execute if entity @e[tag=right_item, nbt={Item:{tag:{Enchantments:[{id:"minecraft:efficiency", lvl:1s}]}}}] if entity @e[tag=left_item, nbt={Item:{tag:{Enchantments:[{id:"minecraft:efficiency", lvl:1s}]}}}] run data modify entity @e[tag=new_item, limit=1] Item.tag.Enchantments append value {id:"minecraft:efficiency", lvl:2s}
|
|
execute if entity @e[tag=right_item, nbt={Item:{tag:{Enchantments:[{id:"minecraft:efficiency", lvl:2s}]}}}] if entity @e[tag=left_item, nbt={Item:{tag:{Enchantments:[{id:"minecraft:efficiency", lvl:2s}]}}}] run data modify entity @e[tag=new_item, limit=1] Item.tag.Enchantments append value {id:"minecraft:efficiency", lvl:3s}
|
|
execute if entity @e[tag=right_item, nbt={Item:{tag:{Enchantments:[{id:"minecraft:efficiency", lvl:3s}]}}}] if entity @e[tag=left_item, nbt={Item:{tag:{Enchantments:[{id:"minecraft:efficiency", lvl:3s}]}}}] run data modify entity @e[tag=new_item, limit=1] Item.tag.Enchantments append value {id:"minecraft:efficiency", lvl:4s}
|
|
execute if entity @e[tag=right_item, nbt={Item:{tag:{Enchantments:[{id:"minecraft:efficiency", lvl:4s}]}}}] if entity @e[tag=left_item, nbt={Item:{tag:{Enchantments:[{id:"minecraft:efficiency", lvl:4s}]}}}] run data modify entity @e[tag=new_item, limit=1] Item.tag.Enchantments append value {id:"minecraft:efficiency", lvl:5s}
|
|
|
|
# Checking right item
|
|
execute if entity @e[tag=right_item, nbt={Item:{tag:{Enchantments:[{id:"minecraft:efficiency", lvl:1s}]}}}] if entity @e[tag=new_item, nbt=!{Item:{tag:{Enchantments:[{id:"minecraft:efficiency", lvl:1s}]}}}, nbt=!{Item:{tag:{Enchantments:[{id:"minecraft:efficiency", lvl:2s}]}}}, nbt=!{Item:{tag:{Enchantments:[{id:"minecraft:efficiency", lvl:3s}]}}}, nbt=!{Item:{tag:{Enchantments:[{id:"minecraft:efficiency", lvl:4s}]}}}, nbt=!{Item:{tag:{Enchantments:[{id:"minecraft:efficiency", lvl:5s}]}}}] run data modify entity @e[tag=new_item, limit=1] Item.tag.Enchantments append value {id:"minecraft:efficiency", lvl:1s}
|
|
execute if entity @e[tag=right_item, nbt={Item:{tag:{Enchantments:[{id:"minecraft:efficiency", lvl:2s}]}}}] if entity @e[tag=new_item, nbt=!{Item:{tag:{Enchantments:[{id:"minecraft:efficiency", lvl:2s}]}}}, nbt=!{Item:{tag:{Enchantments:[{id:"minecraft:efficiency", lvl:3s}]}}}, nbt=!{Item:{tag:{Enchantments:[{id:"minecraft:efficiency", lvl:4s}]}}}, nbt=!{Item:{tag:{Enchantments:[{id:"minecraft:efficiency", lvl:5s}]}}}] run data modify entity @e[tag=new_item, limit=1] Item.tag.Enchantments append value {id:"minecraft:efficiency", lvl:2s}
|
|
execute if entity @e[tag=right_item, nbt={Item:{tag:{Enchantments:[{id:"minecraft:efficiency", lvl:3s}]}}}] if entity @e[tag=new_item, nbt=!{Item:{tag:{Enchantments:[{id:"minecraft:efficiency", lvl:3s}]}}}, nbt=!{Item:{tag:{Enchantments:[{id:"minecraft:efficiency", lvl:4s}]}}}, nbt=!{Item:{tag:{Enchantments:[{id:"minecraft:efficiency", lvl:5s}]}}}] run data modify entity @e[tag=new_item, limit=1] Item.tag.Enchantments append value {id:"minecraft:efficiency", lvl:3s}
|
|
execute if entity @e[tag=right_item, nbt={Item:{tag:{Enchantments:[{id:"minecraft:efficiency", lvl:4s}]}}}] if entity @e[tag=new_item, nbt=!{Item:{tag:{Enchantments:[{id:"minecraft:efficiency", lvl:4s}]}}}, nbt=!{Item:{tag:{Enchantments:[{id:"minecraft:efficiency", lvl:5s}]}}}] run data modify entity @e[tag=new_item, limit=1] Item.tag.Enchantments append value {id:"minecraft:efficiency", lvl:4s}
|
|
execute if entity @e[tag=right_item, nbt={Item:{tag:{Enchantments:[{id:"minecraft:efficiency", lvl:5s}]}}}] if entity @e[tag=new_item, nbt=!{Item:{tag:{Enchantments:[{id:"minecraft:efficiency", lvl:5s}]}}}] run data modify entity @e[tag=new_item, limit=1] Item.tag.Enchantments append value {id:"minecraft:efficiency", lvl:5s}
|