Predicates in a bow enchantment's hit_block effect component
I am trying to make an enchantment for a bow which does some things through a function, which is triggered when an entity OR a block is hit. I've got the hitting an entity part working, but I am facing a problem with the hitting a block part.
The problem stems from the fact that the effect differs depending on the level of this enchantment. For hitting an entity, a predicate like this worked:
"requirements": { "condition": "minecraft:entity_properties", "entity": "attacker", "predicate": { "equipment": { "mainhand": { "items": "minecraft:bow", "predicates": { "enchantments": [ { "enchantments": "lqe:smoke", "levels": 1 } ] } } } } }This same approach won't exactly work for hitting a block, though. There is no attacker entity in the conext of the
hit_blockcomponent. As far as I can tell, my only option for the entity isthisbut that would mean the predicate is checking whether the arrow projectile itself is holding a bow with the enchantment. Is there any way I can check if the player firing the arrow has the enchantment with the specified level?