šŸ§±Blocks

Coral features a fantastic blocks module, which not only allows users to view their total and rawblock statistics, but also allows players to obtain rewards depending on these statistics.

Total Blocks vs Raw Blocks

You may be wondering what the difference between raw and total blocks are. Simply put raw blocks are the amount of blocks that the user has manually mined with their pickaxe. Whereas total blocks are the amount of blocks broken by the pickaxe, this may be in the form of blocks broken by enchants etc etc.

Configuring Rewards

Within the blocks module you are able to set player rewards for both total blocks mined and raw blocks mined. These rewards can be configured within CoralPrison/modules/blocks/configs/raw-rewards.yml or CoralPrison/modules/blocks/configs/total-rewards.yml. These rewards work similar to most Abyss item configurations, however there are a few extra fields and sections which must be filled out. To create a reward simply copy + paste the format down below, into the rewards: section, changing the id to ensure all rewards are unique:

"one":
        blocks: 100
        locked-item:
            material: "RED_DYE"
            name: "&4&l[&c&l!&4&l] &cExample Reward &7(Locked)"
            lore: []
        unlocked-item:
            material: "LIME_DYE"
            enchanted: true
            name: "&2&l[&a&l!&2&l] &aExample Reward &7(Ready)"
            lore: []
        claimed-item:
            enchanted: true
            material: "CHORUS_FRUIT"
            name: "&5&l[&d&l!&5&l] &dExample Reward &7(Claimed)"
            lore: []
        commands:
            - "give %player% diamond 1"

When configuring these rewards, you must specifiy the blocks: field, which is the number of blocks needed to unlock the reward. This number of blocks may vary between raw blocks or total blocks depending on the configuration file which you are editing. Next you must also contain a commands: section, with a list of commands to run when the user redeems their reward.

Configuring Leaderboard menu

To configure the leaderboard menu you should edit the "total-top-menu": or "raw-top-menu": found within CoralPrison/modules/blocks/configs/menus.yml. These menus work the same as any other Abyss menu configuration file, however there is one additional field which you must declare. This field is the top-slots: field which takes an array of slot indexes as a value. In these specified slots the players on the leaderboard will be displayed. If there arent enough users to fill all the slots, they will be occupied by anything set under invalid-item:.

You may edit the interval in which this leaderboard updates, in CoralPrison/modules/blocks/configs/settings.yml, by changing the leaderboards-update-interval:. This value must be specified in seconds.

Configuring Rewards Menu

To configure the rewards menu you should edit the "total-rewards-menu": or "raw-rewards-menu": found within CoralPrison/modules/blocks/configs/menus.yml. These menus work the same as any other Abyss menu configuration file, however there is one additional field which you must declare. This field is the reward-slots: field which takes an array of slot indexes as a value. In these specified slots, the rewards which you have configured during the Configuring Rewardssection will be displayed. This menu is completely paginated, so you may set as many rewards as you would like.

Configuration Files

configs/raw-rewards.yml
rewards:
    "one":
        blocks: 100
        locked-item:
            material: "RED_DYE"
            name: "&4&l[&c&l!&4&l] &cExample Reward &7(Locked)"
            lore:
                - " "
                - "&cInformation"
                - "&cā†’ &7Raw Blocks Required: &f%blocks%/%needed%"
                - " "
                - "&cRewards"
                - "&cā†’ &71x Diamond"
                - " "
                - "&7&o(( This reward is currently &f&olocked&7&o! ))"
        unlocked-item:
            material: "LIME_DYE"
            enchanted: true
            name: "&2&l[&a&l!&2&l] &aExample Reward &7(Ready)"
            lore:
                - " "
                - "&aInformation"
                - "&aā†’ &7Raw Blocks Mined: &f%blocks%/%needed%"
                - "&aā†’ &7Status: &fReady"
                - " "
                - "&aRewards"
                - "&aā†’ &71x Diamond"
                - " "
                - "&7&o(( Click me to claim your &f&oreward(s)&7&o! ))"
        claimed-item:
            enchanted: true
            material: "CHORUS_FRUIT"
            name: "&5&l[&d&l!&5&l] &dExample Reward &7(Claimed)"
            lore:
                - " "
                - "&dInformation"
                - "&dā†’ &7Raw Blocks Mined: &f%blocks%/%needed%"
                - "&dā†’ &7Status: &fClaimed"
                - " "
                - "&dRewards"
                - "&dā†’ &71x Diamond"
                - " "
                - "&7&o(( You have already &f&oclaimed&7&o this reward! ))"
        commands:
            - "give %player% diamond 1"
