How to modify exp to level?

Discussion in 'Plugin Development' started by ComeFme, Aug 28, 2015.

?

How to modify experiance

  1. codes/method

    0 vote(s)
    0.0%
  2. plugins

    0 vote(s)
    0.0%
Multiple votes are allowed.
Thread Status:
Not open for further replies.
  1. Offline

    ComeFme

    Hello, I am currently wondering how can I edit how much exp player needs to level. What kind of method can I use? People please help me abit, thx!

    Also I created a map already, but how can I get it work?
    Code:
        public void onEnable(){
            getLogger().info("MyEvents has been activated!");
            Bukkit.getServer().getPluginManager().registerEvents((Listener) this, this);
            expLevelMap = new HashMap<Integer, Integer>();
            expLevelMap.put(Integer.valueOf(1), Integer.valueOf(45));
            expLevelMap.put(Integer.valueOf(2), Integer.valueOf(100));
            expLevelMap.put(Integer.valueOf(3), Integer.valueOf(160));
            expLevelMap.put(Integer.valueOf(4), Integer.valueOf(230));
            expLevelMap.put(Integer.valueOf(5), Integer.valueOf(310));
            expLevelMap.put(Integer.valueOf(6), Integer.valueOf(400));
            expLevelMap.put(Integer.valueOf(7), Integer.valueOf(500));
            expLevelMap.put(Integer.valueOf(8), Integer.valueOf(600));
            expLevelMap.put(Integer.valueOf(9), Integer.valueOf(710));
            expLevelMap.put(Integer.valueOf(10), Integer.valueOf(830));
            expLevelMap.put(Integer.valueOf(11), Integer.valueOf(960));
            expLevelMap.put(Integer.valueOf(12), Integer.valueOf(1100));
            expLevelMap.put(Integer.valueOf(13), Integer.valueOf(1260));
            expLevelMap.put(Integer.valueOf(14), Integer.valueOf(1440));
            expLevelMap.put(Integer.valueOf(15), Integer.valueOf(1640));
            expLevelMap.put(Integer.valueOf(16), Integer.valueOf(1860));
            expLevelMap.put(Integer.valueOf(17), Integer.valueOf(2100));
            expLevelMap.put(Integer.valueOf(18), Integer.valueOf(2380));
            expLevelMap.put(Integer.valueOf(19), Integer.valueOf(2720));
            expLevelMap.put(Integer.valueOf(20), Integer.valueOf(3140));
    
        }
     
    Last edited: Aug 28, 2015
  2. Offline

    mrgreen33gamer

    What are you trying to do again? Are you trying to check for a certain amount of EXP and a certain LVL to do something?
     
  3. Offline

    ComeFme

    I am trying to change how much exp player needs for each level. For example, it needs 17 exp to level from 1 to 2, how can I change the number 17 in this case? I just want to make it for my RPG server.
     
  4. Offline

    mrgreen33gamer

    If you're trying to change the EXP level amount below to level up, that's possible. I'm not sure about making anything above 17 total exp to get a level from 1 - 2. There might be a packet, but I'm not sure.

    But I did find this while I was coding:

    Code:java
    1. player.getExpToLevel();
     
  5. Offline

    ComeFme

    Yes, but the code there can only get the amount but not setting it. Q_Q Thanks anyway.
     
Thread Status:
Not open for further replies.

Share This Page