📝Examples

Here you will discover all the ways in which you can set up your PowerBlocks!

Please Read!

Before you start looking at the various examples, please familiarize yourself with how our "Action" system works, which is a big part of our system!

Also, the whole example page, is shown on the default powerblock settings in CONFIG, not in the powerblock file itself. This means that the structure will be a bit different, I'll show you how below:

#<PowerBlockName>: <- THIS HAS TO BE DELETED IN THE FILE OF THE POWERBLOCK ITSELF
  hologram: # DON'T FORGET TO EDIT THE SPACING
    enabled: true
#<PowerBlockName>: <- THIS HAS TO REMAIN WHEN SETTING UP THE DEFAULT PB IN CONFIG 
  hologram:
    enabled: true

Plugin Functionality

Do you want the plugin to be active? After change, you have to restart the server!

enabled: true

Update Checking

check-for-updates: true

Do you want to be notified when the new version of the plugin is available? This message will show only to OPs

PowerBlocks

Functionality
#<PowerBlockName>:
  enabled: true

Do you want from the MineBlock to be enabled? If set to false, the players won't be able to mine it and receive rewards!

Material

Default

#<PowerBlockName>:
  material:
    - STONE

If you don't want the block material to change, set it like this! The block won't never change!

List

#<PowerBlockName>:
  material:
    - STONE
    - COBBLESTONE

If you want the block to change from the block list above, list them this way. Set how you want it to change, under this setting

Swap

#<PowerBlockName>:
  material-swap: "every-time"

This setting will only work if you have more than 1 block in your block list. Set your change type to one of the types below:

  • every-time - The block will everytime the block loses 1 health! (Everytime one block is mined)

  • destroy - The material will change after the full Power Block is destroyed/mined!

  • chance-X - When one block is mined, there is X% chance to be changed (replace X by 0-100) by one of the block in the blocks list! Example: "chance-50" = 50% chance to be replaced

Direction

#<MineBlockName>:
  material-random-direction-swap: true

This feature will not work for all blocks! It will only work for blocks that are not symmetrical, so their texture changes when placed in different directions. This feature will ensure that once a block is mined, the texture will change to a different direction!

Mine Requirements

Permissions

#<PowerBlockName>:
  permission: "none"

Do you want only certain players with a given permission to be able to mine specific PowerBlock? Replace any permission you want instead of "none" (must remain in quotes)

Tools

Function

#<PowerBlockName>:
  required-tools:
    enabled: true

Do you want the player to only be able to mine a specific PowerBlock with certain tools/enchants? You can also check names of tools (explanation below)

Checking Tools

#<PowerBlockName>:
  #required-tools:
    tools:
      <anythingHere>:
        tool: "DIAMOND_PICKAXE"

This is how you specify what tool(s) you want to require for mining! Examples:

  • IRON_AXE - Only this tool will be able to mine the PowerBlock

  • *_PICKAXE - Every pickaxe will be allowed to mine the specific PowerBlock

  • WOODEN_* - Every item starting with wooden will be allowed to mine the PowerBlock

These are only examples! You can customise your tools to your needs!

Checking Enchants

#<PowerBlockName>:
  #required-tools:
    tools:
      <anythingHere>:
        enchants:
          - "DIG_SPEED:3" # Allows mining by item with Efficiency 3 and more!

This setting is quite simple! Simply specify the name of the enchantment that the item must have in order to allow the player to mine the PowerBlock. Behind that just add the required level and separate them with a colon!

Checking Tool/Item Names

#<PowerBlockName>:
  #required-tools:
    tools:
      <anythingHere>:
        names:
          - "My Diamond Pickaxe"

Simply put the required name in the brackets! We do not support color checking, so the code will ignore colors! That means, if the name is red, it doesn't matter, the code checks the letters, not colors

Full Syntax

#<PowerBlockName>:
  #required-tools:
    tools:
      <anythingHere>:
        tool: "DIAMOND_PICKAXE" # Requiring item in hand
    
        enchants: # Requiring enchants on item (in hand)
          - "DIG_SPEED:3" 
          - "SILK_TOUCH:1"
          
        names: # Requiring display name of the item (in hand)
          - "My Holy Hand"

You can easily add more required tools by copying the whole part under the tools section and pasting it under it! The text, that you have replaced (<anythingHere>) has to be different!

Actions (more in Actions section)

#<PowerBlockName>:
  required-tools:
    actions:
      player:
        wrong-tool:
          - "[ACTIONTYPE] ACTION"

