A plugin to manage the resources spawn and loots from mining.
2

Harvester

Harvester is a Sponge Minecraft plugin that restricts block break events for every non-creative players, according to the rules described in a configuration file.

Permission

you can active harvester on sevral player with a permission. People who have : harvester.block.breaking will be able to freely break any blocks. People in creative Mode can break any blocks too.

Configuration file

Global configuration

You can set worlds where you want that Harvester is enabled in the global.conf.

Worlds = ["worldName1","WorldName2"]

Harvest regeneration

A file named harvestables.conf needs to be created into the config folder of the server. This file is going to describe which blocks can be broke and when they will respawn.

The file uses HOCON format, and must begin with the array harvestables.
For each block that can be mined, you must specify some data :

  • The type field must contain the blocktype id (ex : minecraft:iron_ore)
  • respawnmin is the minimum amount of minutes before block respawn
  • respawnmax is the maximum amount of minutes before block respawn
  • (Optional) The state object can contain a list of BlockState to authorize only a given subtype of block to be mined
harvestables = [
    {
        type: "minecraft:dirt",
        respawnmin: 2,
        respawnmax: 5
    },
    {
        type: "minecraft:stone",
        state {
            variant { value = "andesite" }
        },
        respawnmin: 5,
        respawnmax: 10
    }
]

Following the above example, dirt can be mined and will respawn between 2 and 5 minutes later. Only the andesite variant of stone can be broken, and it will respawn between 5 and 10 minutes later.

Harvest drops

A file named drops.conf must exist into the _config_folder of the server. It is used to define the items that will come out of the mined blocks.

The file also uses HOCON and contains two arrays :

  • The default array contains the resources that will not disappear once mined. By default, any vanilla drop will not happen. It contains a list of the resources that will drop as is on a vanilla server.
  • The harvest_items array contains the data specifying which item we want to be dropped for a block
    • type is the name of the block affected
    • (Optional) The state object, if present, specify that only a subtype of a block is affected
    • (Optional) The item_name, when present, defines an item by its name
    • (Optional) The item_ref, when present, mean that the plugin will try to communicate with Itemizer plugin to retrieve a configured item identified by its id
    • (Optional) The pool_ref, when present, will fetch an item (or nothing) from an itempool from the plugin Itemizer
default = [
   	"minecraft:dirt",
   	"minecraft:wood"
]
harvest_items = [
   {
       type: "minecraft:stone",
       state {
           variant { value = "diorite" }
       },
       item_name: "minecraft:cobblestone",
       item_ref: 2,
       pool_ref: 1
   }
]

Following the above example, dirt and wood are going to drop their respective items, whereas diorite stone will drop a cobblestone block, the item number 2 of Itemizer, and an item from the first Itemizer pool. Note that we could have writen only one or two of the three item fetchers.

Reload command

There is a command that reloads the configuration files without needing to restart the server : /reload-harvester.
Permission : harvester.command.reload

Category: World Management

Published on Oct 13, 2018

views

stars

watchers

total downloads

Licensed under Apache 2.0

Promoted Versions

Pages

Members