How to get potion effect maximum amplifier

Discussion in 'Plugin Development' started by TehHypnoz, May 25, 2015.

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

    TehHypnoz

    So I'm trying to find a way to get the highest amplifier for a potion (for example: speed 2 is the highest amplifier for speed that you can get without cheating). With enchantments there is Enchantment#getMaxLevel(), but I can't find anything like that for potions.
     
  2. Offline

    CrystallFTW

  3. Offline

    TehHypnoz

    That's not what I mean, I want to get the highest possible amplifier that you can get in vanilla Minecraft, so without mods/cheating/plugins.
     
  4. Offline

    HenkDeKipGaming

    it's possible with commandblocks.... but i don't know how to do that
    i just know that, if you don't want to use plugins, you could use command blocks.
     
  5. Offline

    I Al Istannen

    @TehHypnoz You could make a Map, mapping all PotionEffectTypes to their max level. But, every potion i know goes to either 2 or it's effect stays the same with lvl 1 or 2. Why do you need this?
     
  6. Offline

    TehHypnoz

    I'm working on a plugin that is used to limit the highest level of potion effects you can get. I want to generate a config containing the name of the potion effect + their maximum amplifier. Example of how I did it in my enchantment limiting plugin:

    Code:
    for (Enchantment ench : Enchantment.values()) {
         getConfig().addDefault(ench.getName(), ench.getMaxLevel());
    }
    
    I need to implement this in a plugin.

    EDIT by Timtower: merged posts
     
    Last edited by a moderator: May 26, 2015
  7. Offline

    HenkDeKipGaming

    but you just said you wanted to to this without plugins...
     
  8. Offline

    I Al Istannen

    @TehHypnoz I don't know any method that does this, i would go for an Map with the potionEffectTypes as key and their max level as value.
     
  9. Offline

    TehHypnoz

    No, I want to get the highest amplifier you can get in vanilla minecraft in my plugin.

    Okay, I'll try that then.

    EDIT by Timtower: merged posts
     
    Last edited by a moderator: May 26, 2015
Thread Status:
Not open for further replies.

Share This Page