# BuiltByBit Username Resolution Source: https://docs.mclicense.org/builtbybit-api-token Provide a BuiltByBit API token to display real usernames on your licenses instead of raw user IDs. ## Overview By default, licenses created through the BuiltByBit marketplace integration display the buyer's numeric user ID. Providing a BuiltByBit API token allows MC License to resolve those IDs into real usernames automatically — both for new licenses as they come in, and for any existing ones via a one-time backfill. A BuiltByBit **Ultimate** membership is required to access the API and generate tokens. ## Creating a token Head to your BuiltByBit API token page: **[https://builtbybit.com/account/api/](https://builtbybit.com/account/api/)** Create a new token with the following details: * **Name** — anything that helps you identify it (e.g. `MC License`) * **Project name** — your project or organisation name * **Type** — must be set to **Private key** * **Allow use with our V1 endpoints** must be selected Once created, copy the token. ## Adding the token to MC License Head to the [Keys](https://dash.mclicense.org/keys) page in your dashboard and find the **BuiltByBit API Token** section. Click **Set Token**, paste your token in, and save. As soon as you save, MC License will kick off a background backfill that resolves usernames on all your existing BuiltByBit licenses. Any new licenses created after this point will have their username resolved automatically. # Discord Bot Source: https://docs.mclicense.org/discord-bot Learn how to use the MC License Discord Bot to manage your Minecraft plugin licenses from your own Discord server. ## Getting Started Add the MC License bot to your Discord server to manage your plugin licenses directly through Discord. To add the bot: 1. Use this link 2. Select the server you would like to add it to 3. Follow Discord's server authorisation process ## Linking Your Discord Account Before using the bot, you'll need to link your Discord account with your MC License dashboard account: 1. Navigate to your [Account](https://dash.mclicense.org/account) page 2. Locate the 'Connected Accounts' section 3. Click 'Connect' next to Discord and follow the authentication flow Linking your Discord account is required to ensure secure access to your licenses through the bot. ## Commands ### Creating a New License The `/createlicense` command allows you to generate new licenses for your plugins through an interactive interface. All license creation interactions are ephemeral, meaning only you can see them. #### Steps to Create a License: 1. Type `/createlicense` in any channel 2. A dropdown menu will appear showing your available plugins 3. Select the plugin you want to create a license for 4. Fill out the license details in the modal: * **User**: The user who will be assigned the license, as a string * **Max IPs**: Maximum number of IP addresses allowed to use this license, as an integer * **Expiry Date**: When the license will expire When setting the expiry date, use the format DD/MM/YYYY (e.g. 01/01/2024). ### Editing an Existing License Use the `/editlicense` command to modify the details of an existing license. #### Command Usage: ```bash theme={null} /editlicense ``` #### Parameters: * `licenseKey`: The license key that you'd like to edit After entering the command with a valid license key, a modal will open allowing you to update: * **User**: The user who will be assigned the license, as a string * **Max IPs**: Maximum number of IP addresses allowed to use this license, as an integer * **Expiry Date**: When the license will expire Make sure you have the necessary permissions to edit licenses before using this command. ## Best Practices * Keep your license keys secure and don't share them publicly * Regularly review active licenses to ensure they're assigned to the correct users * Set appropriate IP limits based on your plugin's intended use case * Consider setting reasonable expiration dates to maintain control over license distribution ## Troubleshooting If you encounter any issues: * Verify the bot has the necessary permissions in your Discord server * Ensure you're using the correct command syntax * Check that the license key exists when using `/editlicense` * Contact support if you continue experiencing problems # End User License Checker Source: https://docs.mclicense.org/end-user-license-checker MC License offers a publicly available end user license checker: [https://mclicense.org/check](https://mclicense.org/check) To look up a license, buyers will need to enter: * **Plugin ID** — the 8-character ID found in the dashboard URL (e.g. `9qxwb0cf`) * **License Key** — their license key When a key is found, it will return its validity status, expiration date and active server count. For security reasons, it does not provide additional data which the plugin author has access to, such as the plugin itself or the user field. Please feel free to share this page with your buyers so that they need not bug you to retrieve information about their license. # Introduction Source: https://docs.mclicense.org/introduction This documentation demonstrates how to hook up your plugin to MC License. ## Join the Discord Join the community on Discord to get help, share your work, and stay up to date. ## Getting started Learn how to integrate a license check into your plugin. # License Check Source: https://docs.mclicense.org/license-check This page shows how to integrate MC License into your plugin. ## Adding the library We offer two ways to add MC License to your plugin: **Option 1 — Dependency (recommended)** Add the following repository and dependency to your build file: ```xml Maven (pom.xml): theme={null} flyte-repository-releases Flyte Repository https://repo.flyte.gg/releases org.mclicense library 1.5.1 compile ``` ```groovy Gradle (build.gradle): theme={null} // Repository maven { url "https://repo.flyte.gg/releases" } // Dependency implementation "org.mclicense:library:1.5.1" ``` ```kotlin Gradle Kotlin DSL (build.gradle.kts): theme={null} // Repository maven("https://repo.flyte.gg/releases") // Dependency implementation("org.mclicense:library:1.5.1") ``` **Option 2 — Single class (copy/paste)** If you're having trouble shading the library into your plugin, or simply prefer not to manage external dependencies, you can copy a single class directly into your project instead. Head to the [mcl-library-one-class](https://github.com/flytegg/mcl-library-one-class) repo and copy either `MCLicense.java` or `MCLicense.kt` into your project. No shading needed — all required dependencies are already on the Paper server classpath at runtime. With the single-class approach you'll need to manually check that repo for updates, rather than just bumping a version number in your build file. ## Checking a license Each license check requires two things: the `pluginId` and the license `key`. The pluginId is a unique identifier for your plugin, and the license key is the key that the user has set in the `mclicense.txt` file in your plugin's folder (the library will create this file). You'll need the `pluginId` for the validate function. To find it, head to the plugin on your dashboard and copy the random string of characters from the URL. It'll look something like this: `3gd7u9r4` (8 characters). To validate a license in your plugin, simply add the following code snippet to your `onEnable`: ```java Java theme={null} if (!MCLicense.validateKey(this, "yourPluginId")) { Bukkit.getPluginManager().disablePlugin(this); return; } ``` ```java Kotlin theme={null} if (!MCLicense.validateKey(this, "yourPluginId")) { return Bukkit.getPluginManager().disablePlugin(this) } ``` As you can see, the `validateKey` function returns a Boolean. In the above code snippet, if the key is invalid, the plugin will be disabled. If the key is valid, the plugin will continue to load. The library will handle the console logging for you, whether successful or rejected. ## Not building a Minecraft plugin? MC License isn't limited to Minecraft plugins — you can protect any software that can make HTTP requests. Check out our guide for [non-Minecraft use cases](/non-minecraft-plugins). # BuiltByBit Source: https://docs.mclicense.org/marketplace/builtbybit This page will show how to setup integration with BuiltByBit so that users can automatically receive their license keys upon purchase. ## How it works When a user downloads your premium resource, BuiltByBit will securely request a license key to insert into the jar from the MC License API. This then becomes an MC License managed license, meaning you can modify it in your dashboard and enforce settings. When the plugin gets enabled for the first time, validation takes place as normal. This means that no intervention is required on your part to manage licenses, nor on the user’s part to request their license key. From the moment a user purchases your resource, they will have a license key ready to use infused into their plugin. ## Setup Firstly, generate a BuiltByBit Webhook Secret on the dashboard. This can be done through the [Keys](https://dash.mclicense.org/keys) page on the dashboard. It will look like this: title Next, head to the BuiltByBit Placeholders page: [https://builtbybit.com/placeholders/](https://builtbybit.com/placeholders/) Create a placeholder with the following details: * Placeholder: `%%__BBB_LICENSE__%%` * Type: `External license key` * URL: `https://api.mclicense.org/builtbybit` * Secret: The secret you generated on the dashboard ## Integration Create a plugin using your BuiltByBit resource URL in the dashboard. Integration into your code is the exact same as the standard [license check](/license-check). That's it! MC License will now automatically manage licenses for your BuiltByBit resource and your users will get instant, licensed access after purchase. # Tebex Source: https://docs.mclicense.org/marketplace/tebex This page will show how to setup integration with Tebex so that users automatically receive their license keys via email upon purchase. ## How it works Tebex does not support inserting placeholders into downloadable files, so the delivery flow works differently to BuiltByBit and Voxel Shop (Polymart). When a user completes a purchase on your Tebex store, Tebex tells MC License. MC License then creates a license key for that user and emails it directly to the email address they used at checkout. The license becomes an MC License managed license, meaning you can view, modify, and revoke it from your dashboard at any time. This means that no intervention is required on your part to manage licenses, nor on the user’s part to request their license key. From the moment a user purchases your resource, they will have a license key ready to use in their email inbox. ## Setup Firstly, head to [https://creator.tebex.io/webhooks](https://creator.tebex.io/webhooks), copy your webhook secret key, and paste it into the [Keys](https://dash.mclicense.org/keys) page on the dashboard. It will look like this: Next, copy the Endpoint generated by MC License. It will look like this: `https://api.mclicense.org/tebex/[userid]` In the same webhooks page, click `Add Endpoint`. Paste the URL and ensure `Payment Completed` is type is checked. ## Integration Create a plugin using your intended Tebex Package ID in the dashboard. Integration into your code is the exact same as the standard [license check](/license-check). That’s it! MC License will now automatically manage licenses for your Tebex resource and your users will get instant, licensed access after purchase. # Voxel Shop (Polymart) Source: https://docs.mclicense.org/marketplace/voxel-shop This page will show how to setup integration with Voxel Shop (Polymart) so that users can automatically receive their license keys upon purchase. ## How it works When a user downloads your premium resource, Voxel Shop (Polymart) inserts placeholders into the download file. When the plugin gets enabled for the first time, attempted validation takes place and MC License verifies the license key with Voxel Shop's API using your provided API key to verify its validity. If valid, then this becomes an MC License managed license, meaning you can modify it in your dashboard and enforce settings. This means that no intervention is required on your part to manage licenses, nor on the user's part to request their license key. From the moment a user purchases your resource, they will have a license key ready to use infused into their plugin. ## Integration Firstly, create a plugin using your Voxel Shop (Polymart) resource URL in the dashboard. Then, you need to add your Voxel Shop (Polymart) API key to your MC License account. This can be done through the [Keys](https://dash.mclicense.org/keys) page on the dashboard. It will look like this: title Integration into your code is the exact same as the standard [license check](/license-check). That's it! MC License will now automatically manage licenses for your Voxel Shop (Polymart) resource and your users will get instant, licensed access after purchase. [//]: # "## Video" [//]: # "If you'd prefer to watch how to integrate this, check out this video:" [//]: # [//]: # "X" # Non-Minecraft Plugins Source: https://docs.mclicense.org/non-minecraft-plugins Learn how to use MC License to protect non-Minecraft plugins and software. While MC License is aimed at Minecraft plugin developers, we understand that there are other use cases for our service. These instructions show how to setup product licensing generically using MC License, which could be applied to any project, such as a Discord bot. ## Integration Your project can be supported exactly as normal by creating a plugin in the dashboard. However, instead of using the library for Minecraft plugins, you should send your own request to the validation endpoint from your product (what the `mcl-library` does under the hood). Our API publicly exposes this validation endpoint. You need only make a `GET` request to this endpoint with the required information. As shown in the spec, the `pluginId` and `key` are path parameters and must be provided, as these are the core of any product licensing system. There are two query parameters which must be provided, though you are not required to utilize them. * `sessionId` - This is used to power the server tracking feature. In a Minecraft plugin, the library sends off a random UUID representing the session, which periodically sends a heartbeat so that MC License can record active server analytics. This is useful for session-based systems. * `nonce` - This is a random UUID which should be generated per request. Since the response from the API is signed, through verifying the signature & nonce validation you can confirm the authenticity of the response. This is only necessary when your product is running on untrusted machines, as Minecraft plugins do by nature. Learn more. The system has been designed so that, while MC License is designed for Minecraft plugins, it can be easily integrated into any other product. # Blacklist an IP Source: https://docs.mclicense.org/public-api/blacklists/create POST /blacklists Adds an IPv4 address to the blacklist, preventing it from validating any license on your account # Remove Blacklist Entry Source: https://docs.mclicense.org/public-api/blacklists/delete DELETE /blacklists/{id} Removes an IP address from the blacklist # Get Blacklist Entry Source: https://docs.mclicense.org/public-api/blacklists/get GET /blacklists/{id} Retrieves a specific blacklist entry by its ID # List Blacklisted IPs Source: https://docs.mclicense.org/public-api/blacklists/list GET /blacklists Returns all blacklisted IP addresses for the authenticated account # Update Blacklist Entry Source: https://docs.mclicense.org/public-api/blacklists/update PATCH /blacklists/{id} Updates the IP address or reason for an existing blacklist entry # Delete License Source: https://docs.mclicense.org/public-api/licenses/delete DELETE /licenses/{licenseKey} Permanently removes a license key and invalidates it for future use # Get License Source: https://docs.mclicense.org/public-api/licenses/get GET /licenses/{licenseKey} Retrieves detailed information about a specific license by its key # Update License Source: https://docs.mclicense.org/public-api/licenses/update PATCH /licenses/{licenseKey} Updates an existing license's parameters such as maximum IPs, expiration date, or user # Create Plugin Source: https://docs.mclicense.org/public-api/plugins/create POST /plugins Creates a new plugin with the specified details # Delete Plugin Source: https://docs.mclicense.org/public-api/plugins/delete DELETE /plugins/{pluginId} Permanently removes a plugin and all associated licenses # Get Plugin Source: https://docs.mclicense.org/public-api/plugins/get GET /plugins/{pluginId} Retrieves detailed information about a specific plugin by its ID # Create License Source: https://docs.mclicense.org/public-api/plugins/licenses/create POST /plugins/{pluginId}/licenses Generates a new license key for the specified plugin with the given parameters # List Licenses Source: https://docs.mclicense.org/public-api/plugins/licenses/list GET /plugins/{pluginId}/licenses Retrieves a list of all licenses associated with the specified plugin # List Plugins Source: https://docs.mclicense.org/public-api/plugins/list GET /plugins Returns all plugins associated with the authenticated account # Update Plugin Source: https://docs.mclicense.org/public-api/plugins/update PATCH /plugins/{pluginId} Updates an existing plugin's information such as name and icon # Validate License Source: https://docs.mclicense.org/public-api/validate/get GET /validate/{pluginId}/{key} Returns validation status for the provided license key # Security Source: https://docs.mclicense.org/security This page outlines the security measures implemented by MC License. MC License implements multiple layers of security to protect license validation and prevent unauthorized usage. Our library handles this automatically, but it's important to understand these security measures when implementing custom solutions or troubleshooting issues. To set the scene, when your plugin starts on a user's server, it'll send a request to the MC License validation API. Below is an example response: ```json theme={null} { "pluginId": "6712560768f39ad2a157b130a75", "message": "License is valid", "nonce": "81ac23b0-92d2-4edf-aeac-fbabd6b76a2b", "key": "119f1219-6180-4a38-9a6b-1cda33b44449", "status": "valid", "signature": "X8kL5NwP9yJ3qMvD7hRs2tBnF4uA6xZeYjW0mCQgKpT/vIi9SO+VfbE4UlNyH2cGaB8dX5wLrk1mPnQjYD9v7W3y0h6RoMvx4zKn2UbqNcF8tE5iJmLgVx9UcB/wSt4pHI7fD1eY9vQaBxCy3jn5kT8uOlX2mQdRp6c4hNZqWvALmUr1sPtI9ExbYw0gDmFiGvK5U8cTn2pH4AByZRe3xQkM9jW7VNt6PqwS1LdEvXn8OyC3QmKfHu9sY4TxJ0NpM2vR8Yk5BwPcXLq7t96NOcz4qDhB3eWi1m9kUxE6vGf4nPs5i2wYx8KrjTlQ8cH0pBv4Ny1UaJmRz3s==" } ``` ## RSA Signature Verification Every response from our API is cryptographically signed using RSA, a robust asymmetric encryption algorithm. This signature is used to verify the authenticity of the response and ensure that it hasn't been tampered with. Here's how it works: 1. Our server signs the response data using a private key that only we possess 2. Your plugin verifies the signature using our public key 3. If the response data has been tampered with, the signature verification will fail. If someone tries to: * Modify any field in the response * Forge a response with a different signature * Reuse an old signature with new data The signature verification will fail and the license check will be rejected. ## Nonce Validation A nonce is a unique identifier that is generated for each request. It's used to prevent replay attacks, where an attacker intercepts a valid response and sends it multiple times to bypass the license check. Here's how it works: 1. Your plugin generates a random UUID to use as the nonce and includes it in the validation request 2. The MC License server receives the request with your nonce and includes the exact same nonce in its response 3. The server signs the response data which includes the nonce 4. Your plugin verifies that the response contains exactly the same nonce it sent 5. If the nonces don't match, the response is rejected. Together with RSA signature verification, this ensures that responses are both authentic (from our server) and can only be used once (not replayed). ## Status Codes Every validation response includes a `status` field indicating the outcome of the license check. | Status | Description | | - | - | | `valid` | License is valid and active | | `invalid_format` | License key does not match the expected format (alphanumeric + hyphens, max 36 chars) | | `not_found` | No license exists for the provided key and plugin ID | | `expired` | License has passed its expiration date | | `max_ips` | License has exceeded the maximum number of allowed IP addresses | | `blacklisted` | License key has been blacklisted | | `disabled` | License has been manually disabled by the plugin owner | | `invalid_polymart` | License failed Voxel Shop (Polymart) ownership verification | | `server_error` | An internal server error occurred during validation | # Support Source: https://docs.mclicense.org/troubleshooting Get help in Discord. For support, join our Discord: Open Discord support. # Billing Source: https://docs.mclicense.org/video/billing