The cratest crate plugin of all time
3

Rewards

Rewards are things which can be received from a crate, which includes one or more prizes as well as additional properties to customize how the reward interacts with a crate (such as messages or restrictions).

<id> = {
    //name, lore, icon
    prizes = [
        <prize-reference>
        ...
    ]
}

Properties

NameTypeDescriptionDefault
nameTextThe reward name, inherited from ComponentThe name of the first prize (if only one prize exists) or this reward’s id (if multiple prizes exist)
loreListThe reward lore, inherited from ComponentThe lore of the first prize (if only one prize exists) or the names of all prizes (if multiple prizes exist)
iconItemThe reward icon, inherited from ComponentThe icon of the first prize (if only one prize exists) or a book with the above name/lore (if multiple prizes exist)
prizesListThe prizes for this rewardRequired
weightIntegerThe reference value, which is the likelihood of received the reward in a crateRequired

Referencing

The reference value for a reward is the weight, which is the likelihood of receiving the reward in a crate and is required. Rewards can also be defined inline using an object.

rewards = [
    ["<reward-id>", <weight>]
    {
        prizes = ...
        weight = <weight>
    }
]

If the reward contains only one prize, prefer using a reference for that prize directly as shown below. In addition to the reference value for the prize, the rewards weight must also be provided.

rewards = [
    //CommandPrize
    ["/<command>", <weight>]
    ["<command-prize-id>", <weight>]
    ["<command-prize-id>", "<value>", <weight>]
    {
        command = ...
        weight = <weight>
    }
    //ItemPrize
    ["<item-type>", <quantity>, <weight>]
    ["<item-prize-id>", <quantity>, <weight>]
    {
        item = ...
        quantity = <quantity>
        weight = <weight>
    }
]

Examples

A reward containing the example CommandPrizes.

command-prizes = {
    prizes = [
        ["greet"]
        ["me", "rolls nat 20"]
        ["/say The Server Speaks!"]
    ]
}

A reward containing the example ItemPrizes.

item-prizes = {
    prizes = [
        ["apple", 1]
        ["monado", 1]
        ["minecraft:cookie", 3]
    ]
}

A reward containing the example MoneyPrizes. Since this requires an economy plugin, it is not included in the default config.

money-prizes = {
    prizes = [
        ["tokens", 100]
        ["$", 250]
    ]
}

Category: Gameplay

Published on Sep 5, 2021

views

stars

watchers

total downloads

Licensed under MIT

Promoted Versions

Members