configs/total-rewards.yml
rewards:
    "one":
        blocks: 10000
        locked-item:
            material: "RED_DYE"
            name: "&4&l[&c&l!&4&l] &cExample Reward &7(Locked)"
            lore:
                - " "
                - "&cInformation"
                - "&cā†’ &7Required Blocks: &f1"
                - " "
                - "&cRewards"
                - "&cā†’ &71x Diamond"
                - " "
                - "&7&o(( This reward is currently &f&olocked&7&o! ))"
        unlocked-item:
            material: "LIME_DYE"
            enchanted: true
            name: "&2&l[&a&l!&2&l] &aExample Reward &7(Ready)"
            lore:
                - " "
                - "&aInformation"
                - "&aā†’ &7Blocks Mined: &f%blocks%/%needed%"
                - "&aā†’ &7Status: &fReady"
                - " "
                - "&aRewards"
                - "&aā†’ &71x Diamond"
                - " "
                - "&7&o(( Click me to claim your &f&oreward(s)&7&o! ))"
        claimed-item:
            enchanted: true
            material: "PRISMARINE_SHARD"
            name: "&3&l[&b&l!&3&l] &bExample Reward &7(Claimed)"
            lore:
                - " "
                - "&bInformation"
                - "&bā†’ &7Blocks Mined: &f%blocks%/%needed%"
                - "&bā†’ &7Status: &fClaimed"
                - " "
                - "&bRewards"
                - "&bā†’ &71x Diamond"
                - " "
                - "&7&o(( You have already &f&oclaimed&7&o this reward! ))"
        commands:
            - "give %player% diamond 1"
configs/settings.yml
command:
    name: "blocks"
    aliases:
        - "coralblocks"
        - "block"
        - "cblock"
        - "cblocks"
        - "coralblock"

