Started by
Xyon
on
Topic category: Help with modding (Java Edition)
Im using Mcreator version 2024.2, I have seen a tutorial on how to do this on a different forum however, on this version there isn't a trigger for when the player kills a mob. I need help and would appreciate it if anybody would tell me how to make it work.
This should work
You can replace the 2 with a different number to increase/decrease the amount of health healed
(You don't need to put this in any of the item's triggers, because you just need to select "Entity dies" in the global trigger)
Thank you!
Your welcome :D
It doesn’t work! ..well sorta, with the code it just heals the player even if the player doesn’t have the tool or used the tool to kill the mob. How can I fix this? I tried to fix it by making it check if the user has the tool in the backpack AND has it in its hand. However, this did not fix it either.
If you're checking both the backpack and the hand, that means you need the tool in your backpack and in your hand, or it will not work. I would assume that's unintentional? Change the AND to OR maybe?
Eh still does not work, for reference this is how the code is as of rn![](https://postimg.cc/9z42B868)
https://imgur.com/vdsHCym replace the trident with your item
That worked! Thank you and everybody for helping me!