Equipment level requirement

Discussion in 'Archived: Plugin Requests' started by Macaron, Aug 31, 2014.

  1. Offline

    Macaron

    Plugin category: Role playing, admin,

    Suggested name: level requirement

    What I want: It is basically a plugin that adds level requirement for a specific item depending on its lore. If the player's XP level does not meet the requirement, he or she cannot use it.
    • The plugin tries to find a line of lore named "Level: X" in the item the player's holding when he or she clicks (both left and right click).
    • When the event is triggered, check the player's XP level. If it is greater or equal the X in the lore, the player can use it so nothing happens.
    • When the player's XP level is less than the X number, cancel the event. If that is glitchy, then just move the item to another slot. (example: a level 1 player right clicks with a level 2 sword(a sword with a line of lore named "Level: 2"))

    Ideas for commands: Not needed.

    Ideas for permissions:
    • levelrequirement.bypass: bypass the requirement.
    • levelrequirement.1: player with this permission can use an equipment that requires one level more than his current level (not necessary)

    When I'd like it by: no rush.
     
  2. Hello I created a plugin such like you want.
    I don't had much time so let's call it an Alpha version. There are some little differences as in your Request.
    • I added an Command so its much easier to add an item. Usage /lvlrq add <level> this will add the item in your hand to the config with the right name. The level-argument says which level is required to use this item. To use this command you need to be OP.
    • In the config you can enable different "parts" of the plugin. I recommend to set "enableInventoryCheck" to false because it checks whether you clicked in the inventory and cancel this -> no chance to get the item out of your inventory, but it suppresses that you can wear armor which have a level requirement. I will tell you when I fixed this. The other parts are working very well, so you can enable them without any problems.
    • Next thing is that the Lore is set a little bit different as you requested. In the first line stands "Required level to use:" and in the second stands the required level. Will fix this, too!
    • And last but not least the levelrequirement.1 permission isn't included yet (the other on is)
    I will contact you when i did some updates. And you can contact me if you have any Questions.
    Hope you can understand my Bavarian-English :D

    https://www.dropbox.com/s/1ooj56qm5xpcx3r/LevelRequirement.jar?dl=0
     
  3. Offline

    Macaron



    Many thanks! I will test it out right away :D

    manimax3
    Yep it works. But since I'm building a server with crackshot, left clicking still can trigger the gun even if the damaging event is cancelled. It would be appreciated if you can just move the item to another open slot. It makes the player really hard to use the weapon in combat.
    Plus, what the lore says is not my concern, but can you make them sits on the same line...? Many of the items has many lores already so I want to keep them from getting messy...Here is an example I found:
    https://forums.bukkit.org/threads/level-requirements-for-items-c.288255/
    (It has everything I wanted, excepts moving the item around...)

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Jun 10, 2016
  4. Macaron
    Okay Plugin is updated.
    • Added new Config Option "enableMoveInventory" which moves the item to the next free slot or drops it if the inventory is full.
    • Updated Lore: Will only use one Line and is always in the last line (so it doesnt override the lores of other plugins)
    • if "enableMoveInventory" is enabled crackshot guns cant be used however grenades still can be used once and after that the whole stack of grenades disapear (no idea how to fix)
    When i get more time i will make the plugin more configurable. Let me know if you find a bug.
    Download: https://www.dropbox.com/s/1ooj56qm5xpcx3r/LevelRequirement.jar?dl=0
     
  5. Offline

    Macaron

    manimax3

    Thanks, it works! :D (Only for the /lvlrq part though)
    However, I still can't figured out how the lore works. Something looks like this? (Please ignore the Chinese part lol)
    [​IMG]
    (I putted "Required level to use: 10" at the last line, if you can't see the picture.)
    Or could you tell me the correct format of the lore?
     
  6. Macaron
    The Plugin doesn't read from the Lore. It uses only the config so you have to use the command or add it manually to the config. Then if a entry is present the plugin adds the Lore automatically to the last line with the format "Req. Lvl: <level>" Working with the Lore is very tricky and causes often Errors. So reading from the Lore isn't really usefull. If you want i'll change to reading from Lore but cant promise that you don't get any problems and bugs.
     
  7. Offline

    Macaron

    manimax3
    Just typing /lvlrq add 5 does add the restriction for the minecraft item, but since I need the same minecraft item for different guns with different level requirement.
    Reading lore is the only way I can think out of, but if you have any other ideas, feel free to let me know. (Crackshot constantly changes the name of the item to display ammo, so I personally don't think reading name is a good idea though.)
     
  8. Offline

    Macaron

    manimax3 I don't wanna rush you...but have you got any progress? :D
     

Share This Page