Started by
ZSorcer19
on
Topic category: Help with Minecraft modding (Java Edition)
So I'm trying to make a procedure that checks if the entity killed is a Guardian and if it is then it checks the item in the main-hand of the player for a specific enchantment. If both conditions are true then I want it to drop a custom item. I've tried multiple methods to get it to work and I have yet to find anything that works.
event/target entity is an entity who dies i.e. guardian
Your mistake: your conditions means that when guardian dies his weapon in main-hand must have your enchantment
How to fix: Your second condition should be linked to the one who made entity die i.e source entity. You can find source entity in minecraft components. Put it instead of event/target entity in second condition.
(P.s. when doing conditions instead of doing multiple ifdo you can just place blue thing from logic (it has same color as ifdo) and select AND instead of = and with right mouse button do external inputs. Thats will be easier to understand what you doing)
Thank you so much, it works now :D