Started by
Teapot5000
on
Topic category: Help with modding (Java Edition)
Since Mcreator does not have any global trigger when an item is enchanted, does anyone know a way procedure to do this? I just want to make another sharpness enchantment without using potion effects or modifiying the damage when an entity is attacked./damaged.
I vaguely remember there's a plugin that adds some additional triggers for enchanting, using an anvil, etc; but I don't recall the name. If you wanted to brute force it, you can also check every item in the player's inventory for an enchanted item using an itemstack iterator.
yea its built in omg I found the image button lmaooo! ok so basically make a procedure like this:
you could also measure this and make sure its above level zero like this:
idk what the a thing is about when I uploaded this but just have this run inside a for each item in inventory thing or if your item is custom you can do it on item tick!
yeah I think an entity tick iterator will fix it but at the same time will lag a lot since a lot of enchantments are being checked every time and for every item
isnt there a way to get this done by any other way?
also because you asked and I dont wanna spam that other thread more here is how I do attributes:
you gatta make sure the spacing is right and stuff if you are unsure just run the command in a send message to player or print until you get it right, spacings really matter! gl!
you would be surprised how much minecraft can do but you can also make it run on "player xp level changes" which would work perfectly and good call on looking for optimizations
Yeah, xp level changes might work, but just keep in mind it might also trigger on death, or from any other mods that drain XP for one reason or another. (And, uh, also that xp level changes includes gaining XP, so you might need a separate player variable to track the player's last xp level so you only trigger when their xp has gone down, not up.)