Enchantment check if damaging entity is arrow
I'm trying to make an Enchantment that has a chance of summoning a lightning bolt at the victim. I have a "hit_block" effect, and i only want that to trigger when the damaging entity is an arrow (so that you can't just mine a block with the bow and summon the lightning), but for some reason Minecraft says there is an error when trying to load into the world, but misode and spyglass (VSCode plugin) say there is none. What am i missing?
"description": "Lightning Strike", "supported_items": [ "minecraft:bow", "minecraft:crossbow", "minecraft:golden_sword" ], "primary_items": [], "weight": 1, "max_level": 1, "min_cost": { "base": 0, "per_level_above_first": 0 }, "max_cost": { "base": 0, "per_level_above_first": 0 }, "anvil_cost": 0, "slots": [ "mainhand" ], "effects": { "minecraft:hit_block": [ { "requirements": [ { "condition": "minecraft:damage_source_properties", "predicate": { "direct_entity": { "type": "#minecraft:arrows" }, "is_direct": false } }, { "condition": "minecraft:random_chance", "chance": { "type": "minecraft:constant", "value": 0.25 } } ], "effect": { "type": "minecraft:summon_entity", "entity": "minecraft:lightning_bolt" } } ], "minecraft:post_attack": [ { "requirements": { "condition": "minecraft:random_chance", "chance": { "type": "minecraft:constant", "value": 0.25 } }, "effect": { "type": "minecraft:summon_entity", "entity": "minecraft:lightning_bolt" }, "enchanted": "attacker", "affected": "victim" } ] } }```