Skip to content

Repository

Since UnderscoreEnchants is built to be community-powered and configurable to the core, a central repository exists where people can upload and download enchantments, enchantment packs and localization files. As of 2.2, there's no frontend for the repository, only a REST API.

REST API routes

As of 2.2, the latest API version is v1.

The routes below assume the prepended path https://ue.runderscore.com/api/v1/.

Route Method Arguments Description
enchs GET none Returns all enchantments in the repository
packs GET none Returns all enchantment packs in the repository
locales GET none Returns all locales in the repository
download_enchantment GET ID Downloads the enchantment by its ID
download_pack GET ID Downloads the pack by its ID
download_locale GET ID Downloads the locale by its ID
upload_enchantment POST .json file Uploads an enchantment to the repository. Returns its ID and a unique code
upload_pack POST .tar file Uploads an enchantment pack to the repository. Returns its ID and a unique code
upload_locale POST .json file Uploads a locale to the repository. Returns its ID and a unique code
update_enchantment POST .json file, ID, unique code Updates an enchantment
update_pack POST .tar file, ID, unique code Updates an enchantment pack
update_locale POST .json file, ID, unique code Updates a locale

Retrieving (GET)

/enchs

Example output:
[
  {
    "identifier": 2,
    "name": "Test",
    "material": "DIAMOND_BOOTS",
    "author": "Roughly_",
    "description": [
      ""
    ],
    "key": {
      "plugin": "UnderscoreEnchants",
      "key": "test"
    },
    "activationChance": 100,
    "cooldown": {
      "amount": 0,
      "unit": "TICKS"
    },
    "trigger": "gothurt",
    "indicator": "msg",
    "applicables": [
      "feet"
    ],
    "forbiddenMaterials": [],
    "conditions": [
      {
        "name": "cause",
        "negate": false,
        "target": "first",
        "arguments": [
          "falling"
        ]
      },
      {
        "name": "dmg",
        "negate": false,
        "target": "first",
        "arguments": [
          ">",
          "3"
        ]
      }
    ],
    "conflicts": [],
    "levels": [
      {
        "index": 1,
        "conditions": [
          {
            "name": "damage",
            "negate": true,
            "target": "first",
            "arguments": [
              "lethal"
            ]
          }
        ],
        "chance": 100,
        "cooldown": {
          "amount": 300,
          "unit": "MILLISECONDS"
        },
        "actions": []
      }
    ],
    "seekers": [
      "feet"
    ],
    "restrictions": [],
    "unique": false,
    "requiredEnchantments": [],
    "worldBlacklist": [],
    "worldWhitelist": [],
    "requiredPlugins": [
      {
        "pluginName": "ChestSort",
        "displayName": "ChestSort by mfnalex",
        "link": "https://www.spigotmc.org/resources/59773/"
      }
    ],
    "meta": {
      "type": "ench",
      "downloadedTimes": 18,
      "id": 2
    }
  }
]

/packs

Example output:
[
  {
    "identifier": 1,
    "metadata": {
      "name": "Bestest pack",
      "version": "1.0",
      "authors": [
        "Roughly_"
      ],
      "description": [],
      "website": "",
      "worldBlacklist": [],
      "worldWhitelist": [],
      "material": "DIAMOND",
      "meta": {
        "type": "pack",
        "downloadedTimes": 6,
        "id": 1
      }
    },
    "enchantments": [
      {
        "identifier": 0,
        "name": "ABCDEF",
        "material": "DIAMOND_BOOTS",
        "author": "Roughly_",
        "description": [
          "This enchantment is not in a pack"
        ],
        "key": {
          "plugin": "UnderscoreEnchants",
          "key": "abcdef"
        },
        "activationChance": 100,
        "cooldown": {
          "amount": 0,
          "unit": "TICKS"
        },
        "trigger": "gothurt",
        "indicator": "msg",
        "applicables": [
          "feet"
        ],
        "forbiddenMaterials": [],
        "conditions": [
          {
            "name": "cause",
            "negate": false,
            "target": "first",
            "arguments": [
              "falling"
            ]
          },
          {
            "name": "dmg",
            "negate": false,
            "target": "first",
            "arguments": [
              ">",
              "3"
            ]
          }
        ],
        "conflicts": [],
        "levels": [
          {
            "index": 1,
            "conditions": [
              {
                "name": "damage",
                "negate": true,
                "target": "first",
                "arguments": [
                  "lethal"
                ]
              }
            ],
            "chance": 100,
            "cooldown": {
              "amount": 300,
              "unit": "MILLISECONDS"
            },
            "actions": []
          }
        ],
        "seekers": [
          "feet"
        ],
        "restrictions": [],
        "unique": false,
        "requiredEnchantments": [],
        "worldBlacklist": [],
        "worldWhitelist": [],
        "requiredPlugins": []
      }
    ]
  }
]

/locales

