Leveling System

Discussion in 'Plugin Requests' started by AlwaysAllstar, Feb 23, 2020.

  1. Online

    AlwaysAllstar

    Plugin category: Levels

    Minecraft version: 1.14

    Suggested name: LevelSystem

    What I want: I know there's some player leveling systems out there, but most of them require a permission plugin for groups, don't have some features I need, and are just extremely large with many extra features.

    I need a plugin where a player gains experience/XP (not vanilla Minecraft experience in the bar at the bottom of the screen) by doing certain tasks and then levels up once enough experience is gained. This might be easier thought of as a point system where once enough points are gained from doing a variety of tasks/events, the player is leveled up. I will refer to everything below as experience, but keep in mind it is not vanilla Minecraft experience but more like points. No rewards are needed and I want it so I don't have to create groups with my permissions plugin, each level just has a prefix I can give to the players names through placeholders and my chat plugin. This plugin isn't supposed to reward players, it's more of a system to show how experienced the player is.

    Events that give experience:
    Player kills
    Opening a trapped chest (and stops receiving experience from that trapped chest until X amount of time has passed)
    Mob kills (Specifically Zombie Pigman)
    You can add more if you have any in mind, these are the only ones I need though.

    I want to be able to edit the experience given from these events. Maybe something like this:

    Experience:
    #Amount of experience given per each event
    playerKill: 2
    trappedChest: 1
    #How much time must pass (in minutes) before being able to receive another 1 experience from the same trapped chest
    resetExperience: 30
    mobs:
    #Amount of experience given per each specific mob kill (If you only add compatibility for zombie pigman, it'll work for my needs).
    zombie_pigman: 1

    I should also be able to define the levels (this could be the config). Again, it does not need to have groups in a different plugin. An example would look like this:

    Levels:
    #New players start at 1.
    1:
    #How much experience is needed until leveling up to 2
    experience: 10
    #Prefix of players at this level. Color codes are accepted
    prefix: &6&l[&fNoob&6&l]

    2:
    #How much experience is needed until leveling up to 3
    experience: 20
    #Prefix of players at this level. Color codes are accepted
    prefix: &6&l[&fPlayer&6&l]

    3:
    #How much experience is needed until leveling up to 4
    experience: 30
    #Prefix of players at this level. Color codes are accepted
    prefix: &6&l[&fAdvanced&6&l]

    I think it would probably be best if a players experience resets after each time they level up. So if I gain 10 experience and level up to 2, my experience resets to 0 and now I have to gain 20 more experience to level up again to level 3.

    Also, if a player is at level 2 with 19 experience and they do a task worth 2 experience. They should level up to three and have one experience. Basically although experience resets, if a player goes over the required amount it will transfer over (this is also shown in the command listed down below).

    And then there's the file where it stores all players' levels. You can do this however you please or think is most efficient. Keep in mind players start off at level 1. So you could do it so when a player joins for the first time they're then stored into the file as level 1, or just have it so everyone is a level 1 unless defined otherwise in this file. It's up to you really.

    Placeholders are also needed. I should note I have PlaceHolderAPI. Here are a list of PlaceHolders I have in mind:
    %LSlevel% - Returns the level of that player (an integer). These are the numbers 1, 2, and 3 in the example config.
    %LSPrefix% - Returns the player's prefix as defined in the config.
    %LSPercent% - Returns the percentage a player is to leveling up. For example, if I'm level 1 with 5 experience (going off of the example Levels/config file) this should return 50%. If I'm level 2 with 15 experience, it would return 75%. In the case of a decimal, round it to the tenths place to be, for example, 60.6% rather than 60.6666666.
    %LSExperience% - Returns how much experience a player currently has.
    %LSExperienceNeeded% - Returns how much experience is needed for the next level up. For example, if I'm level 2 this would return 20 (based off of the example config).

    Ideas for commands: /LSXP give <player> <experience amount> - Gives a player an amount of experience. If it exceeds the amount required for the next level up, it should transfer over until can no longer level up. For example, if I'm level one with 0 experience and I'm given 35 experience, I should then be level 3 with 5 experience.

    Ideas for permissions: No permissions needed. Everyone can gain experience from everything and only OPs can do the command listed above.

    When I'd like it by: This is a pretty lengthy and complex plugin, so feel free to take your time. :)
     
  2. Offline

    EpicGodMC

    Please clarifi how the prefix would work, should vault be used is it a second prefix idk, might make this for u

    EDIT: also i dont quite understand the trapped chest event while the chest is open the player should get exp untill X amount of time has passed?
     
    Last edited: Feb 26, 2020
  3. Online

    AlwaysAllstar

    @EpicGodMC I was thinking the prefix would just be what would comes out of the placeholder %LSPrefix%. So this plugin won’t be displaying the prefix in any way, it’s just there to be able to use the placeholder %LSPrefix% in a different chat managing plugin. As for the trapped chest event, my game features a map with trapped chests scattered around the map that have loot in it. When a player opens a chest and takes the loot, it will reset with more randomized loot in 30 minutes. My plan for this is so when a player loots a trapped chest they will earn xp towards leveling up. The reason I have the time passed thing is so people can’t open and close a chest repeatedly and get a ton of xp (basically it’s cheat proof). This way I can have it so a player loots a chest and also gets xp towards leveling up but can’t just get an infinite amount of xp by standing and repeatedly opening the same chest over and over.
     
  4. Offline

    EpicGodMC

    @AlwaysAllstar so essentialy they get xp and shoulnt get xp untill new items have been spawned right,
    a simple solution to this would be to make a custom item spawn in the chest which they can redeem for the xp
    this way it will always sync up perfectly, or i could make a cooldown system which will be more resource intensive
    but would also work pretty well but you would have a chance of the timings not syncing up together
     
  5. Online

    AlwaysAllstar

    @EpicGodMC Turns out I completely overlooked a feature of the plugin I'm using for the loot generation. I am actually able to run commands every time a player opens a trapped chest. So this way as long as I have the command '/LSXP give <player> <experience amount>' like I said in the post I'll be able to do what I want, nothing needs to be done with trapped chests in this plugin. The command will act like the loot so when a player opens it, it'll run the command to give them experience and it won't run the command again until the time has passed just like the loot. So you can basically ignore everything with trapped chests giving experience really and just do players, zombie pigman, and anything else you may want to add. I'm very sorry I didn't see this sooner.
     
  6. Online

    AlwaysAllstar

  7. Offline

    EpicGodMC

    I can but i dont have alot of time right now so it would take a while
     
  8. Online

    AlwaysAllstar

    Alright no worries. :)
     
  9. Online

    AlwaysAllstar

    @EpicGodMC just checking in to see if you've started. :)
     
  10. Offline

    EpicGodMC

    i have @AlwaysAllstar but i just dont progress too quikly becouse i dont have alot of time right now
     
    AlwaysAllstar likes this.
  11. Online

    AlwaysAllstar

  12. Offline

    EpicGodMC

    @AlwaysAllstar pretty decent but still not progressing too quicky as i cant work for too long on this project at a time
    hope you can understand that, might post some progress later
     
  13. Online

    AlwaysAllstar

    I completely understand, thank you. :)
     
  14. Online

    AlwaysAllstar

Share This Page