leaderboards-update-interval: 60 # seconds
configs/menus.yml
menus:
    "block-rewards-menu":
        title: "&8&lBLOCK REWARDS"
        rows: 3
        borders:
            "gray":
                material: "GRAY_STAINED_GLASS_PANE"
                name: " "
                lore: [ ]
                slots:
                    - "0-26"
        total-item:
            slot: 12
            material: "PRISMARINE_SHARD"
            name: "&3&l[&b&l!&3&l] &bTotal Block Rewards &7(Left-Click)"
            lore:
                - " "
                - "&bInformation"
                - "&bā†’ &7Action: &fOpen total block rewards"
                - "&bā†’ &7Usage: &fLeft-Click"
                - " "
                - "&7&o(( Click me to view your block rewards! ))"
        raw-item:
            slot: 14
            material: "CHORUS_FRUIT"
            name: "&5&l[&d&l!&5&l] &dRaw Block Rewards &7(Left-Click)"
            lore:
                - " "
                - "&dInformation"
                - "&dā†’ &7Action: &fOpen raw block rewards"
                - "&dā†’ &7Usage: &fLeft-Click"
                - " "
                - "&7&o(( Click me to view your raw block rewards! ))"
    "blocks-top-menu":
        title: "&8&lBLOCK LEADERBOARDS"
        rows: 3
        borders:
            "gray":
                material: "GRAY_STAINED_GLASS_PANE"
                name: " "
                lore: [ ]
                slots:
                    - "0-26"
        total-item:
            slot: 12
            material: "PRISMARINE_SHARD"
            name: "&3&l[&b&l!&3&l] &bTotal Blocks Leaderboard &7(Left-Click)"
            lore:
                - " "
                - "&bInformation"
                - "&bā†’ &7Action: &fOpen total blocks menu"
                - "&bā†’ &7Usage: &fLeft-Click"
                - " "
                - "&7&o(( Click me to view the top blocks mined! ))"
        raw-item:
            slot: 14
            material: "CHORUS_FRUIT"
            name: "&5&l[&d&l!&5&l] &dRaw Blocks Leaderboard &7(Left-Click)"
            lore:
                - " "
                - "&dInformation"
                - "&dā†’ &7Action: &fOpen raw blocks menu"
                - "&dā†’ &7Usage: &fLeft-Click"
                - " "
                - "&7&o(( Click me to view the top raw blocks mined! ))"
    "total-top-menu":
        title: "&8&lTOP TOTAL BLOCKS"
        rows: 3
        top-slots: [10,11,12,13,14,15,16]
        borders:
            "gray":
                material: "GRAY_STAINED_GLASS_PANE"
                name: " "
                lore: [ ]
                slots:
                    - "0-26"
            "blue":
                material: "LIGHT_BLUE_STAINED_GLASS_PANE"
                name: " "
                lore: [ ]
                slots:
                    - "9-17"
        invalid-item:
            material: "PLAYER_HEAD"
            skull: "MHF_Question"
            name: "&4&l[&c&l!&4&l] &c???"
            lore: [ ]
        valid-item:
            material: "PLAYER_HEAD"
            skull: "%player%"
            name: "&3&l[&b&l!&3&l] &b%player% &7(#%rank%)"
            lore:
                - " "
                - "&bInformation"
                - "&bā†’ &7Rank &f#%rank%"
                - "&bā†’ &7Total Blocks: &f%amount%x"
                - " "
                - "&7&o(( &f&o%player%&7&o has mined &f&o%amount%x&7&o blocks in total! ))"
        stats-item:
            slot: 22
            material: "PLAYER_HEAD"
            skull: "%player%"
            name: "&3&l[&b&l!&3&l] &b%player% &7(#%rank%)"
            lore:
                - " "
                - "&bInformation"
                - "&bā†’ &7Rank: &f#%rank%"
                - "&bā†’ &7Total Blocks: &f%amount%x"
                - " "
                - "&7&o(( You have mined &f&o%amount%x&7&o blocks in total! ))"
    "raw-top-menu":
        title: "&8&lTOP RAW BLOCKS"
        rows: 3
        top-slots: [10,11,12,13,14,15,16]
        borders:
            "gray":
                material: "GRAY_STAINED_GLASS_PANE"
                name: " "
                lore: [ ]
                slots:
                    - "0-26"
            "purple":
                material: "PURPLE_STAINED_GLASS_PANE"
                name: " "
                lore: [ ]
                slots:
                    - "9-17"
        invalid-item:
            material: "PLAYER_HEAD"
            skull: "MHF_Question"
            name: "&4&l[&c&l!&4&l] &c???"
            lore: [ ]
        valid-item:
            material: "PLAYER_HEAD"
            skull: "%player%"
            name: "&5&l[&d&l!&5&l] &d%player% &7(#%rank%)"
            lore:
                - " "
                - "&dInformation"
                - "&dā†’ &7Rank &f#%rank%"
                - "&dā†’ &7Raw Blocks: &f%amount%x"
                - " "
                - "&7&o(( &f&o%player%&7&o has mined &f&o%amount%x&7&o raw blocks! ))"
        stats-item:
            slot: 22
            material: "PLAYER_HEAD"
            skull: "%player%"
            name: "&5&l[&d&l!&5&l] &d%player% &7(#%rank%)"
            lore:
                - " "
                - "&dInformation"
                - "&dā†’ &7Rank: &f#%rank%"
                - "&dā†’ &7Raw Blocks: &f%amount%x"
                - " "
                - "&7&o(( You have mined &f&o%amount%x&7&o raw blocks! ))"
    "total-rewards-menu":
        title: "&8&lTOTAL BLOCK REWARDS"
        rows: 6
        reward-slots: [0,1,2,3,4,5,6,7,8,17,26,25,24,23,22,21,20,19,18,27,36,37,38,39,40,41,42,43,44]
        borders:
            "gray":
                material: "GRAY_STAINED_GLASS_PANE"
                name: " "
                lore: []
                slots:
                    - "0-53"
            "light":
                material: "LIGHT_GRAY_STAINED_GLASS_PANE"
                name: " "
                lore: []
                slots:
                    - "0-8"
                    - "17-27"
                    - "36-44"
        next-page:
            slot: 50
            material: "LIME_DYE"
            name: "&2&l[&a&l!&2&l] &aNext Page &7(Click)"
            lore:
                - " "
                - "&aInformation"
                - "&aā†’ &7Action: &fNext Page"
                - "&aā†’ &7Usage: &fLeft-Click"
                - " "
                - "&7&o(( Click me to go to the &f&onext&7&o page! ))"
        current-page:
            slot: 49
            material: "CLOCK"
            name: "&6&l[&e&l!&6&l] &eCurrent Page &7(#%page%)"
            lore:
                - " "
                - "&eInformation"
                - "&eā†’ &7Page: &f#%page%"
                - " "
                - "&7&o(( You are on page &f&o#%page%&7&o! ))"
        prev-page:
            slot: 48
            material: "RED_DYE"
            name: "&4&l[&c&l!&4&l] &cPrevious Page &7(Click)"
            lore:
                - " "
                - "&cInformation"
                - "&cā†’ &7Action: &fPrevious Page"
                - "&cā†’ &7Usage: &fLeft-Click"
                - " "
                - "&7&o(( Click me to go to the &f&oprevious&7&o page! ))"
    "raw-rewards-menu":
        title: "&8&lRAW BLOCK REWARDS"
        rows: 6
        reward-slots: [0,1,2,3,4,5,6,7,8,17,26,25,24,23,22,21,20,19,18,27,36,37,38,39,40,41,42,43,44]
        borders:
            "gray":
                material: "GRAY_STAINED_GLASS_PANE"
                name: " "
                lore: []
                slots:
                    - "0-53"
            "light":
                material: "LIGHT_GRAY_STAINED_GLASS_PANE"
                name: " "
                lore: []
                slots:
                    - "0-8"
                    - "17-27"
                    - "36-44"
        next-page:
            slot: 50
            material: "LIME_DYE"
            name: "&2&l[&a&l!&2&l] &aNext Page &7(Click)"
            lore:
                - " "
                - "&aInformation"
                - "&aā†’ &7Action: &fNext Page"
                - "&aā†’ &7Usage: &fLeft-Click"
                - " "
                - "&7&o(( Click me to go to the &f&onext&7&o page! ))"
        current-page:
            slot: 49
            material: "CLOCK"
            name: "&6&l[&e&l!&6&l] &eCurrent Page &7(#%page%)"
            lore:
                - " "
                - "&eInformation"
                - "&eā†’ &7Page: &f#%page%"
                - " "
                - "&7&o(( You are on page &f&o#%page%&7&o! ))"
        prev-page:
            slot: 48
            material: "RED_DYE"
            name: "&4&l[&c&l!&4&l] &cPrevious Page &7(Click)"
            lore:
                - " "
                - "&cInformation"
                - "&cā†’ &7Action: &fPrevious Page"
                - "&cā†’ &7Usage: &fLeft-Click"
                - " "
                - "&7&o(( Click me to go to the &f&oprevious&7&o page! ))"