Example output (truncated):
[
  {
    "locale": {
      "localeIdentifier": "tr_TR",
      "mapping": {
        "yes": "yes",
        "no": "no",
        "started": "Started <action>.",
        "finished": "Finished <action>. Took <ms>ms.",
        "populatingRegistry": "populating the registry",
        "initializingConnection": "initializing the connection data",
        "initializingData": "initializing the data storage",
        "preparingMetrics": "preparing the bStats metrics",
        "checkingUpdates": "setting up the update checker",
        "creatingTasks": "creating the tasks",
        "registeringListeners": "registering the listeners",
        "initializingCommands": "initializing the commands",
        "initializingEconomy": "initializing the economy handler",
        "registeringEnchantments": "registering the enchantments",
        "addingReadme": "adding README if necessary",
        "implementingApi": "implementing the API",
        "startingRetrofit": "starting Retrofit for networking",
        "initialized": "<plugin> was successfully initialized in <ms>ms.",
        "reportBugsHere": "Please report any bugs here: https://discord.gg/bBge7bj3ra",
        "reviewRequest": "An honest review will go a long way: <link>",
        "thanksForUsingUe": "Thanks for using UnderscoreEnchants!",
        "invalidConnection": "&cVeri tabanına bağlanılamadı. Lütfen bilgilerini kontrol edip, sunucunuzu yeniden başlatın ve tekrar deneyin.",
        "noPermissions": "&cBu eylemi gerçekleştirmek için gerek yetkiye sahip değilsin.",
        "notForConsole": "&cBu komut konsol için mevcut değil.",
        "uiNext": "&eNext",
        "uiPrevious": "&ePrevious",
        "uiBack": "&eBack",
        "uiClose": "&cClose",
        "uiBrowsingSortByDownloads": "Sort by downloads",
        "uiBrowsingSortByName": "Sort by name",
        "uiBrowsingSortByAuthor": "Sort by author",
        "uiBrowsingSortByAmount": "Sort by amount",
        "uiBrowsingDownloaded": "&eDownloaded: &b<amount> times",
        "uiBrowsingClickToToggle": "&eClick to toggle",
        "uiStateOn": "&a&lON",
        "uiStateOff": "&c&lOFF",
        "uiBrowsingClick": "&a&lClick to download",
        "uiBrowsingShiftClick": "&a&lShift + Click to download & load",
        ...
      }
    },
    "meta": {
      "type": "locale",
      "downloadedTimes": 1,
      "id": 1
    }
  }
]

Downloading (GET)

/download_enchantment

Takes an ID. Possible outcomes:
  • Missing ID
  • Enchantment not found or No enchantment with ID <id> found
  • Failed to update download count
  • Downloaded + file

/download_pack

Takes an ID. Possible outcomes:
  • Missing ID
  • Pack not found or No pack with ID <id> found
  • Failed to update download count
  • Downloaded + file

/download_locale

Takes an ID. Possible outcomes:
  • Missing ID
  • locale not found or No locale with ID <id> found
  • Failed to update download count
  • Downloaded + file

Uploading/updating

When you upload any sort of content to the repository, you want to be able to edit it later. It might happen because you'll become dissatisfied with the quality of the upload, or you'll decide to add some balancing tweaks, or, for better or for worse, the expected syntax of the content you uploaded changes or receives new additions. For this purpose, unique codes are used.

Upon uploading something, you receive this as the return message (example):

Uploaded enchantment with ID 176. Your unique code is 3m7raifMEI9d03kma462lekY. Do not lose it.

The unique code is created in order to verify the uploader of the content. This way, you can only modify what you have uploaded. As of v2.2, this is the only way to differentiate uploaded content; in the future, when the frontend for the UnderscoreEnchants is created, there might be an account system for easier content management.

Uploading (POST)

/upload_enchantment

Takes a file. Possible outcomes:
  • No file found
  • Invalid file type (expects .json)
  • Too large (limit: 1MB)
  • Invalid enchantment syntax
  • Enchantment with name <name> already exists
  • Uploaded enchantment with ID <id>. Your unique code is <code>. Do not lose it.

/upload_pack

Takes a file. Possible outcomes:
  • No file found
  • Invalid file type (expects .tar)
  • Too large (limit: 1MB)
  • Invalid pack syntax
  • Pack with name <name> already exists
  • Uploaded pack with ID <id>. Your unique code is <code>. Do not lose it.

/upload_locale

Takes a file. Possible outcomes:
  • No file found
  • Invalid file type (expects .json)
  • Too large (limit: 1MB)
  • Invalid locale syntax
  • Locale with name <name> already exists
  • Uploaded locale with ID <id>. Your unique code is <code>. Do not lose it.

Updating (POST)

/update_enchantment

Takes a file, an ID and the unique code. Possible outcomes:
  • No original ID provided
  • No uploader code provided
  • No file found
  • Invalid file type (expects .json)
  • Too large (limit: 1MB)
  • Invalid enchantment syntax
  • No enchantment with ID <id> found
  • Could not find enchantment content (failed to retrieve the old enchantment)
  • The new enchantment name <name> does not match the old enchantment name <name>
  • The code <code> does not match the hash
  • Updated

/update_pack

Takes a file, an ID and the unique code. Possible outcomes:
  • No original ID provided
  • No uploader code provided
  • No file found
  • Invalid file type (expects .tar)
  • Too large (limit: 1MB)
  • Invalid pack syntax
  • No tar with ID <id> found
  • Could not find pack content (failed to retrieve the old pack)
  • The new pack name <name> does not match the old pack name <name>
  • The code <code> does not match the hash
  • Updated

/update_locale

Takes a file, an ID and the unique code. Possible outcomes:
  • No original ID provided
  • No uploader code provided
  • No file found
  • Invalid file type (expects .json)
  • Too large (limit: 1MB)
  • Invalid locale syntax
  • No locale with ID <id> found
  • Could not find locale content (failed to retrieve the old locale)
  • The new locale name <name> does not match the old locale name <name>
  • The code <code> does not match the hash
  • Updated