What action should happen, when the player uses unsupported/wrong tool? You can find Actions her

Data Saving

Offline Rewards

#<PowerBlockName>:
  offline-rewards: true

Do you want players who are eligible for a reward and are not on the server to get the reward? They will get it as soon as they join the server!

Statistics

#<PowerBlockName>:
  save-player-stats: true

Do you want to save player stats so players can access their stats?

Location
#<PowerBlockName>:
  location:
    world: world
    x: 0.0
    y: 0.0
    z: 0.0

The location where a particular PowerBlock should to be located! You can edit your world by replacing the world behind the world: option!

Hologram

Function

#<PowerBlockName>:
  hologram:
    enabled: true

Do you want a hologram over PowerBlock? We strongly recommend that you do not disable this option, players will be confused!

Location

#<PowerBlockName>:
  hologram:
    offset:
      x: 0
      y: 0.2
      z: 0

What do you want the offset of the hologram above the PowerBlock to be? The coordinates are based on the position of the PowerBlock itself!

Content

#<PowerBlockName>:
  hologram:
    lines:
      - "Default MineBlock"
      - "%health%/%max_health%"

This is where you can set the actual content of the hologram for a specific PowerBlock. Thanks to our system, you can use Placeholders and also HEX colours!

Health

Static Health

#<PowerBlockName>:
  health: 100

How many lives will an individual PowerBlock have? One life equals one dig (1 mined block = -1 HP)

Random Health

#<PowerBlockName>:
  health: 100-250

If you want the number of HP to be different each time the PowerBlock is respawned, use the code above. In this case, the HP will be set randomly from 100 to 250!

Display Types

#<PowerBlockName>:
  health-type: DECREASE

How do you want PowerBlock's HP count to be displayed in the hologram? Do you want every time a block is mined, for HP to be added or subtracted? Types below:

  • DECREASE - Everytime the block is mined, the number is subtracted

  • INCREASE - Everytime the block is mined, the number is added

So in practical terms it's like this: If the type is set to DECREASE and the HP of the PowerBlock is set to 100, then after one mined block the number is subtracted. So the final hologram will show - 99/100

In the other way, if the type is set to INCREASE (and the maximum HP of the PowerBlock is set to 100), then after one mined block by a player, it will look like this - 1/100

Cooldown

Function

#<PowerBlockName>:
  cooldown:
    enabled: true

Do you want every time a given powerBlock is destroyed to be under cooldown? The cooldown can be set to 1h for example and until that time is up, the block cannot be mined. Set to true if you want to use this feature!

Time

#<PowerBlockName>:
  cooldown:
    time: 180

How long do you want PowerBlock to be under cooldown after complete destruction? Provide the number in seconds. Some hints below:

  • 1 minute - 60 seconds

  • 30 minutes - 1800 seconds

  • 1 hour - 3600 seconds

  • 12 hours - 43200 seconds

  • 1 day - 86400 seconds

You can provide any number you want, the numbers above are only hints

Material

#<PowerBlockName>:
  cooldown:
    material: BEDROCK

What material do you want the block to change into once it reaches the cooldown state?

Hologram Function

#<PowerBlockName>:
  #cooldown:
    separate-hologram:
      use: true

Do you want to use a different hologram over PowerBlock once it goes into cooldown? This setting is highly recommended, as it can be used to set a text countdown to when PowerBlock will be in cooldown state!

Hologram Location

#<PowerBlockName>:
  #cooldown:
    separate-hologram:
      offset:
        x: 0
        y: 0.2
        z: 0

What do you want the offset of the cooldown hologram above the PowerBlock to be? The coordinates are based on the position of the PowerBlock itself!

Hologram Content

#<PowerBlockName>:
  #cooldown:
    separate-hologram:
      lines:
        - "Default MineBlock"
        - ""
        - "Will be available in:"
        - "%cooldown_formatted%"

This is where you can set the actual content of the hologram for a specific PowerBlock in a cooldown! Thanks to our system, you can use Placeholders and also HEX colours!

Action

#<PowerBlockName>:
  #cooldown:
    actions:
      server:
        respawn:
          "[ACTIONTYPE] ACTION"

What should happen when the cooldown on a particular PowerBlock ends? Replace [ACTION] by some type of Action! You can add multiple lines - all one player actions will be executed to all

Inactive

Function

#<PowerBlockName>:
  inactive:
    enabled: true

