Started by
Hurricane_FNaF
on
Topic category: Help with Minecraft modding (Java Edition)
So, i want to make an item that, when in your inventory (the slot doesnt matter), makes you recieve more XP from killing any mobs, is it possible? and if so, can anyone tell me how to do it?
Edited by Hurricane_FNaF on Sun, 02/18/2024 - 02:43
Make a procedure with the global trigger 'when entity attacked.' This provides 'ammount' as one of the dependencies available for you to use. (The ammount of damage being dealt.) Have the procedure check if the attacker, (the source entity), is a player, and if the amount of damage dealt is greater than the victim, (the event/target entity's) current health.
If both these conditions are true, run an itemstack iterator that checks each slot of their inventory for your custom item. If it finds the custom item, spawn some XP orbs at the x/y/z position of the source entity. (Probably more, depending on the level of the enchantment, which you can also reference.)