lang.yml
messages:
    "admin-help":
        sound:
            enabled: true
            value: "BLOCK_NOTE_PLING"
            volume: 1
            pitch: 1
        message:
            enabled: true
            value:
                - "&6&m------------------------------------------"
                - " "
                - "&e&lCoral&6&lPrisons &8&lā†’ &eBlocks Module"
                - "&7&oMade by &f&oRelocation#0001&7&o."
                - " "
                - "&7<> = Required"
                - "&7[] = Optional"
                - " "
                - "&e&lADMIN COMMANDS:"
                - "&e&lā†’ &7/blocks giveraw <player> <amount>"
                - "&e&lā†’ &7/blocks setraw <player> <amount>"
                - "&e&lā†’ &7/blocks takeraw <player> <amount>"
                - "&e&lā†’ &7/blocks givetotal <player> <amount>"
                - "&e&lā†’ &7/blocks settotal <player> <amount>"
                - "&e&lā†’ &7/blocks taketotal <player> <amount>"
                - " "
                - "&e&lPLAYER COMMANDS:"
                - "&e&lā†’ &7/blocks rewards"
                - "&e&lā†’ &7/blocks top"
                - "&e&lā†’ &7/blocks help"
                - "&e&lā†’ &7/blocks [player]"
                - " "
                - "&6&m------------------------------------------"
    "player-help":
        sound:
            enabled: true
            value: "BLOCK_NOTE_PLING"
            volume: 1
            pitch: 1
        message:
            enabled: true
            value:
                - "&6&m------------------------------------------"
                - " "
                - "&e&lCoral&6&lPrisons &8&lā†’ &eBlocks Module"
                - "&7&oMade by &f&oRelocation#0001&7&o."
                - " "
                - "&7<> = Required"
                - "&7[] = Optional"
                - " "
                - "&e&lCOMMANDS:"
                - "&e&lā†’ &7/blocks rewards"
                - "&e&lā†’ &7/blocks top"
                - "&e&lā†’ &7/blocks help"
                - "&e&lā†’ &7/blocks [player]"
                - " "
                - "&6&m------------------------------------------"
    "block-stats":
        sound:
            enabled: true
            value: "BLOCK_NOTE_PLING"
            volume: 1
            pitch: 1
        message:
            enabled: true
            value:
                - "&6&m------------------------------------------"
                - " "
                - "&e&l%player% &8&lā†’ &eBlocks Statistics"
                - " "
                - "&e&lSTATISTICS:"
                - "&e&lā†’ &7Total Blocks Mined: &f%total%"
                - "&e&lā†’ &7Raw Blocks Mined: &f%raw%"
                - " "
                - "&6&m------------------------------------------"
    "given-raw-blocks":
        sound:
            enabled: true
            value: "BLOCK_NOTE_PLING"
            volume: 1
            pitch: 1
        message:
            enabled: true
            value:
                - "&e&lCoral&6&lPrisons &8&lā†’ &7You have given &e%player% %amount%x&7 raw block(s)."
    "given-total-blocks":
        sound:
            enabled: true
            value: "BLOCK_NOTE_PLING"
            volume: 1
            pitch: 1
        message:
            enabled: true
            value:
                - "&e&lCoral&6&lPrisons &8&lā†’ &7You have given &e%player% %amount%x&7 total block(s)."
    "set-raw-blocks":
        sound:
            enabled: true
            value: "BLOCK_NOTE_PLING"
            volume: 1
            pitch: 1
        message:
            enabled: true
            value:
                - "&e&lCoral&6&lPrisons &8&lā†’ &7You have set &e%player%'s&7 raw blocks to &e%amount%x&7."
    "set-total-blocks":
        sound:
            enabled: true
            value: "BLOCK_NOTE_PLING"
            volume: 1
            pitch: 1
        message:
            enabled: true
            value:
                - "&e&lCoral&6&lPrisons &8&lā†’ &7You have set &e%player%'s&7 total blocks to &e%amount%x&7."
    "taken-raw-blocks":
        sound:
            enabled: true
            value: "BLOCK_NOTE_PLING"
            volume: 1
            pitch: 1
        message:
            enabled: true
            value:
                - "&e&lCoral&6&lPrisons &8&lā†’ &7You have taken &e%amount%x&7 raw block(s) from &e%player%&7."
    "taken-total-blocks":
        sound:
            enabled: true
            value: "BLOCK_NOTE_PLING"
            volume: 1
            pitch: 1
        message:
            enabled: true
            value:
                - "&e&lCoral&6&lPrisons &8&lā†’ &7You have taken &e%amount%x&7 total block(s) from &e%player%&7."
    "no-permission":
        sound:
            enabled: true
            value: "FIZZ"
            volume: 1
            pitch: 1
        message:
            enabled: true
            value:
                - "&c&lCoral&4&lPrisons &8&lā†’ &7You do not have &cpermission&7 to perform this action."
    "invalid-player":
        sound:
            enabled: true
            value: "FIZZ"
            volume: 1
            pitch: 1
        message:
            enabled: true
            value:
                - "&c&lCoral&4&lPrisons &8&lā†’ &7You have entered an &cinvalid&7 player!"
    "total-top-updating":
        sound:
            enabled: false
            value: "BLOCK_NOTE_PLING"
            volume: 1
            pitch: 1
        message:
            enabled: false
            value:
                - "&e&lCoral&6&lPrisons &8&lā†’ &7Starting recalculation of the &eTotal Blocks&7 leaderboard."
    "raw-top-updating":
        sound:
            enabled: false
            value: "BLOCK_NOTE_PLING"
            volume: 1
            pitch: 1
        message:
            enabled: false
            value:
                - "&e&lCoral&6&lPrisons &8&lā†’ &7Starting recalculation of the &eRaw Blocks&7 leaderboard."
    "total-top-updated":
        sound:
            enabled: true
            value: "BLOCK_NOTE_PLING"
            volume: 1
            pitch: 1
        message:
            enabled: true
            value:
                - "&e&lCoral&6&lPrisons &8&lā†’ &7Successfully recalculated the &eTotal Blocks&7 leaderboard. &7(Took %time%ms)"
    "raw-top-updated":
        sound:
            enabled: true
            value: "BLOCK_NOTE_PLING"
            volume: 1
            pitch: 1
        message:
            enabled: true
            value:
                - "&e&lCoral&6&lPrisons &8&lā†’ &7Successfully recalculated the &eRaw Blocks&7 leaderboard. &7(Took %time%ms)"

Last updated