XP with ,

Discussion in 'Spigot Plugin Development' started by Nighterance, May 1, 2017.

  1. Hello!
    So I am making a plugin, and I need to add players expirience with that are not round numbers, so I need to add 0.653 or 1.543 or 1.22 expirience, depending on a command. Is it possible to do?

    Or if this is not possible to do, is it possible to extend how much xp is needed to levelup?
     
  2. The xp bar goes from 0-1 are you trying to set it to specific points On the bar? 1.22 will be a bar that is oversized.


    Sent from my iPhone using Tapatalk
     

  3. No, I mean that I am using that exp bar as custom for my plugin.
    I am using those regular xp needed to levelup ( [level1]-->[level2] needs 9exp)ect

    Is it possible to make that level system as float and then make so when it is 1 then it levelups player?
     
  4. You could create your own variable per player, and make that a float whenever xp is earned add whatever amount to your xp variable you wish and cancel the xp earned / stored by the server. When enough of your xp is earned move the bar by setting the xp, then when enough is earned to level add one to the players level.


    Sent from my iPhone using Tapatalk
     
  5. So I store in external file for example

    XP
    Player
    Earned : 0.15

    Then On main class I make a check, if player has value, that is solid, for example 1.54, it gives player 1xp, and with bukkit scheduler updates it all the time?
     
  6. You could just have it update when the player earns xp no need for a scheduled task to check something that may not be changing.


    Sent from my iPhone using Tapatalk
     
  7. So I make that getexp as function, that runs whenever player gets that exp, and there include that it grabs it out?
    And what would be best way? Whenever player has 1 .(anything), it gives player 1xp and then removes 1 from config?
     
  8. I think most things except the enderdragon give 1-20 xp you could figure out how much of one minecraft xp you want your xp to count for.

    Like if you wanted your xp to be 1/10 of a minecraft xp point the. Simply create a float variable in the event that did event.getXp()/10;

    Save that variable set the events xp to zero


    Sent from my iPhone using Tapatalk
     

  9. No, i disabled all exp to get from outside, only you can get it from command, that executes when you do other thing. So basically console executes that command to give player xp.
     
  10. Okay so since normal xp is disabled you can simply set the bar and levels to match your system. When x xp has been earned set it to the appropriate level


    Sent from my iPhone using Tapatalk
     
  11. Just use the exp bar as an info output, you can have your own exp tables and then you simply display that info on the exp bar.