# Welcome

Welcome to the official wiki for Demeng's software. Here, you can find usage instructions as well as the most frequently asked questions.

Please select the software which you wish to view the wiki of below.

{% content-ref url="/pages/-Me72c74G0RNwIbY\_44H" %}
[GrantX](/grantx/overview)
{% endcontent-ref %}

{% content-ref url="/pages/-MgSSKsa4vBGesxA7gaW" %}
[Embeddy](/embeddy/overview)
{% endcontent-ref %}

## Live Support

Can't find what you're looking for? Contact our dedicated support team by creating a ticket on [Discord](https://demeng.dev/discord).


# GrantX

GrantX is a permission management plugin that allows you to grant and revoke player ranks within a GUI system. The add-on renders servers with a variety of unique features including rank reasons, grant logs, confirmation menus, and much more. With ample customization access, GrantX is the future of permission management!

**Website:** <https://demeng.dev/grantx>\
**SpigotMC:** [https:/spigotmc.org/resources/77557](https://www.spigotmc.org/resources/%E2%98%84%EF%B8%8F-grantx-revolutionize-permission-management-grant-grants-%E2%98%84%EF%B8%8F.77557/)\
**BuiltByBit:** <https://builtbybit.com/resources/grantx.14185/>


# Installation

## Prerequisites

* Java 8 or above.
* Spigot server for Minecraft 1.8 or above. Forks, such as Paper and Pufferfish are supported.
* [Vault](https://dev.bukkit.org/projects/vault) plugin.
* Vault-hooked permissions plugin ([LuckPerms](https://www.spigotmc.org/resources/luckperms.28140/) is highly recommended).

### Optional

* [PlaceholderAPI](https://www.spigotmc.org/resources/placeholderapi.6245/) plugin, if you wish to use PAPI placeholders in menus or messages.

## Basic Installation

1. Download GrantX from SpigotMC or BuiltByBit.
2. Move the JAR file into the "plugins" folder of your server directory.
3. Restart your server. GrantX will be disabled if this is your first time installing the plugin.
4. Go to settings.yml in GrantX's config directory and find the "commands" section.
5. Follow the comments to set the required commands. You can also contact our support team for premade commands for popular permissions plugins including LuckPerms, UltraPermissions, PermissionsEx, and GroupManager.
6. Restart your server again. GrantX should now be enabled!


# Commands

Commands and permission nodes.

### /grantx

**Description:** Base command, displays plugin information.

### /grantx help

**Description:** Displays a list of commands.

### /grantx editor

**Description:** Opens the in-game rank, server, duration, and reason editor.\
**Permission:** grantx.editor

### /grantx logs \[issuer]

**Description:** Opens the grant logs menu. Specifying a player will only show grants issued by that specific player. Otherwise, all issued grants will be shown.\
**Permission:** grantx.logs

### /grantx delete

**Description:** Permanently deletes the grant with the specified ID from the database.\
**Permission:** grantx.delete

### /grantx import

**Description:** Import ranks from your permissions plugin into GrantX.\
**Permission:** grantx.import

### /grantx addProtection {player}

**Description:** Prevent other people from granting the specified player and viewing their previous grants.\
**Permission:** grantx.addprotection

### /grantx removeProtection {player}

**Description:** Remove protection from the specified player.\
**Permission:** grantx.removeprotection

### /grantx updateCache

**Description:** Forcibly update the local player cache on the current server.\
**Permission:** grantx.updatecache

### /grantx reload

**Description:** Reloads all configuration files.\
**Permission:** grantx.reload

### /grant \[player] \[rank] \[server] \[duration] \[reason]

**Description:** Issue a new grant. If no player argument is provided, player selector will open. If the player name is the only argument, the normal grant GUI will open. If rank, server, duration, and reason are all provided, there will be no GUI or confirmation and the grant will be forcibly activated.\
**Permission:** grantx.grant

### /grants \[player]

**Description:** View the specified player's grant history. If no player is specified, player selector will open first.\
**Permission:** grantx.grants

## Standalone Permissions

These permissions are not directly related to any commands.

### grantx.bypassprotection

**Description:** Bypass any protection a player may have.

### grantx.revoke.(rank)

**Description:** Permission to revoke ranks with the specified ID in grant history menus.


# Configuration

## Materials

Since GrantX is heavily based on GUI menus, there are many cases in the configuration files where you need to enter a material name. GrantX uses the XSeries library for compatibility with multiple Minecraft versions. [**Click here**](https://github.com/CryptoMorin/XSeries/blob/master/src/main/java/com/cryptomorin/xseries/XMaterial.java) for a list of valid materials. Ignore content inside the parentheses.

## Placeholders

A list of placeholders you can use in configuration files. Some placeholders may return the word "not applicable" if it is not available (ex. %revoke-time% will return N/A if the grant has not been revoked yet).

### Grant Placeholders

| Placeholder             | Description                                                                         |
| ----------------------- | ----------------------------------------------------------------------------------- |
| %id%                    | The unique identifier of the grant.                                                 |
| %status%                | The current status of the grant (Active, Expired, or Revoked).                      |
| %time%                  | The formatted date and time of when the grant was activated.                        |
| %date%                  | The formatted date (no time) of when the grant was activated.                       |
| %target%                | The username of the grant target player.                                            |
| %target-uuid%           | The UUID of the target.                                                             |
| %issuer%                | The username of the grant issuer player (or the word "console").                    |
| %issuer-uuid%           | The UUID of the issuer.                                                             |
| %revoker%               | The username of the grant revoker player.                                           |
| %revoker-uuid%          | The UUID of the revoker.                                                            |
| %revoke-time%           | The time of when the grant was revoked.                                             |
| %expiration%            | The time of which the grant will expire (or the word "never").                      |
| %rank-{placeholder}     | Use any rank placeholder by adding the **rank-** prefix to the placeholder.         |
| %server-{placeholder}   | Use any server placeholder by adding the **server-** prefix to the placeholder.     |
| %duration-{placeholder} | Use any duration placeholder by adding the **duration-** prefix to the placeholder. |
| %reason-{placeholder}   | Use any reason placeholder by adding the **reason-** prefix to the placeholder.     |

### Rank Placeholders

| Placeholder                 | Description                                             |
| --------------------------- | ------------------------------------------------------- |
| %id%                        | The unique identifier of the rank.                      |
| %type%                      | The type of rank- Rank or Permission.                   |
| %real-name%                 | The real name (group/node) of the rank.                 |
| %weight%                    | The weight of the rank.                                 |
| %slot%                      | The slot of the rank.                                   |
| %material%                  | The name of the material representing the rank.         |
| %display-name%              | The display name of the rank.                           |
| %stripped-display-name%     | The display name of the rank, without color.            |
| %lore-type%                 | The type of lore- Default, Custom, None.                |
| %permission%                | The permission required to choose the rank.             |
| %dummy%                     | If this rank is a dummy- Yes or No.                     |
| %grantable%                 | If this rank is grantable. Exact opposite of dummy.     |
| %glow%                      | If this rank will glow in GUIs- Yes or No.              |
| %blacklisted-servers%       | The servers where this rank cannot be chosen.           |
| %blacklisted-servers-count% | The number of servers where this rank cannot be chosen. |

### Server Placeholders

| Placeholder             | Description                                         |
| ----------------------- | --------------------------------------------------- |
| %id%                    | The unique identifier of the rank.                  |
| %real-name%             | The real name (group/node) of the rank.             |
| %weight%                | The weight of the rank.                             |
| %slot%                  | The slot of the rank.                               |
| %material%              | The name of the material representing the rank.     |
| %display-name%          | The display name of the rank.                       |
| %stripped-display-name% | The display name of the rank, without color.        |
| %lore-type%             | The type of lore- Default, Custom, None.            |
| %permission%            | The permission required to choose the rank.         |
| %dummy%                 | If this rank is a dummy- Yes or No.                 |
| %grantable%             | If this rank is grantable. Exact opposite of dummy. |
| %glow%                  | If this rank will glow in GUIs- Yes or No.          |

### Duration Placeholders

| Placeholder                 | Description                                             |
| --------------------------- | ------------------------------------------------------- |
| %id%                        | The unique identifier of the rank.                      |
| %time%                      | THe number of seconds this duration is worth.           |
| %weight%                    | The weight of the rank.                                 |
| %slot%                      | The slot of the rank.                                   |
| %material%                  | The name of the material representing the rank.         |
| %display-name%              | The display name of the rank.                           |
| %stripped-display-name%     | The display name of the rank, without color.            |
| %lore-type%                 | The type of lore- Default, Custom, None.                |
| %permission%                | The permission required to choose the rank.             |
| %dummy%                     | If this rank is a dummy- Yes or No.                     |
| %grantable%                 | If this rank is grantable. Exact opposite of dummy.     |
| %glow%                      | If this rank will glow in GUIs- Yes or No.              |
| %blacklisted-servers%       | The servers where this rank cannot be chosen.           |
| %blacklisted-servers-count% | The number of servers where this rank cannot be chosen. |

### Reason Placeholders

| Placeholder             | Description                                         |
| ----------------------- | --------------------------------------------------- |
| %id%                    | The unique identifier of the rank.                  |
| %weight%                | The weight of the rank.                             |
| %slot%                  | The slot of the rank.                               |
| %material%              | The name of the material representing the rank.     |
| %display-name%          | The display name of the rank.                       |
| %stripped-display-name% | The display name of the rank, without color.        |
| %lore-type%             | The type of lore- Default, Custom, None.            |
| %permission%            | The permission required to choose the rank.         |
| %dummy%                 | If this rank is a dummy- Yes or No.                 |
| %grantable%             | If this rank is grantable. Exact opposite of dummy. |
| %glow%                  | If this rank will glow in GUIs- Yes or No.          |


# Developer API

## Setting Up

### If you have not puchased GrantX

Go to <https://github.com/Demeng7215/GrantX-API> and import the latest release (or the release you want) into your IDE or build configuration.

### If you purchased GrantX

Simply import the actual plugin (GrantX's JAR) into your IDE or build configuration.

{% hint style="warning" %}
You cannot shade the API or compile it into your own JAR. The API is already provided in the actual plugin.
{% endhint %}

## Usage

### Events

There are currently 3 events in the API:

* [dev.demeng.grantx.api.event.GrantActivateEvent](https://github.com/Demeng7215/GrantX-API/blob/master/src/main/java/dev/demeng/grantx/api/event/GrantActivateEvent.java) - Called after a grant is confirmed.
* [dev.demeng.grantx.api.event.GrantExpireEvent](https://github.com/Demeng7215/GrantX-API/blob/master/src/main/java/dev/demeng/grantx/api/event/GrantExpireEvent.java) - Called after a grant expires.
* [dev.demeng.grantx.api.event.GrantRevokeEvent](https://github.com/Demeng7215/GrantX-API/blob/master/src/main/java/dev/demeng/grantx/api/event/GrantRevokeEvent.java) - Called after a grant revocation is confirmed.<br>

You can use these as you would with vanilla Bukkit events, as such:

```
public class MyAddonEvent implements Listener {
  @EventHandler
  public void onGrantActivate(GrantActivateEvent e) {
    // Code here
  }
}
```

As with normal events, you need to register the event in your onEnable method.

```
Bukkit.getPluginManager().registerListeners(new MyAddonEvent(), this);
```

Each of these events are called with a [dev.demeng.grantx.api.Grant](https://github.com/Demeng7215/GrantX-API/blob/master/src/main/java/dev/demeng/grantx/api/Grant.java) object, which contains information about the grant that has been activated, expired, or revoked. Access this object by using #getGrant(). Methods in this class are documented ([click here](https://github.com/Demeng7215/GrantX-API/blob/master/src/main/java/dev/demeng/grantx/api/Grant.java)).


# Embeddy

Embeddy is a self-hosted Discord Bot that allows you to easily create and edit advanced embed messages through YAML configuration files instead of executing long and confusing commands or messing with webhooks.

**Website:** <https://demeng.dev/embeddy>\
**BuiltByBit:** <https://builtbybit.com/resources/embeddy.16032/>


# Installation

## Prerequisites

* Java 17 or above.
* Basic knowledge of how to navigate and use Discord.

## Creating and Adding the Bot

1. Go to [Discord's Developer Portal](https://discord.com/developers/applications).
2. Create a new application. Set the username and, optionally, the profile picture.
3. On the left menu, click Bot.
4. Click Create a Bot and set its username and, optionally, the profile picture.
5. Untick "Public Bot" so other people can't just invite your bot onto their server.
6. Tick "Message Content Intent" so the bot can access your messages.
7. Click Copy Token- you will need the bot's token for later.
8. Go to OAuth and for scope, select "bot" and "application.commands". For permission, tick either Administrator or all the permissions the bot needs (view channel, send messages, embed links).
9. Go to the link that is generated and follow the instructions to add the bot to the server(s) of your choice.

## Starting the Bot

1. Run the StartEmbeddy.bat file (Windows) or execute your operating system's equivalent of `java -jar Embeddy-{VERSION}.jar`.
2. The bot will start loading. If this is your first time, a settings.yml will be generated.
3. Join our [Discord server](https://demeng.dev/discord) and request a license key.
4. Go to settings.yml and fill in your license key.
5. Fill in your bot token by pasting the token you copied from step 6 of Creating and Adding the Bot. Make sure the token is surrounded with "double quotes".
6. Save the file and restart the bot. Embeddy should now be successfully enabled if you followed all the steps correctly!
7. Congratulations! Your bot is now up and running. You can confirm this by going to your Discord server and checking the bot's status. It should now be Online.


# Creating Presets

## Setting Up

Let's create our first preset! Navigate to the bot's file directory (where the JAR file, settings.yml, and other Embeddy files are) and open the `presets` folder. If the folder does not exist, you can manually create it.

Create a new YML file with the ID/name of your preset. For example, if I wanted to create an preset called `test`, I would create a file called `test.yml`.

{% hint style="info" %}
Although .yml and .yaml are both supported extensions for YAML, Embeddy only recognizes files with the .yml extension.
{% endhint %}

## Configuring the Preset

Now for the important part- customizing the elements of your preset. The following configuration shows and explains how you can customize every single component of an preset. If you do not wish to use an option, you may remove the line completely.

{% hint style="danger" %}
This file shows multiple lines with the same key (ex. 3 different lines for the "author" option). This is for demonstration purposes only- you should only use 1 format for each option and never have duplicates of the same option.
{% endhint %}

```yaml
# The raw message content (outside the embeds).
raw-message: |
  Line 1
  Line 2
  Line 3

# The embed messages. Maximum 10.
embeds:
  # The embed number. Must be unique.
  1:
    # The color, must be a HEX code prefixed with the hashtag symbol.
    color: "#00FFB2"

    # The author component (goes above the title)- 3 possible formats:
    # Format 1 - Text Only
    author: "Demeng"
    # Format 2 - Clickable Text with Link (text;;link)
    author: "Demeng;;https://demeng.dev/"
    # Format 3 - Text, Link, Icon (text;;link;;iconUrl)
    author: "Demeng;;https://demeng.dev/;;https://demeng.dev/branding/icon.png"

    # The embed title- 2 possible formats:
    # Format 1 - Text Only
    title: "Example Embed"
    # Format 2 - Clickable Text with Link (text;;link)
    title: "Example Embed;;https://demeng.dev/embeddy"

    # The description, the main content of the embed.
    description: "This is some random text."
    # Alternative format - Multiple Lines
    description: |
      Line 1
      Line 2
      Line 3

    # The embed footer- 2 possible formats:
    # Format 1 - Text Only
    footer: "Made with Embeddy"
    # Format 2 - Text and Icon (text;;iconUrl)
    footer: "Made with Embeddy;;https://demeng.dev/branding/embeddy/icon.png"

    # The embed thumbnail, displayed as a square at the top right corner.
    thumbnail: "https://demeng.dev/branding/embeddy/logo.png"

    # The image displayed at the bottom, after the main content.
    image: "https://demeng.dev/branding/cover.png"

    # The timestamp displayed in the footer.
    # Use -1 for current time, or unix epoch time in milliseconds for custom.
    timestamp: -1

    # Embed fields. This is the config section containing all the fields.
    fields:
      # The field number (doesn't really matter, just no duplicates).
      1:
        # The field title.
        name: "Field 1"
        # The field description.
        value: "Some random text."
        # If the field should be inlined with other fields.
        inline: false
      # Second field.
      2:
        name: "Field 2"
        value: |
          More random text.
          But this one is on 2 lines!
        inline: false
      # Third field.
      3:
        name: "Last Field"
        value: "I'm the final random text :)"
        inline: false

# The buttons that will be displayed at the bottom of the message.
buttons:
  # The button number. Must be unique.
  1:
    # The button row. Must be between 1 (the first row) and 5.
    row: 1
    # The button style. Must be one of the following: PRIMARY, SECONDARY, SUCCESS, DANGER, LINK
    style: "LINK"
    # The button text.
    # Note that buttons can have a label, an icon, or both a label and an icon.
    label: "Button Text"
    # The button icon. Can either be a unicode emoji or a custom emote in the format <:name:id>.
    # Note that buttons can have a label, an icon, or both a label and an icon.
    icon: "<a:check_animated:846848839386267669>"
    # The URL the button redirects to if the style is LINK.
    # If the style is not LINK, this must be a unique identifier for the button.
    # If you do not include this, a unique identifier will be automatically generated.
    id-or-url: "https://demeng.dev/embeddy"
    # Whether this button should be disabled (not clickable).
    disabled: false
  2:
    row: 1
    style: "PRIMARY"
    label: "Primary Button"
  3:
    row: 1
    style: "SUCCESS"
    icon: "⭐"

```