Do you want that if PowerBlock is inactive for X seconds (no one has mined it in a certain amount of time), it will start to heal or reset?

Time

#<PowerBlockName>:
  inactive:
    time: 3600

How long do you want it to take for PowerBlock to mark itself as inactive and start healing or reset itself? Provide the number in seconds. Some hints below:

  • 1 minute - 60 seconds

  • 30 minutes - 1800 seconds

  • 1 hour - 3600 seconds

  • 12 hours - 43200 seconds

  • 1 day - 86400 seconds

You can provide any number you want, the numbers above are only hints

Type

#<PowerBlockName>:
  inactive:
    type: HEAL

How do you want PowerBlock to react once it is marked as inactive? Choose one of the types below:

  • HEAL - X HPs will be added every X seconds

  • RESET - The block will be healed to maximum health immediately

If you choose the HEAL type, you can add these options to your config to customize the healing method

#<PowerBlockName>:
  inactive:
    heal-amount: 1 # The number of HPs that should be added every X seconds
    heal-time: 3 # The period of time that will add X HPs (every X seconds)

Please keep in mind, that if you have these lines (above) in your code and your type is set to RESET, it won't broke your code

Material

#<PowerBlockName>:
  inactive:
    material: REDSTONE_BLOCK

What material do you want the block to change into once it reaches the inactive state?

Hologram

#<PowerBlockName>:
  #inactive:
    separate-hologram:
      use: true

Do you want to use a different hologram over PowerBlock once it goes into inactive state? This setting is highly recommended, so you can inform players, that the PowerBlock is healing/reseting!

Hologram Location

#<PowerBlockName>:
  #inactive:
    separate-hologram:
       offset:
        x: 0
        y: 0.2
        z: 0

What do you want the offset of the inactive hologram above the PowerBlock to be? The coordinates are based on the position of the PowerBlock itself!

Hologram Content

#<PowerBlockName>:
  #inactive:
    separate-hologram:
      lines:
        - "Block is healing!"
        - "%health%/%max_health%"
        - ""
        - "Quickly break the block!"
        - "Block is healing for %inactive_formatted%"

This is where you can set the actual content of the hologram for a specific PowerBlock in an inactive state! Thanks to our system, you can use Placeholders and also HEX colours!

Actions

#<PowerBlockName>:
  #inactive:
    actions:
      server:
        start:
          - "The block has been marked as inactive!"

        failed:
         - "Someone managed to break the block before it was fully healed"

        healed:
          - "The block has been fully healed!"

        period-heal:
          - "Block was healed for 3 hp!"

What should happen when one of the PowerBlock action variables is called? Replace [ACTIONTYPE] by some type of Actions! You can add multiple lines - all one player actions will be executed to all! Action variables below:

  • start - This is called whenever the block has started healing! (or switched to inactive)

  • failed - This is called when someone stops the block from healing! - HEAL only!

  • done - When the block is fully healed or reset, this is called!

  • period-heal - This is called every period of your configured heal time - HEAL only!

These values are static and can't be modified!

Particles & Sounds

Sounds

You can easily play sound for player/s with our Actions system! In the example I will play an anvil drop sound every time player breaks to block:

#<PowerBlockName>:
  actions:
    player:
      block-break:
        - "[SOUND] BLOCK_ANVIL_LAND"

Particles

Comming Soon!
Rewards

Function

#<PowerBlockName>:
  rewards:
    <rewardName>:
      use: true

Do you want this reward to be possible to get? If set to false, nothing changes, it just won't be possible to get, until it's set to true

Chances

#<PowerBlockName>:
  rewards:
    <rewardName>:
      chance: 50

What do you want the player's chances of getting this reward? Don't put the % behind the number. If you want this reward to be always rewarded to player, set the value to 100

Requirements

#<PowerBlockName>:
  rewards:
    <rewardName>:
      when: REQUIREMENT # Find the requirements below
  • Placement 1-5 - When the player is in the top 5 miners

  • Placement 3 - When the player is in 3rd place (or higher)

  • Mined 10-50 - When the player has mined 10-50 blocks

  • Mined 100 - When the player has mined 100 or more blocks

  • Participated - When the player has mined at least 1 block

So the final code should look something like this (example):

#<PowerBlockName>:
  rewards:
    <rewardName>:
      when: Mined 100 # Will reward every player with mined 100+ blocks

Premium Rewards

#<PowerBlockName>:
  rewards:
    <rewardName>:
      permission: "mining.reward.1"

