Getting started
Getting started with bucket variables starts with creating a namespace, learn about them in this page.
Namespaces
Section titled “Namespaces”To use bucket variables, you must first create a namespace.
The name of the namespace must be globally unique across DiamondFire.
As the namespace owner, you control which plots have access to your namespace.
Once your plot has access to a namespace, you’ll need to add it to your plot and assign an alias.
Namespace Aliases
Section titled “Namespace Aliases”Namespace aliases are set per-plot, and are how you refer to namespaces in your code; this does not need to be unique across DiamondFire, so choose whatever is convenient.
Creating a Namespace
Section titled “Creating a Namespace”To create a namespace and give your current plot access to it, you can use:
/plot namespace create <namespace> <alias>If you want other plots to have access to the namespace, you can add them with:
/namespace whitelist add <namespace> [plot]Bucket Variables
Section titled “Bucket Variables”To load (or create) a bucket, use the Load Bucket action in the Set Variable block. (Note: This is a Suspending action). Once the bucket is loaded, you can use bucket variable items just like standard saved var items. You can save the values persistently using the Save Bucket action, and unload the bucket using the Save and Unload Bucket action.
Each bucket var will reference a namespace and a bucket name. You can get bucket vars with:
/bvar [namespaceAlias] <bucket> <name> [amount]Recommended Usage
Section titled “Recommended Usage”The most common use of bucket variables is per-player data, with each player having a bucket. You Load the bucket (for example data-%uuid) on player join, Save it periodically, then Unload when the player quits.