Solved Making an enchantment table full power

Discussion in 'Plugin Development' started by JoshArgent, Jun 7, 2014.

Thread Status:
Not open for further replies.
  1. Offline

    JoshArgent

    Hi,

    I'm trying to make a feature in my plugin which will make all enchantment tables (with or without bookcases) full power, ie. able to do level 30 enchantments.

    Anyone had any experience with this before? I'm really stumped at where to start with this one.

    - Josh
     
  2. Offline

    HeadGam3z

    JoshArgent likes this.
  3. Offline

    JoshArgent

  4. Offline

    xTigerRebornx

    JoshArgent likes this.
  5. Offline

    JoshArgent

  6. Offline

    xTigerRebornx

    JoshArgent It states that you are able to modify the values of the offered enchantment levels. You can modify that Array as you please, and it looks like it would allow you to modify what you want. Ill look into it a little, and send you some results, but I suggest you do the same, debug.

    JoshArgent After testing I got results along the lines of this
    http://prntscr.com/3qmt09
    Using:
    Code:
    @EventHandler
        public void onEnchant(PrepareItemEnchantEvent event){
            for(int i = 0; i<event.getExpLevelCostsOffered().length; i++){
                event.getExpLevelCostsOffered()[i] = 30;
            }
        }
    You can effectively use the int[] to replace the levels offered, and I'm sure you could use some algorithm to simulate vanilla enchants

    There are probably other ways of doing this, but this one is fun :p

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Nov 2, 2016
    JoshArgent likes this.
  7. Offline

    JoshArgent

    Thank you very much. I appreciate your help with this one. :)
     
Thread Status:
Not open for further replies.

Share This Page