Jump to content
  • 0

Custom Enchant System.


Question

Posted (edited)
if(blessedScroll){
                        item.setEnchantLevel(Config.BREAK_ENCHANT);
                        item.updateDatabase();
                    }else if(crystalScroll){
                        item.setEnchantLevel(Config.CRYSTAL_ENCHANT_MIN);
                        item.updateDatabase();

 

 

So I found some topics about custom enchant system but not what I want to do.

 

I want the bless /crystals when the enchant fails , the item's enchantment to not change.

 

If I enchant a +16 bow and fails then it stays +16.

Edited by sotid

2 answers to this question

Recommended Posts

  • 0
Posted
item.setEnchantLevel(item.getEnchantLevel())

 

or simply do nothing inside brackets, no code, no actions.

  • 0
Posted (edited)
if(blessedScroll){
                        item.setEnchantLevel(item.getEnchantLevel());
                        item.updateDatabase();
                    }else if(crystalScroll){
                        item.setEnchantLevel(item.getEnchantLevel());
                        item.updateDatabase();

 

Thanks SweeTs once again, works perfectly :)

 

You can lock it.

Edited by sotid
Guest
This topic is now closed to further replies.
×
×
  • Create New...