Limiting weapon enchantments count

Started by TeamGustavKlara on

Topic category: Help with MCreator software

Last seen on 20:19, 7. Dec 2020
Joined Sep 2018
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Limiting weapon enchantments count

I want to make a weapon that supports multiple different custom enchantments, but can only have one enchantment on it at a time. So if i enchanted the weapon with an enchantment, that weapon could no longer be enchanted with any other enchantments. I don't see any way of doing this, other then something with the "can be applied with" and setting that to something that doesnt exist.

Last seen on 14:43, 2. Aug 2022
Joined Nov 2018
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
@Override         protected…
Sun, 12/06/2020 - 12:43

@Override
        protected boolean canApplyTogether(Enchantment ench) {
         
            if (!(ench == ThunderingEnchantment.enchantment))
                return true;
            return false;
        }

You can edit the enchantment code to make it so if the enchantment is not thundering you can apply the enchantment.

Just change the name of ThunderingEnchantment to whatever your enchantment is called + "Enchantment.enchantment"