You can now make actions run only if the item in the player's main hand has certain enchants! To do this, just use ifItemEnchants like so:
Code (YAML):
ifItemEnchants
:
# Only run if the item has the fortune enchantment at a level ABOVE 1
"minecraft:FORTUNE"
:
"> 1"
# AND Only run if the item has a silk touch enchantment at a level LESS THAN OR EQUAL TO 2
"minecraft:SILK_TOUCH"
:
"<= 2"
# AND Only run if the item has a sharpness enchantment at level 0 (doesn't have the enchantment)
"minecraft:SHARPNESS"
:
"= 0"