Do you want a given reward to be obtainable only with a certain permission? Then set it up like this!

Rewarding with Item

#<PowerBlockName>:
  rewards:
    <rewardName>:
      rewards:
        - |
          data:
            ==: org.bukkit.inventory.ItemStack
            v: 3337
            type: DIAMOND
            amount: 2
            meta:
              ==: ItemMeta
              meta-type: UNSPECIFIC
              display-name: '{"extra":[{"text":"DIAMONDS!!"}],"text":""}'
              ItemFlags:
              - HIDE_ATTRIBUTES

To reward a player with some special modified item, you can use this method! We are working on a better and comfortable way of creating special items for your players!

Rewarding with Command

#<PowerBlockName>:
  rewards:
    <rewardName>:
      rewards:
        - "[CONSOLE] give %player% diamond 2"
        - "[CONSOLE] crates give %player% emerald_key 2"

This is probably a better way of defining and rewarding a player! You can also use Actions here!

AFK System

Function

#<PowerBlockName>:
  afk-system:
    use: true

Do you want to prevent players from mining if our system marks a player as AFK? More settings below!

Time

#<PowerBlockName>:
  afk-system:
    time: 90

After what time do you want a player to be marked as AFK? Specify the time in seconds!

Protection Levels

#<PowerBlockName>:
  afk-system:
    protection-level: HIGH

We have a total of 3 levels by which we can monitor players. Each level is differently strict and it's up to you how strict you want to be! Levels below:

  • LOW - Our system will check if the player doesn't walk

  • MEDIUM - We are checking player walking and head rotating

  • HIGH - Every player integration is checked! (Recommended)

We will be adding support to hook into CMI AFK detection soon!

Marked as AFK

Type

#<PowerBlockName>:
  #afk-system:
    marked:
      type: TELEPORT

What do you want to happen to a player who is marked as AFK? Types below:

  • NONE - Nothing will happen, only the "action-afk" will be executed

  • MINE - The player will not be allowed to mine, he will remain in the same place

  • TELEPORT - The player will be teleported to configured location (setting below)

  • KICK - The player will be kicked from the server (setting below)

The teleport & kick setting are located a little bit lower (under Time section)

Time

#<PowerBlockName>:
  #afk-system:
    marked:
      time: 10

After what time do you want the actions from the types section to be executed? E.g. if you select the TELEPORT type after what time when the player is marked as AFK do you want to teleport him? Provide the number in seconds! If you want to perform the action immediately, don't put this setting/this line in the configuration!

More TELEPORT settings

#<PowerBlockName>:
  #afk-system:
    marked:
      location:
        world: "world"
        x: 60
        y: 70
        z: 50
        pitch: 180
        yaw: 0

Setting of coordinates and direction where the player will be teleported, if the action type is set to TELEPORT!

More KICK settings

#<PowerBlockName>:
  #afk-system:
    marked:
      kick-reason: "You were AFK for too long!"

What message should be shown to the player after being kicked from the server?

Actions

#<PowerBlockName>:
  afk-system:
    actions:
      player:
        afk:
          - "[ACTIONTYPE] ACTION"
        afk-back:
           - "[ACTIONTYPE] ACTION"

What should happen when AFK System action variable is called? Replace [ACTIONTYPE] by some type of Actions! You can add multiple lines - all one player actions will be executed to all! Action variables below:

  • afk - Once the system marks a player as afk, this is called

  • afk-back - When a player returns to the computer and is unmarked as being afk!

These values are static and can't be modified!

Actions

You can find how our action system works below, please study it carefully so you won't be confused later!

Main Actions Syntax

#<subcategory>:
  actions: # Here, you are telling the code, that you are configuring Actions

    player: # One of two types! Under this, you can add all (one) player actions
      <action-name>: # Action variable, can be found through whole example section
        - "[ACTIONTYPE] ACTION" # Your desired action

    server: # Second variation! This will call actions for all players on server!
      <action-name>: # Action variable, can be found through whole example section
        - "[ACTIONTYPE] ACTION" # Your desired action

Always replace [ACTIONTYPE] by one of the Action Types from the chart above and ACTION by required argument of the Action Type!

The <action-name> is not default, you will find it changed through the code above!

_____________________________________________________________________________________________________

🆘Need Help?

If you have some problems please contact us on our social medias! We will be happy to help you with any problem and possibly modify the plugin if it will be necessarily!

Last updated