Setting up and using Variables

The core of actions is the variable system. The basis of this system is that it is a filter. If the variable is set to none, there is no filter. If it is set, if whatever the variable is entered as when a user performs an action matches the variable, it will progress.

Recently, we've also added sub variables which can make this system a bit more confusing. Here are some examples for different action types with and without sub variables.

Every action has the global sub variables listed below:

variable:
  root: none
  holding:
    item: diamond_sword
    name: 'IDK some name'
    amount: 1
    model: 0 # Custom Model Data (for resource packs)

Every sub-variable is optional. If you don't specify it, it won't be filtered for. Therefore, you can just use holding.item if you wish, or just holding.amount.

Basic Examples

Without Sub-Variables:

The following two actions function in the same manner, they're just two ways of formatting them.

block-break

variable:
  root: stone

block-break

Some more random examples: throw-projectile

With Sub-Variables:

block-break

enchant-all

This action is to enchant an item with soul speed 3 using an anvil.

With Multiple Variables:

block-break

block-place

Blacklists

To create blacklist in variable, use ! in front of first element

Examples without subroots:

block-break

block-place

Examples with subroots:

Variable format

There are some formats which you can use in variables to achieve certain functionality

"Contains" element

"CONTAINS" element check if action root/subroot contains specified text. TO create this, add __ before element.

Example:

In this case, root will accept every item which contains ORE in name (it also applies for strings and entities)

ItemsAdder (experimental)

Just add itemsadder: before element name to use itemsadder items, block or entities

Example:

MMOItems (experimental)

Just add mmoitems: before element name to use items from this plugin

Example:

Properties

You can add some properties in JSON format.

nbt property

Minecraft NBT String to modify required item. I.e. to create quest that progres only when we use unbreakable diamond pickaxe, we can use this property.

Note: Minecraft NBT String must contain item name. It also must be in correct format (1.20.5 changed format of NBT String i.e. in give command)

Example:

faces property

Support for block with multiple faces i.e. mushroom blocks.

Example:

age property

Age of Ageable material i.e. age of planted carrot

Example:

progress property

Added progress property (similar to old special-progress section). It's multiplier of progress.

Example:

In this case, diamond gives 3 progress instead of 1.

special-progress is still available for cases where we can't use progress property, i.e. in blacklists

PAPI conditions

If you have PlaceholderAPI installed, you can use variables conditions to have more control over when player can progress quest.

There are 2 types of conditions:

  • or (same as || in Java) - player must meet at least one condition to progress

  • and (same as && in Java) - player must meet all conditions to progress

Example:

In this case, action will progress only when the player is op OR has level greater than 10.

Last updated

Was this helpful?