-
Notifications
You must be signed in to change notification settings - Fork 0
Configuration
Breaker reads any .yml file from the blockconfigs folder inside the main plugin folder of Breaker. Each .yml file can contain any amount of block configurations.
Example structure of a Breaker config file:
#example structure of each breaker entry
DATABASE-NAME: #please refer to systems
max-hardness: 50
min-hardness: 10
states: #please refer to states
undefined-state-name-1: #can be anything really
type: "example"
stateargs1: "example"
undefined-state-name-2: #can be anything really
type: "example"
stateargs2: "example"
triggers: #please refer to triggers
on-mine:
undefined-trigger-name-1: #can be anything really
type: "example"
triggerargs1: "example"
undefined-trigger-name-2: #can be anything really
type: "example"
triggerargs2: "example"Breaker works by including different systems for detecting different blocks. These systems also define how to name your entries in the .yml files inside the blockconfigs folder. (check DATABASE-NAME in the example structure.)
The current systems available are:
The material system lets you input basic Spigot material names. Breaker will then assign your configuration to the Spigot material listed. (So, if you use “STONE” every stone block will follow the given configuration.)
-
MI Custom Blocks (Requires MMOItems)
The MI Custom Block system lets you input “mmoitems-*” (replace * with the id of the custom block) and the configuration will be bound to the referenced custom block ONLY.
The skull system lets you input “skull-*” (replace * with the value of the skull texture) and the configuration will be bound to any player head with the same value. Useful for making custom ores using player heads.
Every block has a min-hardness value and a max-hardness value which determines how long it will take to mine the block when no criteria are met and how the fastest breaking speed possible for the given block.
When a player starts breaking a block it will automatically use the max-hardness as the breaking time, but with states you can configure different conditions to be met for the breaking speed to decrease. Each state takes different variables so it's recommended to read the page of the state you're going to use.
Want certain things to happen once a player starts breaking a block? Set them on fire, maybe?
Well it's possible using Breakers trigger system. It's configured much like the states, however there are 5 different types of triggers.
#example structure of triggers
#this goes next to “states” under the base configuration
triggers:
on-start: #runs when starting to break a block
triggers…
on-mine: #runs TEN times during a player breaking the block
triggers…
on-abort: #runs when a player forcefully stops breaking a block
triggers…
on-finish: #runs when a player successfully breaks a block
triggers…
on-stop: #runs when a block is no longer being broken. finished or not
triggers…