Filled RedeemPerks

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

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


    Plugin category: Perks

    Minecraft version: 1.14

    Suggested name: RedeemPerks

    What I want: A plugin where you can run commands upon a player redeeming a perk by holding and right clicking an item. I thought I'd be able to find a plugin like this pretty easily, but I haven't been able to find any. If you know of one let me know please!


    Item: <What item the perks are displayed as (Like a book)>

    <Perk name>:
    Name: <Item in game display name with this perk>
    - <Lore of item with this perk>
    - <Lore of item with this perk>
    - <Lore of item with this perk>
    - <Command>
    - <Command>
    - <Command>
    <Perk name>:
    Name: <Item in game display name with this perk>
    - <Lore of item with this perk>
    - <Lore of item with this perk>
    - <Lore of item with this perk>
    - <Command>
    - <Command>
    - <Command>

    Prefix: <Prefix>
    Redeem: <Message shown to player when they redeem a perk>

    Please add color support and placeholders like <user> and <perk>.
    <User> - To use in commands for something like 'give <user> 1 diamond'
    <Perk> - To use in the redeem message for something like 'You redeemed the <perk>!' (Should show the display name used on the item, not the name of the perk in the config)

    EDIT: I edited the config to show what I meant by having the lore be multiple times as I said in one of my replies.

    Ideas for commands: /perk get <Perk Name> - For an owner/admin to actually receive the item in game.

    Ideas for permissions: perk.get - Allows command above; anyone will be able to redeem any perk

    When I'd like it by: As soon as possible :)
    Last edited: Feb 16, 2020
  2. Offline


  3. Offline


    I have created your plugin-wish in about 2 hours. Even small plugins require bugtesting and cleaning-up code.
    There are some things I want you to remember before tooling around with it (That is why I provided an example config.yml that should help you create your own (Best would be to just modify this one).

    Java is case-sensitive in every context, so you have to write Item,Perks,Lang,Prefix,Redeem,Name,Lore,Commands in the way they are in the example. Also, the spacing has to be the exact same (4 spacebars and one for the command list)

    <User> can only be used in commands and has to be written this exact same way.
    <Perk> can only be used in the message and has to be written this exact same way

    Coloring can be accessed via using § and then a specific symbol ->

    It is recommended to toggle of command feedback, because the command gets executed by the console and due to that creates a message in chat [/gamerule sendCommandFeedback false]

    the config.yml has to be named this way and has to be in the folder plugins/RedeemPerks/config.yml

    have fun. please reply if you found any bugs. have a good day

    P.S. Sorry for bad english :Y
  4. Offline


    Hi, thank you so much @InstanceofDeath . What's the command to receive the book/perk item in game so players can actually redeem it? /perk get <name> doesn't seem to be working.
  5. Offline


    I changed it to /getperk <perk> because it is easier to programm commands with less arguments and there was no need for the spacebar ;)
  6. Offline



    It's working perfectly! The only thing is I was wondering if you could change it so the lore can be multiple lines. Something like

    - Lore 1
    - Lore 2

    Similar to the commands layout, so I can describe what the perk is on one or two lines and then put 'Right Click to Redeem' or something like that on the third line.

    (Or you could add in \n to go to the next line)
    Last edited: Feb 10, 2020
  7. Offline


  8. Offline


    Hey, the new lore system seems to be working great but I have discovered a bug. I added the plugin and config and made a perk called diamond where a player will receive one diamond as a test and it worked great. I then added another perk to set a players permission group using my permission plugin (LuckPerms). Now, whenever I do /getperk diamond or /getperk president it shows up 'This perk was not found!' Basically for some reason it isn't detecting either of the perks I made. This is my config:
    Item: Book
        Prefix: §2Perks§7§l>>§r
        Redeem: §aYou have redeemed <Perk>§a!
            Name: §b§lDiamond §7§lPerk
            - §7Gives you one diamond!
            - §b§lRight Click §7to redeem!
                - give <User> diamond 1
            Name: §e§lPresident §7§lRank
            - §cGives player the president rank!
            - §bRight Click §7to redeem!
                - lp user <User> parent settrack ranks president
  9. Offline


  10. Offline


    The bug is back.. I added in the same two perks as last time when the bug appeared and they worked just fine. But then I added in a total of 5 perks and the same bug came back. I thought maybe it was because I exceeded two perks so I removed three but the bug still continued... I also tried to replicate the first two perks that were working fine as best I could before the bug appeared but they no longer worked. Please figure out what is causing this bug and fix it?
    Last edited: Feb 12, 2020
  11. Offline


    @InstanceofDeath are you working on a fix for the bug, or should I look into asking someone else to make this for me? This bug makes the plugin unusable so I can't really work around the bug..
  12. Offline


    Does anyone else want to give this a try?..
  13. Offline


    Hey @AlwaysAllstar i have created something that i think will fit your needs.

    i did make quite a few changes to the exact ideas you proposed above, i also added a log system
    if one of your players claims to have redeemed a perk without getting anything you can see exactly when and what perk was redeemed
    you can do this with "/perk logs <PlayerName>"

    the command you proposed to get yourself perks was a little limited as you would only be allowed to give yourself perks
    i have changed it to "/perk give <PlayerName> <PerkName>"

    the permission for all commands is "perks.admin"

    commands are also able to be executed from console

    this will be your Perks.yml where you create your perks every single thing shown here is needed on any new perks

    i will give a brief explaination on how each key/value works after each #
    #General Key
    #This is your PerkName which is used to spawn them in using the command
    #Displayname of the item
        displayName: "&4&lExamplePerk"
    #What item should be spawned in
        itemType: "BOOK"
    #Damage used for blocks like blue wool, for most items this will remain at 0
        damage: 0
    #Wether the item should glow e.g. Look enchanted
        glow: true
    #Deny node if the player trying to redeem the perk has this permission, he will be denied
        deny-node: "perk.diamond"
    #Deny/Success message, i put them here so you can add a custom message for each perk not just 1 universal message
          success: "&aYou just redeemed this lit perk %player%"
          denied: "&cYou have already redeemed this perk!"
    #The Lore of the item
          - '&1TestLine'
          - '&2TestLine'
          - '&3TestLine'
    #List of commands executed upon success
          - 'give %PLAYER% diamond 1'
    Plugin is made in 1.14 and has not been tested in any other versions

    NOTE: my plugin requires NBT-API to work, without this plugin my plugin will NOT work, you can find it here

    If you want to take a look at the code and see how its all done, feel free to take a look right here

    You can find the download right here

    If you find any errors/buggs/issues you can either make a "issue" on github or contact me on bukkit
    hope this works for ya, cheers
  14. Offline


    Working perfectly! Found no bugs. Thank you so much. :)
  15. Offline


    not a problem, have fun with it :)
Thread Status:
Not open for further replies.

Share This Page