Started by
zorex73
on
Topic category: Help with Minecraft modding (Java Edition)
I making a mod that you spend exp to get an item by pressing a key binding. This works fine, but if I have no exp it still triggers the procedure giving me the item. I just need help finding out how to set a requirement for minimum exp.
Probably the easiest method is to just check for a certain experience level. You can easily check a player's current level, or the amount of EXP points they have towards their next level, but not the overall current number of EXP points they have.
If you wanted to check for a minimum of 100 EXP you could check for level 8 which requires a minimum of 112 EXP which in most cases is plenty close enough.
but how do I check?
Flow control tab --> If / Do block
Logic tab --> purple Math compare block
Player procedures --> Get XP level of target entity block
Math tab --> Number value block
IF: XP level > 7
Do: <your procedure>