Export & Syncing

A quick explanation on export and syncing works

Before you run the export command, understand that you will likely receive no support when editing the voucher file directly as the GUI editor is the intended way.

  • /Vouchers export confirm - This will export all the currently created vouchers into a vouchers folder. Each voucher will be created as a json file. Example "money.json, rank1.json" etc.

  • /Vouchers sync <voucherId/*> - This will allow you to sync all or a specific voucher/file back into vouchers. If you create a new voucher file and it does not exists in the Voucher's database, Vouchers will attempt to create and save it assuming you configured the file correctly.

Important Sync Information

When running the sync command, it WILL OVERRIDE the settings of any voucher(s) in the database that shares the id. It's suggested that you add all your item rewards first in game, then run the export command since it's easier to configure items that way. But if you are comfortable editing items as json, knock yourself out.

Example Voucher File

This is an example voucher file with all the possible options filled in. Depending on how you setup your voucher initially, you might be missing title/subtitle or more options. Use this a reference if you want to add something.

example.json

{
  "item": "CAKE",
  "displayName": "&bExample Voucher",
  "description": [
    "§ethis is line #1",
    "§bthis is another line"
  ],
  "rewardMode": "AUTOMATIC",
  "maxUses": -1,
  "cooldown": -1,
  "removeOnUse": true,
  "askForConfirm": true,
  "glowing": false,
  "requirePermission": true,
  "permission": "vouchers.usevoucher",
  "playSound": true,
  "sound": "ENTITY_EXPERIENCE_ORB_PICKUP",
  "broadcastMessages": [
    "&bExample broadcast mesage",
    "&e%player% &7use a voucher"
  ],
  "chatMessages": [
    "&7Example chat message to player",
    "&eOnly you can see this"
  ],
  "actionbarMessages": [
    "&aSingle message for the action bar"
  ],
  "titleMessage": {
    "message": "§eTitle Message",
    "fadeIn": 20,
    "stay": 40,
    "fadeOut": 20
  },
  "subtitleMessage": {
    "message": "§eSubtitle Message",
    "fadeIn": 20,
    "stay": 40,
    "fadeOut": 20
  },
  "rewards": [
    {
      "type": "COMMAND",
      "chance": 100.0,
      "delay": 0,
      "command": "eco give %player% 5000",
      "claimMessage": ""
    },
    {
      "type": "COMMAND",
      "chance": 100.0,
      "delay": 0,
      "command": "give %player% cake 1",
      "claimMessage": "&aYou received cake"
    },
    {
      "type": "ITEM",
      "chance": 100.0,
      "delay": 0,
      "item": "{count:1,id:\"minecraft:cake\"}"
    },
    {
      "type": "ITEM",
      "chance": 100.0,
      "delay": 0,
      "item": "{count:1,id:\"minecraft:sugar\"}"
    }
  ]
}

Last updated