Started by
Real_bizzy
on
Topic category: Help with Minecraft modding (Java Edition)
Hey guys, I wanted to make an enchantment similar to protection but it reduces damage from frost, but I can't seem to find a way to make this, may somebody please help? (Sorry if the answer is obvious i just returned to mcreator after half a year)
still need help with this
I have the same problem, did you manage to figure it out?
sorry for the late reply but no sadly
Other than doing this with custom code I haven't found this out yet. If you would be interested for the code, reply ig
i dont know how to use code :sob: otherwise id take it
Unfortunately, I don't know how to do it with base mcreator
However, using Snails Plugins, you can easily do this:
Make a new procedure and change the global procedure to "entity attacked"

Check if the entity has armor on that has your enchantment (0 is helmet, 1 is chest, 2 is leggings, and 3 is boots)
Then, check if the damage the entity has received is the type of damage you want to be reduced (I have freeze here)
Afterwards, using the set value block in the advanced tab from Snails Plugins, you can set the resulting damage to the "amount" the entity takes divided by the level of the enchantment multiplied by 1+[whatever amount you want it reduced by]
For example, I have it so where every level of said enchantment will reduce the damage by 10% for level 1, but 55% for level 2. If you want these to be more linear, mess around with math procedures to get a specific amount
tysm! idm using plugins so i will definetely use this!
i only just found out its not for 2026.1 :sob:
i think you could make a procedure to check if the player is being frost damaged, and provide immunity to it or just deal like, 50% damage
I think that the ability to set the value of certain global procedure triggers (including damage done) was recently added to core MCreator, so you might not need a plugin with 2026.1 although I could be mistaken.
i mainly dont know how to do the damage immunity part :p