reference-and-documentation/Customizing config.yml

Below you can find reference and documentation on customizing the Offering plugin to your server's own needs. A page with introduction to editing the config file for this plugin is coming soon.

Example config.yml

rewards:
    zeus:
        lightning: $x $y $z
    tp:
        tp: $x $y $z
    day:
        time: 0
    cookies:
        give: COOKIE 5
    fullheal:
        heal: 20
altars:
    GOLD_BLOCK:
        gifts:
            DIAMOND_SWORD:
                reward: zeus
            CAKE:
                reward: cookies
            CLAY_BALL:
                reward: fullheal
            WATCH:
                amount: 3
                reward: day
            SLIME_BALL:
                reward: tp
decay: true
click-type: LEFT

Altars

An altar is a specified type of block which can receive offerings from players. An altar can be defined in config.yml by placing the block name in all capital letters under altars. Inside of the block name, you place the offerings which you want an altar to be able to create under the gifts attribute.

Gifts

Gifts are the items which an altar can receive as an attribute. They are placed under an altar's gifts attribute in config.yml, and they themselves have one mandatory attribute and one optional one. You must include the reward which you want the gift to give the player, and it is optional to specify the amount of the gift which the altar must receive (the default value is 1).

Rewards

Rewards are the user-defined game mechanics which take place when a user interacts an altar, and each one is paired with a gift. The giving of a gift to an altar executes its associated reward. In config.yml, rewards are defined under rewards, and they can take any reward -action (with arguments) as an attribute. In addition, each reward can take a message string of text to be displayed when the player receives it.

If you want to allow players to enter their own arguments for a reward, put variable names preceded by a dollar sign in for the arguments of the reward-action. This means that players can place signs around the altar with the variable values that they want.

Currently supported reward-actions

  • tp [x] [y] [z] - teleports the player to the specified location
  • worldtp [worldname] [x] [y] [z] - teleports the player to the specified location in the specified world
  • spawnmob [mobtype] - spawns a mob of the specified type at the altar
  • lightning [x] [y] [z] - strikes lightning at the specified location
  • heal [amount] - heals the player the specified amount (max-health is 20)
  • time [newtime] - sets the time a value between 0 and 2400
  • weather [rain/thunder/clear] - sets the weather conditions
  • give [item] [amount] - gives the player the specified amount of the specified item

Using signs

If you specify a variable (which has to start with a $ sign) in a reward's reward-action, users can substitute in a value for the variable by placing signs around the altar to which they give their gift. On the second line of the sign goes the variable name with the $ sign, and on the third line goes the value which the user wants to give it. Imagine we had a reward coded like so:

mobfuntime:
    spawnmob: $type

To spawn a zombie, a player on the server would then be able to make an altar (which has an offering set up that is linked to this reward) and place a sign next to it with the following text:

$type
ZOMBIE

Comments

Posts Quoted:
Reply
Clear All Quotes