Started by
trevor050
on
Topic category: Help with Minecraft modding (Java Edition)
So I have a ranged throwable that can have an enchantment. When my ranged item collides with an entity I want it to:
Check if the throwable has the enchantment, apply an effect to the entity it hits. The issue is that provided itemstack is the only way I know how to check if an item has an enchantment but its a part of "When Projectile Hits Living Entity". So how could I do this?
You could try converting the entity into an itemstack entity with one of the conversion functions? I'm honestly not sure how you'd do this with a throwable item.
...If you want some weirder workarounds though, when the player throws the item, you could give it an infinite potion effect if it's enchanted, (like unluck), and then do something different in your procedure if the throwable entity has unluck. (You would likely need to code in a custom throw event though, firing a projectile when the entity right clicks your item, as I'm not sure the built in trigger would support this.)