From 373f2fa92b5aa19c84855447495997b613f341fb Mon Sep 17 00:00:00 2001 From: Andre601 Date: Sat, 13 Jan 2024 15:59:50 +0100 Subject: [PATCH 01/11] Move to MkDocs Wiki setup --- .github/workflows/publish_site.yml | 67 + .github/workflows/push_to_wiki.yml | 39 - Commands.md | 239 - Home.md | 79 - PlaceholderExpansion.md | 382 - Placeholders.md | 6667 ---------------- Plugins-using-PlaceholderAPI.md | 1115 --- _Footer.md => docs/.footer.md | 0 _Sidebar.md => docs/.sidebar.md | 0 {img => docs/assets/img}/icon.png | Bin {img => docs/assets/img}/papi-logo.png | Bin {img => docs/assets/img}/readme/create-pr.png | Bin {img => docs/assets/img}/readme/fork.png | Bin .../assets/img}/readme/needs-update.png | Bin .../assets/img}/readme/new-branch.png | Bin {img => docs/assets/img}/readme/pr-prompt.png | Bin .../assets/img}/readme/select-branch.png | Bin .../assets/img}/readme/up-to-date.png | Bin {img => docs/assets/img}/wiki-logo.png | Bin docs/assets/js/latest-release.js | 31 + docs/assets/stylesheets/link-icons.css | 61 + docs/assets/stylesheets/styling.css | 3 + docs/commands.md | 319 + Common-Issues.md => docs/common-issues.md | 2 + .../creating-a-placeholderexpansion.md | 480 ++ .../developers/expansion-cloud.md | 55 +- .../developers/using-placeholderapi.md | 155 +- FAQ.md => docs/faq.md | 48 +- docs/index.md | 18 + docs/users/placeholder-list.md | 6670 +++++++++++++++++ docs/users/plugins-using-placeholderapi.md | 1134 +++ .../users/using-placeholders.md | 20 +- mkdocs.yml | 112 + 33 files changed, 9054 insertions(+), 8642 deletions(-) create mode 100644 .github/workflows/publish_site.yml delete mode 100644 .github/workflows/push_to_wiki.yml delete mode 100644 Commands.md delete mode 100644 Home.md delete mode 100644 PlaceholderExpansion.md delete mode 100644 Placeholders.md delete mode 100644 Plugins-using-PlaceholderAPI.md rename _Footer.md => docs/.footer.md (100%) rename _Sidebar.md => docs/.sidebar.md (100%) rename {img => docs/assets/img}/icon.png (100%) rename {img => docs/assets/img}/papi-logo.png (100%) rename {img => docs/assets/img}/readme/create-pr.png (100%) rename {img => docs/assets/img}/readme/fork.png (100%) rename {img => docs/assets/img}/readme/needs-update.png (100%) rename {img => docs/assets/img}/readme/new-branch.png (100%) rename {img => docs/assets/img}/readme/pr-prompt.png (100%) rename {img => docs/assets/img}/readme/select-branch.png (100%) rename {img => docs/assets/img}/readme/up-to-date.png (100%) rename {img => docs/assets/img}/wiki-logo.png (100%) create mode 100644 docs/assets/js/latest-release.js create mode 100644 docs/assets/stylesheets/link-icons.css create mode 100644 docs/assets/stylesheets/styling.css create mode 100644 docs/commands.md rename Common-Issues.md => docs/common-issues.md (97%) create mode 100644 docs/developers/creating-a-placeholderexpansion.md rename Expansion-cloud.md => docs/developers/expansion-cloud.md (54%) rename Hook-into-PlaceholderAPI.md => docs/developers/using-placeholderapi.md (59%) rename FAQ.md => docs/faq.md (52%) create mode 100644 docs/index.md create mode 100644 docs/users/placeholder-list.md create mode 100644 docs/users/plugins-using-placeholderapi.md rename Using-Placeholders.md => docs/users/using-placeholders.md (80%) create mode 100644 mkdocs.yml diff --git a/.github/workflows/publish_site.yml b/.github/workflows/publish_site.yml new file mode 100644 index 0000000..f73bded --- /dev/null +++ b/.github/workflows/publish_site.yml @@ -0,0 +1,67 @@ +# +# This is a GitHub Action that allows us to build and update the wiki +# on GitHub Pages using MkDocs. +# +name: Update Wiki from Repository + +on: + workflow_dispatch: + push: + # + # Only trigger when the push changes any files on the wiki branch. + # + branches: + - 'wiki' + # + # Ignore changes to the README.md file + # + paths-ignore: + - 'README.md' + # + # Releases cause this action to also fire. + # Using this prevents this problem. + # + tags-ignore: + - '**' + +permissions: + actions: read + contents: read + pages: write + id-token: write + +concurrency: + group: github-pages + cancel-in-progress: false + +jobs: + buildSite: + runs-on: ubuntu-latest + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} + steps: + - name: Checkout Repository + uses: actions/checkout@v4 + with: + fetch-depth: 0 + ref: wiki + - name: Setup Python 3.x + uses: actions/setup-python@v5 + with: + python-version: 3.x + - name: Update Pip and Setuptools + run: python -m pip install -U pip setuptools + - name: Install dependencies + run: python -m pip install -r requirements.txt + - name: Build pages + run: mkdocs build + - name: Configure GitHub Pages + uses: actions/configure-pages@v4 + - name: Upload Pages Artifact + uses: actions/upload-pages-artifact@v3 + with: + path: 'site/' + - name: Deploy to GitHub Pages + uses: actions/deploy-pages@v4 + id: deployment \ No newline at end of file diff --git a/.github/workflows/push_to_wiki.yml b/.github/workflows/push_to_wiki.yml deleted file mode 100644 index 6920935..0000000 --- a/.github/workflows/push_to_wiki.yml +++ /dev/null @@ -1,39 +0,0 @@ -# -# This is a GitHub Action that allows us to auto-update the wiki -# when a Pull request changes specific files in the wiki branch. -# -name: Update Wiki from Repository - -on: - push: - # - # Only trigger when the push changes any files in the wiki-folder. - # - branches: - - 'wiki' - # - # Ignore changes to the README.md file - # - paths-ignore: - - 'README.md' - # - # Releases cause this action to also fire. - # Using this prevents this problem. - # - tags-ignore: - - '**' - -jobs: - update: - runs-on: ubuntu-latest - steps: - - name: 'Checkout Code' - uses: actions/Checkout@v3 - - name: 'Update Wiki' - uses: Andrew-Chen-Wang/github-wiki-action@v3 - env: - WIKI_DIR: '.' - GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} - GH_MAIL: 'actions@github.com' - GH_NAME: 'github-actions[bot]' - EXCLUDED_FILES: 'README.md' diff --git a/Commands.md b/Commands.md deleted file mode 100644 index 071ea40..0000000 --- a/Commands.md +++ /dev/null @@ -1,239 +0,0 @@ -This page shows all commands, including with a detailed description of what every command does. - -## Overview - -- **[Parse Commands](#parse-commands)** - - [`/papi bcparse `](#papi-bcparse) - - [`/papi cmdparse `](#papi-cmdparse) - - [`/papi parse `](#papi-parse) - - [`/papi parserel `](#papi-parserel) - -- **[eCloud Commands](#ecloud-commands)** - - [`/papi ecloud clear`](#papi-ecloud-clear) - - [`/papi ecloud disable`](#papi-ecloud-disable) - - [`/papi ecloud download [version]`](#papi-ecloud-download) - - [`/papi ecloud enable`](#papi-ecloud-enable) - - [`/papi ecloud info [version]`](#papi-ecloud-info) - - [`/papi ecloud list |installed>`](#papi-ecloud-list) - - [`/papi ecloud placeholders `](#papi-ecloud-placeholders) - - [`/papi ecloud refresh`](#papi-ecloud-refresh) - - [`/papi ecloud status`](#papi-ecloud-status) - -- **[Expansion Commands](#expansion-commands)** - - [`/papi info `](#papi-info) - - [`/papi list`](#papi-list) - - [`/papi register `](#papi-register) - - [`/papi unregister `](#papi-unregister) - -- **[Other Commands](#other-commands)** - - [`/papi dump`](#papi-dump) - - [`/papi help`](#papi-help) - - [`/papi reload`](#papi-reload) - - [`/papi version`](#papi-version) - ----- - -### Parse Commands -These commands are used to parse placeholders into their respective values. Useful for debugging. - -- #### `/papi bcparse` - **Description**: - Parses placeholders of a String and broadcasts the result to all players. - - **Arguments**: - * `` - The Player to parse values of the placeholder (Use `me` for yourself). - * `` - The text to parse. - - **Example**: - ``` - /papi bcparse funnycube My name is %player_name%! - ``` - -- #### `/papi cmdparse` - **Description**: - Parses placeholders of a String and executes it as a command. - - **Arguments**: - - `` - The player to parse placeholders against. Use `me` for yourself. - - `` - The Text to parse and execute as command. Please leave away the `/` of the command. - - **Example**: - ``` - /papi cmdparse funnycube say My name is %player_name%! - ``` - -- #### `/papi parse` - **Description**: - Parses the placeholders in a given text and shows the result. - - **Arguments**: - * `` - The Player to parse values of the placeholder (Use `me` for yourself). - * `` - The text to parse. - - **Example**: - ``` - /papi parse funnycube My group is %vault_group% - ``` - -- #### `/papi parserel` - **Description**: - Parses a relational placeholder. - - **Arguments**: - * `` - The first player. - * `` - the second player to compare with. - * `` - The actual placeholder to parse. - - **Example**: - ``` - /papi parserel funnycube extended_clip %placeholder% - ``` - ----- - -### eCloud Commands -These commands all start with `/papi ecloud` and are used for things related about the [[Expansion Cloud]]. - -- #### `/papi ecloud clear` - **Description**: - Clears the cache for the eCloud. - -- #### `/papi ecloud disable` - **Description**: - Disables the connection to the eCloud. - -- #### `/papi ecloud download` - **Description**: - Allows you to download an expansion from the eCloud - - **Arguments**: - - `` - The expansion to download. - - `[version]` - The specific version of the expansion to download (Optional) - - **Example**: - ``` - /papi ecloud download Vault - /papi ecloud download Vault 1.5.2 - ``` - -- #### `/papi ecloud enable` - **Description**: - Enables the connection to the eCloud - -- #### `/papi ecloud info` - **Description**: - Gives information about a specific Expansion. - - **Arguments**: - - `` - The Expansion to retrieve information from. - - `[version]` - The Expansion's version to get information from. - - **Example**: - ``` - /papi ecloud info Vault - ``` - -- #### `/papi ecloud list` - **Description**: - Lists either all Expansions on the eCloud, only those by a specific author or only those that you have [installed](#papi-ecloud-download). - Installed Expansions show as green in the list and Expansions that are installed and have an update available show as gold. - - **Arguments**: - - `|installed>` - List all Expansions, Expansions of a specific author or all Expnansions you have installed. - - **Example**: - ``` - /papi ecloud list all - /papi ecloud list clip - /papi ecloud list installed - ``` - -- #### `/papi ecloud placeholders` - **Description**: - List all placeholders of an Expansion. - - **Arguments**: - - `` - The Expansion to list placeholders of. - - **Example**: - ``` - /papi ecloud placeholders Vault - ``` - -- #### `/papi ecloud refresh` - **Description**: - Refresh the cached data from the eCloud. - -- #### `/papi ecloud status` - **Description**: - Displays the actual Status of the eCloud. - ----- - -### Expansion Commands -These commands can be used to manage the expansions that you have currently installed. - -- #### `/papi info` - **Description**: - Gives you information about the specified Expansion. - - **Argument(s)**: - - `` - The Expansion to get info from (Needs to be registered and active). - - **Example**: - ``` - /papi info Vault - ``` - -- #### `/papi list` - **Description**: - Lists all active/registered expansions. - This is different to [/papi ecloud list installed](#papi-ecloud-list) in the fact, that it also includes expansions that were installed through a plugin (That aren't a separate jar-file) and it also doesn't show which one have updates available. - -- #### `/papi register` - **Description**: - Registers an expansion from a specified filename. - This is useful in cases, where you downloaded the expansion manually and don't want to restart the server. - The file needs to be inside `/plugins/PlaceholderAPI/expansions`. - - **Arguments**: - - `` - The file to register (including the file-extension). - - **Example**: - ``` - /papi register MyExpansion.jar - ``` - -- #### `/papi unregister` - **Description**: - Unregisters the specified expansion. - - **Arguments**: - - `` - The expansion to unregister. - - **Example**: - ``` - /papi unregister MyExpansion.jar - ``` - ----- - -### Other Commands -These are other commands of PlaceholderAPI that don't fit any of the above categories. - -- #### `/papi dump` - **Description**: - Pastes useful information from PlaceholderAPI such as plugin version, server version and installed expansions to https://paste.helpch.at for simple sharing and support. - -- #### `/papi help` - **Description**: - Displays all the commands PlaceholderAPI currently offers. - -- #### `/papi reload` - **Description**: - Reloads the config settings. - You need to use this command after [downloading Expansions](#papi-ecloud-download) from the eCloud or they won't be properly registered. - -- #### `/papi version` - **Description**: - Shows the current version and authors of PlaceholderAPI. diff --git a/Home.md b/Home.md deleted file mode 100644 index 808f06c..0000000 --- a/Home.md +++ /dev/null @@ -1,79 +0,0 @@ -

- PlaceholderAPI -

-This wiki gives you information on how to create placeholders in your plugin that can be used in other plugins, how to use other placeholders inside your plugin, or how to make an expansion. -It also has a list with all available placeholders (Work in progress). - -### Setup -**[[Using Placeholders]]** -**[[Hook into PlaceholderAPI]]** -- [[First steps|Hook-into-PlaceholderAPI#first-steps]] -- [[Adding placeholders to PlaceholderAPI|PlaceholderExpansion]] - - [[Common Parts|PlaceholderExpansion#common-parts]] - - [[Without an external plugin|PlaceholderExpansion#without-a-plugin]] - - [[With an external Plugin (Separate Jar)|PlaceholderExpansion#with-a-plugin-external-jar]] - - [[With an external Plugin (Internal class)|PlaceholderExpansion#with-a-plugin-internal-class]] - - [[Relational Placeholders|PlaceholderExpansion#relational-placeholders]] -- [[Setting placeholders in your plugin|Hook-into-PlaceholderAPI#setting-placeholders-in-your-plugin]] - -### Other -**[[Commands]]** -**[[Expansion cloud]]** -**[[FAQ]]** -**[[Common Issues]]** -**[[Plugins using PlaceholderAPI]]** -**[[Placeholders]]** -- [[Standalone|Placeholders#standalone]] - - [[A|Placeholders#a]] - - [[B|Placeholders#b]] - - [[C|Placeholders#c]] - - [[D|Placeholders#d]] - - [[E|Placeholders#e]] - - [[F|Placeholders#f]] - - [[G|Placeholders#g]] - - [[H|Placeholders#h]] - - [[I|Placeholders#i]] - - [[J|Placeholders#j]] - - [[K|Placeholders#k]] - - [[L|Placeholders#l]] - - [[M|Placeholders#m]] - - [[N|Placeholders#n]] - - [[O|Placeholders#o]] - - [[P|Placeholders#p]] - - [[Q|Placeholders#q]] - - [[R|Placeholders#r]] - - [[S|Placeholders#s]] - - [[T|Placeholders#t]] - - [[U|Placeholders#u]] - - [[V|Placeholders#v]] - - [[W|Placeholders#w]] - - [[X|Placeholders#x]] - - [[Y|Placeholders#y]] - - [[Z|Placeholders#z]] -- [[Plugin-placeholders|Placeholders#plugin-placeholders-1]] - - [[A|Placeholders#a-1]] - - [[B|Placeholders#b-1]] - - [[C|Placeholders#c-1]] - - [[D|Placeholders#d-1]] - - [[E|Placeholders#e-1]] - - [[F|Placeholders#f-1]] - - [[G|Placeholders#g-1]] - - [[H|Placeholders#h-1]] - - [[I|Placeholders#i-1]] - - [[J|Placeholders#j-1]] - - [[K|Placeholders#k-1]] - - [[L|Placeholders#l-1]] - - [[M|Placeholders#m-1]] - - [[N|Placeholders#n-1]] - - [[O|Placeholders#o-1]] - - [[P|Placeholders#p-1]] - - [[Q|Placeholders#q-1]] - - [[R|Placeholders#r-1]] - - [[S|Placeholders#s-1]] - - [[T|Placeholders#t-1]] - - [[U|Placeholders#u-1]] - - [[V|Placeholders#v-1]] - - [[W|Placeholders#w-1]] - - [[X|Placeholders#x-1]] - - [[Y|Placeholders#y-1]] - - [[Z|Placeholders#z-1]] diff --git a/PlaceholderExpansion.md b/PlaceholderExpansion.md deleted file mode 100644 index d0bd486..0000000 --- a/PlaceholderExpansion.md +++ /dev/null @@ -1,382 +0,0 @@ -[placeholderexpansion]: https://github.com/PlaceholderAPI/PlaceholderAPI/blob/master/src/main/java/me/clip/placeholderapi/expansion/PlaceholderExpansion.java - -[playerexpansion]: https://github.com/PlaceholderAPI/Player-Expansion -[serverexpansion]: https://github.com/PlaceholderAPI/Server-Expansion -[mathexpansion]: https://github.com/Andre601/Math-expansion - -[relational]: https://github.com/PlaceholderAPI/PlaceholderAPI/blob/master/src/main/java/me/clip/placeholderapi/expansion/Relational.java - -## Overview -This page will cover how you can create your own [`PlaceholderExpansion`][placeholderexpansion] which you can either [[Upload to the eCloud|Expansion cloud]] or integrate into your own plugin. - -It's worth noting that PlaceholderAPI relies on expansions being installed. PlaceholderAPI only acts as the core replacing utility while the expansions allow other plugins to use any installed placeholder in their own messages. -You can download Expansions either directly from the eCloud yourself, or download them through the [[download command of PlaceholderAPI|Commands#papi-ecloud-download]]. - -## Table of Contents - -- [Getting started](#getting-started) - - [Common Parts](#common-parts) -- [Without a Plugin](#without-a-plugin) -- [With a Plugin (External Jar)](#with-a-plugin-external-jar) -- [With a Plugin (Internal Class)](#with-a-plugin-internal-class) - - [Register the Expansion](#register-the-expansion) -- [Relational Placeholders](#relational-placeholders) - - [Notes about Relational Placeholders](#notes-about-relational-placeholders) - -## Getting started -For starters, you need to decide what type of [`PlaceholderExpansion`][placeholderexpansion] you want to create. There are various ways to create an expansion. This page will cover the most common ones. - -### Common Parts -All shown examples will share the same common parts that belong to the [`PlaceholderExpansion`][placeholderexpansion] class. -In order to not repeat the same basic info for each method throughout this page, and to greatly reduce its overall length, we will cover the most basic/necessary ones here. - -#### Basic PlaceholderExpansion Structure -```java -package at.helpch.placeholderapi.example.expansions; - -import org.bukkit.OfflinePlayer; -import me.clip.placeholderapi.expansion.PlaceholderExpansion; - -public class SomeExpansion extends PlaceholderExpansion { - - @Override - public String getAuthor() { - return "someauthor"; - } - - @Override - public String getIdentifier() { - return "example"; - } - - @Override - public String getVersion() { - return "1.0.0"; - } -} -``` -Let's quickly break down the different methods you have to implement. - -- #### getAuthor - This method allows you to set the name of the expansion's author. -- #### getIdentifier - The identifier is the part in the placeholder that is between the first `%` (Or `{` if bracket placeholders are used) and the first `_`. - Because of that can you not use `%`, `{`, `}` or `_` in your identifier. - - If you still want to use those symbols can you override the `getName()` method to display a different name. -- #### getVersion - This is a string, which means it can contain more than just a number. This is used to determine if a new update is available or not when the expansion is shared on the eCloud. - For expansions that are part of a plugin, this does not really matter. - -Those are all the neccessary parts for your PlaceholderExpansion. -Any other methods that are part of the [`PlaceholderExpansion`][placeholderexpansion] class are optional and will usually not be used, or will default to a specific value. Please read the Javadoc comments of those methods for more information. - -You must choose between one of these two methods for handling the actual parsing of placeholders: - -- #### onRequest(OfflinePlayer, String) - If not explicitly set, this will automatically call [`onPlaceholderRequest(Player, String)`](#onplaceholderrequestplayer-string). - This method is recommended as it allows the usage of offline players, meaning the player doesn't need to be online to get certain information (i.e. name). -- #### onPlaceholderRequest(Player, String) - If not set, this method will return `null` which PlaceholderAPI sees as an invalid placeholder. - The `Player` can be `null`, so keep that in mind when handling your placeholders. - ----- -## Without a Plugin -An expansion does not always need a plugin to rely on. If the placeholders it provides can return values from just the server itself or some other source (i.e. Java itself), then it can work independently. - -Common examples of such Expansions are: - -- [Player Expansion][playerexpansion] -- [Server Expansion][serverexpansion] -- [Math Expansion][mathexpansion] - -These kinds of expansions don't require any additional plugins to function. -When creating such an expansion is it recommended to use [`onRequest(OfflinePlayer, String)`](#onrequestofflineplayer-string). - -#### Full Example -Please see the [Common parts](#common-parts) section for info on the other methods. - -```java -package at.helpch.placeholderapi.example.expansions; - -import org.bukkit.OfflinePlayer; -import me.clip.placeholderapi.expansion.PlaceholderExpansion; - -public class SomeExpansion extends PlaceholderExpansion { - - @Override - public String getAuthor() { - return "someauthor"; - } - - @Override - public String getIdentifier() { - return "example"; - } - - @Override - public String getVersion() { - return "1.0.0"; - } - - @Override - public String onRequest(OfflinePlayer player, String params) { - if(params.equalsIgnoreCase("name")) { - return player == null ? null : player.getName(); // "name" requires the player to be valid - } - - if(params.equalsIgnoreCase("placeholder1")) { - return "Placeholder Text 1"; - } - - if(params.equalsIgnoreCase("placeholder2")) { - return "Placeholder Text 2"; - } - - return null; // Placeholder is unknown by the Expansion - } -} -``` - ----- -## With a Plugin (External Jar) -If your expansion relies on a plugin to provide its placeholder values, you will need to override a few more methods to make sure everything will work correctly. - -Your expansion will need to override the `getRequiredPlugin()` method to return the name of the plugin your expansion depends on. -PlaceholderAPI automatically checks if this method will either return null, or if the name defined results in a non-null plugin. - -It is worth noting that it is a bit more difficult to make a separate jar file that depends on a plugin, as it will require the plugin to have some sort of accessible API in order to get the required values. -One way to bypass this is to override the `canRegister()` method with the following code: - -```java -private SomePlugin plugin = null; // This would be the plugin your expansion depends on - -@Override -public boolean canregister() { - // This sets plugin to the SomePlugin instance you get through the PluginManager - return (plugin = (SomePlugin) Bukkit.getPluginManager().getPlugin(getRequiredPlugin())) != null; -} -``` -Using this code-snippet, you can get a direct instance of the plugin and access things such as config values. -With that said, it is recommended instead to use an API if one is available, as this kind of plugin access is a relatively poor approach. - -#### Full Example -Please see the [Common parts](#common-parts) section for info on the other methods. - -```java -package at.helpch.placeholderapi.example.expansions; - -import at.helpch.placeholderapi.example.SomePlugin; -import org.bukkit.OfflinePlayer; -import me.clip.placeholderapi.expansion.PlaceholderExpansion; - -public class SomeExpansion extends PlaceholderExpansion { - - private SomePlugin plugin; // This instance is assigned in canRegister() - - @Override - public String getAuthor() { - return "someauthor"; - } - - @Override - public String getIdentifier() { - return "example"; - } - - @Override - public String getVersion() { - return "1.0.0"; - } - - @Override - public String getRequiredPlugin() { - return "SomePlugin"; - } - - @Override - public boolean canRegister() { - return (plugin = (SomePlugin) Bukkit.getPluginManager().getPlugin(getRequiredPlugin())) != null; - } - - @Override - public String onRequest(OfflinePlayer player, String params) { - if(params.equalsIgnoreCase("placeholder1")){ - return plugin.getConfig().getString("placeholders.placeholder1", "default1"); - } - - if(params.equalsIgnoreCase("placeholder2")){ - return plugin.getConfig().getString("placeholders.placeholder2", "default2"); - } - - return null; // Placeholder is unknown by the expansion - } -} -``` - ----- -## With a Plugin (Internal Class) -The way expansions are handled when they are part of the plugin itself is fairly similar to when you [make an expansion without a plugin dependency](#without-a-plugin). - -In fact, you don't even have to override the `getRequiredPlugin()` and `canRegister()` methods as it is always guaranteed that the plugin is available. -Something worth noting, however, is that you need to override the `persist()` method and make it return true. This ensures that the expansion won't be unregistered by PlaceholderAPI whenever it is reloaded. - -Finally, you can also use dependency injection as an easier way to access a plugin's methods. -Here is a small code example of how dependency injection may look: - -```java -public class SomeExpansion extends PlaceholderExpansion { - private final SomePlugin plugin; // The instance is created in the constructor and won't be modified, so it can be final - - public SomeExpansion(SomePlugin plugin) { - this.plugin = plugin; - } -} -``` - -#### Full Example -Please see the [Common parts](#common-parts) section for info on the other methods. - - -```java -package at.helpch.placeholderapi.example.expansions; - -import at.helpch.placeholderapi.example.SomePlugin; -import org.bukkit.OfflinePlayer; -import me.clip.placeholderapi.expansion.PlaceholderExpansion; - -public class SomeExpansion extends PlaceholderExpansion { - - private final SomePlugin plugin; - - public SomeExpansion(SomePlugin plugin) { - this.plugin = plugin; - } - - @Override - public String getAuthor() { - return "someauthor"; - } - - @Override - public String getIdentifier() { - return "example"; - } - - @Override - public String getVersion() { - return "1.0.0"; - } - - @Override - public boolean persist() { - return true; // This is required or else PlaceholderAPI will unregister the Expansion on reload - } - - @Override - public String onRequest(OfflinePlayer player, String params) { - if(params.equalsIgnoreCase("placeholder1")){ - return plugin.getConfig().getString("placeholders.placeholder1", "default1"); - } - - if(params.equalsIgnoreCase("placeholder2")) { - return plugin.getConfig().getString("placeholders.placeholder2", "default2"); - } - - return null; // Placeholder is unknown by the Expansion - } -} -``` - -### Register the Expansion -To register the expansion, you will need to call the `register()` method yourself. -This should be done in your plugin's `onEnable()` method after you make sure that PlaceholderAPI is installed and enabled. - -```java -package at.helpch.placeholderapi.example - -import org.bukkit.Bukkit; -import org.bukkit.plugin.java.JavaPlugin; - -public class SomePlugin extends JavaPlugin { - - @Override - public void onEnable() { - // Small check to make sure that PlaceholderAPI is installed - if(Bukkit.getPluginManager().getPlugin("PlaceholderAPI") != null) { - new SomeExpansion(this).register(); - } - } -} -``` - ----- -## Relational Placeholders -Relational Placeholders are a bit more specific compared to the previous examples. -While they do use the same [common parts](#common-parts) that the other examples do, they have a different method to return placeholders. - -In order to use the relational placeholders feature, you will need to implement the [`Relational`][relational] interface, which in return adds the `onPlaceholderRequest(Player, Player, String)` method to use. - -#### Full Example -Please see the [Common parts](#common-parts) section for info on the other methods. - -In this example, we use the [Internal class setup](#with-a-plugin-internal-jar) and `SomePlugin` has an `areFriends(Player, Player)` method that returns true or false based on if the given players are friends. - -```java -package at.helpch.placeholderapi.example.expansions; - -import at.helpch.placeholderapi.example.SomePlugin; -import org.bukkit.ChatColor; -import org.bukkit.Player; -import me.clip.placeholderapi.expansion.PlaceholderExpansion; -import me.clip.placeholderapi.expansion.Relational; - -public class SomeExpansion extends PlaceholderExpansion implements Relational { - - private final SomePlugin plugin; - - public SomeExpansion(SomePlugin plugin) { - this.plugin = plugin; - } - - @Override - public String getAuthor() { - return "someauthor"; - } - - @Override - public String getIdentifier() { - return "example"; - } - - @Override - public String getVersion() { - return "1.0.0"; - } - - @Override - public boolean persist() { - return true; // This is required or else PlaceholderAPI will unregister the Expansion on reload - } - - @Override - public String onPlaceholderRequest(Player one, Player two, String identifier) { - if(one == null || two == null) - return null; // We require both Players to be online - - if(params.equalsIgnoreCase("friend")) { - if(plugin.areFriends(one, two)) { - return ChatColor.GREEN + one.getName() + " and " + two.getName() + " are friends!"; - } else { - return ChatColor.GREEN + one.getName() + " and " + two.getName() + " are not friends!"; - } - } - - return null; // Placeholder is unknown by the Expansion - } -} -``` - -### Notes about Relational Placeholders -Relational placeholders will always start with `%rel_` to properly identify them. -So in the above example, the full placeholder will look like `%rel_example_friend%`. diff --git a/Placeholders.md b/Placeholders.md deleted file mode 100644 index c386466..0000000 --- a/Placeholders.md +++ /dev/null @@ -1,6667 +0,0 @@ -[SimpleDateFormat]: http://docs.oracle.com/javase/8/docs/api/java/text/SimpleDateFormat.html -[TimeZoneIDs]: https://garygregory.wordpress.com/2013/06/18/what-are-the-java-timezone-ids/ - -[list]: https://github.com/PlaceholderAPI/PlaceholderAPI/discussions/510 - -This is a list of all available placeholders. -A download-command for the extension can be found at the area of the placeholder. -If the command itself isn't there and `NO DOWNLOAD COMMAND` instead is shown, then it means, that the plugin actually has the placeholders hard-coded into them and doesn't require a manual download of any expansion. - -> **Note** -> We only add and/or update placeholders on request. -> We aren't responsible, to keep the placeholders of your plugin(s) up to date. -> If anything about your expansion/plugin has changed, consider [making a Pull request](https://github.com/PlaceholderAPI/PlaceholderAPI/pulls) to commit the changes yourself. -> -> You can find a comprehensive guide on how to do this on the [Wiki's README file](https://github.com/PlaceholderAPI/PlaceholderAPI/blob/wiki/README.md). - -- [Standalone](#standalone) - - ### **A** - - **[Advancements](#advancements)** - - **[Animations](#animations)** - - **[Armor](#armor)** - - **[ASCII](#ascii)** - - **[Attribute](#attribute)** - - - ### **B** - - **[BungeeCord](#bungeecord)** - - - ### **C** - - **[CalculateNumbers](#calculatenumbers)** - - **[ChangeOutput](#changeoutput)** - - **[CheckItem](#checkitem)** - - **[CooldownBar](#cooldownbar)** - - - ### **D** - - *No Expansions* - - - ### **E** - - **[Enchantment](#enchantment)** - - - ### **F** - - **[Formatter](#formatter)** - - - ### **G** - - **[GraalJS](#graaljs)** - - - ### **H** - - *No Expansions* - - - ### **I** - - *No Expansions* - - - ### **J** - - **[Javascript](#javascript)** - - - ### **K** - - *No Expansions* - - - ### **L** - - **[ListPlayers](#listplayers)** - - **[LocalTime](#localtime)** - - - ### **M** - - **[Math](#math)** - - **[MVdW placeholders](#mvdw-placeholders)** - - **[MySQL](#mysql)** - - **[MySQLTokens](#mysqltokens)** - - - ### **N** - - **[NumberFormatter](#numberformatter)** - - - ### **O** - - **[OtherPlayer](#otherplayer)** - - - ### **P** - - **[ParseNear](#parsenear)** - - **[ParseOther](#parseother)** - - **[Pinger](#pinger)** - - **[Player](#player)** - - **[PlayerList](#playerlist)** - - **[Plugin](#plugin)** - - **[Progress](#progress)** - - - ### **Q** - - *No Expansions* - - - ### **R** - - **[RainbowColor](#rainbowcolor)** - - **[RandomColor](#randomcolor)** - - **[RandomNumber](#randomnumber)** - - **[RedisBungee](#redisbungee)** - - **[RelCon](#relcon)** - - **[RNG](#rng)** - - - ### **S** - - **[ScoreboardObjectives](#scoreboardobjectives)** - - **[Server](#server)** - - **[Shortcut](#shortcut)** - - **[Sound](#sound)** - - **[SpeedPerSec](#speedpersec)** - - **[Statistic](#statistic)** - - **[String](#string)** - - - ### **T** - - **[Team](#team)** - - **[Teams](#teams)** - - - ### **U** - - **[Unicode](#unicode)** - - - ### **V** - - *No Expansions* - - - ### **W** - - **[World](#world)** - - - ### **X** - - *No Expansions* - - - ### **Y** - - *No Expansions* - - - ### **Z** - - *No Expansions* - ----- - -- [Plugin-placeholders](#plugin-placeholders) - - ### **A** - - **[AAC - AdvancedAntiCheat](#aac)** - - **[AbstractMenus](#abstractmenus)** - - **[AcidIsland](#acidisland)** - - **[AcidIslandRate](#acidislandrate)** - - **[Advanced Abilities](#advanced-abilities)** - - **[Advanced Achievements](#advanced-achievements)** - - **[AdvancedAFK](#advancedafk)** - - **[AdvancedCustomMenu+](#advancedcustommenu)** - - **[AdvancedLottery](#advancedlottery)** - - **[AdvancedModReq](#advancedmodreq)** - - **[AdvancedServerList](#advancedserverlist)** - - **[ajLeaderboards](#ajleaderboards)** - - **[ajParkour](#ajparkour)** - - **[AlonsoLevels](#alonsolevels)** - - **[AngelChest](#angelchest)** - - **[Animated Menu](#animated-menu)** - - **[AntiCombatLogging](#anticombatlogging)** - - **[AParkour](#aparkour)** - - **[ASkyBlock](#askyblock)** - - **[AsyncKeepAlive](#asynckeepalive)** - - **[AutoPickup](#autopickup)** - - **[AutoRank](#autorank)** - - **[AutoSell](#autosell)** - - - ### **B** - - **[BankSystem](#banksystem)** - - **[BasicQuests](#basicquests)** - - **[BattleLevels](#battlelevels)** - - **[BeautyQuests](#beautyquests)** - - **[BedWars1058](#bedwars1058)** - - **[BentoBox](#bentobox)** - - **[BetonQuest](#betonquest)** - - **[BetterTeams](#betterteams)** - - **[BlockParty](#blockparty)** - - **[BlockQuest](#blockquest)** - - **[Boxing](#boxing)** - - **[BuildBattlePro](#buildbattlepro)** - - **[BungeePerms](#bungeeperms)** - - **[BuyCraft](#buycraft)** - - - ### **C** - - **[CarlTheCreeper](#carlthecreeper)** - - **[ChatColor+](#chatcolor)** - - **[ChatColor+ Premium](#chatcolor-premium)** - - **[ChatReaction](#chatreaction)** - - **[CheckNameHistory](#checknamehistory)** - - **[Clans](#clans)** - - **[ClansFree](#clansfree)** - - **[Clans-API for Spigot/Clan tag in chat](#clans-api-for-spigotclan-tag-in-chat)** - - **[ClansPro](#clanspro)** - - **[ClanSystem](#clansystem)** - - **[CombatLogX](#combatlogx)** - - **[Compassance](#compassance)** - - **[CoordinateTool](#coordinatetool)** - - **[Country on Join](#country-on-join)** - - **[CraftConomy](#craftconomy)** - - **[CraftingStore.net](#craftingstorenet)** - - **[CursedVIP](#cursedvip)** - - **[Custom Advancements](#custom-advancements)** - - **[Custom Items](#custom-items)** - - - ### **D** - - **[Daily Rewards](#daily-rewards)** - - **[DeliveryMan](#deliveryman)** - - **[DeluxeChat](#deluxechat)** - - **[DeluxeCombat](#deluxecombat)** - - **[DeluxeMenus](#deluxemenus)** - - **[DeluxePM](#deluxepm)** - - **[DeluxeTags](#deluxetags)** - - **[Denizen](#denizen)** - - **[DimensionPlaceholders](#dimensionplaceholders)** - - **[DiscordSRV](#discordsrv)** - - **[Disease](#disease)** - - **[DonateParty](#donateparty)** - - **[Donations Holograms](#donations-holograms)** - - **[DragonSlayer](#dragonslayer)** - - **[DungeonsXL](#dungeonsxl)** - - - ### **E** - - **[Economy Bank](#economy-bank)** - - **[Enjin & DonationCraft 2.x](#enjin--donationcraft-2x)** - - **[EntityClearer](#entityclearer)** - - **[EntityControl](#entitycontrol)** - - **[Envoys](#envoys)** - - **[EpicFriends](#epicfriends)** - - **[EpicLevels](#epiclevels)** - - **[essCore](#esscore)** - - **[Essentials](#essentials)** - - **[EventCore](#eventcore)** - - **[EZBlocks](#ezblocks)** - - **[EZPrestige](#ezprestige)** - - **[EZRanksPro](#ezrankspro)** - - - ### **F** - - **[Factions MCore](#factions-mcore)** - - **[FactionsUUID](#factionsuuid)** - - **[Factions relation placeholders](#factions-relation-placeholders)** - - **[FunnyGuilds](#funnyguilds)** - - - ### **G** - - **[GAListener](#galistener)** - - **[GangsPlus](#gangsplus)** - - **[GemsEconomy](#gemseconomy)** - - **[GriefDefender](#griefdefender)** - - **[GriefPrevention](#griefprevention)** - - **[Guilds](#guilds)** - - **[GuiRedeemMCMMO](#guiredeemmcmmo)** - - - ### **H** - - **[Head Database](#head-database)** - - **[Heroes](#heroes)** - - **[HoloBlock](#holoblock)** - - **[HoloMobHealth](#holomobhealth)** - - **[HPWizard](#hpwizard)** - - **[Hugs](#hugs)** - - **[HyacinthHello](#hyacinthhello)** - - - ### **I** - - **[InteractionVisualizer](#interactionvisualizer)** - - **[InteractiveChat](#interactivechat)** - - **[Island Border (ASkyblock / BentoBox / uSkyBlock / AcidIsland)](#island-border)** - - **[IslandRate (ASkyBlock Addon)](#islandrate)** - - **[IslandWorld](#islandworld)** - - - ### **J** - - **[Jobs Reborn](#jobs-reborn)** - - - ### **K** - - **[Karma](#karma)** - - **[KillStats](#killstats)** - - **[KitPvP](#kitpvp)** - - **[KingdomsX](#kingdomsx)** - - **[KP-PVP](#kp-pvp)** - - - ### **L** - - **[Lands](#lands)** - - **[LastLoginAPI](#lastloginapi)** - - **[LeaderHeads](#leaderheads)** - - **[LegendQuest](#legendquest)** - - **[LemonMobCoins](#lemonmobcoins)** - - **[LevelledMobs](#levelledmobs)** - - **[LevelUp](#levelup)** - - **[LotterySix](#lotterysix)** - - **[LuckPerms](#luckperms)** - - **[LWC](#lwc)** - - - ### **M** - - **[Marcely's Bedwars](#marcelys-bedwars)** - - **[Marriage](#marriage)** - - **[Marriage (Reloaded)](#marriage-reloaded)** - - **[MarriageMaster](#marriagemaster)** - - **[McInfected](#mcinfected)** - - **[McJobs](#mcjobs)** - - **[McMMO](#mcmmo)** - - **[MineChess](#minechess)** - - **[MineCord](#minecord)** - - **[MineCrates](#minecrates)** - - **[MineResetLite](#mineresetlite)** - - **[MobHunting](#mobhunting)** - - **[Multiverse-Core](#multiverse-core)** - - **[MyCommand](#mycommand)** - - **[MyPet](#mypet)** - - **[MyPrefixSystem](#myprefixsystem)** - - - ### **N** - - **[Nameless Plugin](#nameless-plugin)** - - **[NameMC-API-ServersMC Plugin](#namemc-api-serversmc)** - - **[Nicknamer](#nicknamer)** - - **[NickReloaded](#nickreloaded)** - - **[Nicky](#nicky)** - - - ### **O** - - **[OneBlock](#oneblock)** - - **[OnePlayerSleep](#oneplayersleep)** - - **[OnTime](#ontime)** - - **[OpEconomy](#opeconomy)** - - **[OreAnnouncer](#oreannouncer)** - - **[OreMarket](#oremarket)** - - **[Outpost](#outpost)** - - - ### **P** - - **[P-LifeSteal](#p-lifesteal)** - - **[Paintball Battle](#paintball-battle)** - - **[Parkour](#parkour)** - - **[Parkour Maker](#parkour-maker)** - - **[ParkPlusMC](#parkplusmc)** - - **[Parties](#parties)** - - **[Party and Friends](#party-and-friends)** - - **[PermissionTimer](#permissiontimer)** - - **[PixelVip](#pixelvip)** - - **[Plan](#plan)** - - **[PlayerStats](#playerstats)** - - **[PlayTime](#playtime)** - - **[PlaytimeRewards](#playtimerewards)** - - **[PlayerPoints](#playerpoints)** - - **[PlotSquared](#plotsquared)** - - **[PocketHorses](#pockethorses)** - - **[PointsAPI](#pointsapi)** - - **[PowerBoard](#powerboard)** - - **[PowerRanks](#powerranks)** - - **[PrefiX](#prefix)** - - **[PremiumReports](#premiumreports)** - - **[PremiumVanish](#premiumvanish)** - - **[Prison](#prison)** - - **[PrisonMines](#prisonmines)** - - **[PrisonRanksX](#prisonranksx)** - - **[ProCosmetics](#procosmetics)** - - **[ProfessionalBans](#professionalbans)** - - **[ProQuest](#proquest)** - - **[ProtectionStones](#protectionstones)** - - **[PVPLevels](#pvplevels)** - - **[PVP Stats](#pvp-stats)** - - **[PvPStats Plugin](#pvpstats-plugin)** - - - ### **Q** - - **[QualityArmory](#qualityarmory)** - - **[Quests](#quests)** - - **[QuestCreator](#questcreator)** - - **[QuickSell](#quicksell)** - - - ### **R** - - **[RabbitsVSPenguins](#rabbitsvspenguins)** - - **[RageMode](#ragemode)** - - **[Rankup](#rankup)** - - **[RealisticWorldGenerator](#realisticworldgenerator)** - - **[RedProtect](#redprotect)** - - **[ReferralSystem](#referralsystem)** - - **[RestrictedDimensions](#restricteddimensions)** - - **[RocketPlaceholders](#rocketplaceholders)** - - **[RogueParkour](#rogueparkour)** - - **[RoyalCommands](#royalcommands)** - - **[RPGInventory](#rpginventory)** - - **[RTP](#rtp)** - - - ### **S** - - **[Sack](#sack)** - - **[Seasons](#seasons)** - - **[SellAll](#sellall)** - - **[SignLink](#signlink)** - - **[SimpleClans](#simpleclans)** - - **[SimpleCoins](#simplecoins)** - - **[SimpleCoinsAPI](#simplecoinsapi)** - - **[SimpleKillTracker](#simplekilltracker)** - - **[SimplePrefix](#simpleprefix)** - - **[Simple Suffix](#simple-suffix)** - - **[SkillAPI](#skillapi)** - - **[SkinsRestorer](#skinsrestorer)** - - **[Skript](#skript)** - - **[Skywars](#skywars)** - - **[Skywars X](#skywars-x)** - - **[SkywarsReloaded](#skywarsreloaded)** - - **[Soul](#soul)** - - **[Spark](#spark)** - - **[SQLPerms](#sqlperms)** - - **[SQLTokens](#sqltokens)** - - **[Staff Facilities](#staff-facilities)** - - **[Staff++](#staffplusplus)** - - **[Statz](#statz)** - - **[Streaming Drops](#streaming-drops)** - - **[StrikePractice 2](#strikepractice-2)** - - **[stTitles](#sttitles)** - - **[SubServers](#subservers)** - - **[SuperbVote](#superbvote)** - - **[SuperCredits](#supercredits)** - - **[SuperVanish](#supervanish)** - - - ### **T** - - **[The Time](#the-time)** - - **[ThemePark](#themepark)** - - **[Thirst](#thirst)** - - **[TicketGUI](#ticketgui)** - - **[Timed Rewards](#timed-rewards)** - - **[TimeManager](#timemanager)** - - **[Time Tokens](#time-tokens)** - - **[TNTRun_Reloaded](#tntrun_reloaded)** - - **[TokenEnchant](#tokenenchant)** - - **[TokenManager](#tokenmanager)** - - **[Tokens](#tokens)** - - **[TokensPlus](#tokensplus)** - - **[Towny](#towny)** - - **[TownyChat](#townychat)** - - **[TransmuteIt](#transmuteit)** - - **[Treasures](#treasures)** - - **[Trey's Double Jump](#treys-double-jump)** - - **[TrickOrTreat](#trickortreat)** - - **[Two Factor Authentication](#twofactorauthentication)** - - - ### **U** - - **[UltimateChat](#ultimatechat)** - - **[UltimateClaims](#ultimateclaims)** - - **[UltimateServerManager](#ultimateservermanager)** - - **[UltimateVotes](#ultimatevotes)** - - **[Ultra Economy](#ultra-economy)** - - **[Ultra Motd](#ultra-motd)** - - **[Ultra Permissions](#ultra-permissions)** - - **[Ultra Punishments](#ultra-punishments)** - - **[Ultra Regions](#ultra-regions)** - - **[UnityGen](#unitygen)** - - **[USkyBlock](#uskyblock)** - - - ### **V** - - **[Vault](#vault)** - - **[VenturaCalendar](#venturacalendar)** - - **[ViaVersion](#viaversion)** - - **[VKBackPack](#vkbackpack)** - - **[VoteParty](#voteparty)** - - **[VoteRoulette](#voteroulette)** - - **[VotingPlugin](#votingplugin)** - - - ### **W** - - **[Weight-RPG](#weightrpg)** - - **[WickedSkyWars](#wickedskywars)** - - **[WorldBorder](#worldborder)** - - **[WorldGuard](#worldguard)** - - - ### **X** - - **[XLTournaments](#xltournaments)** - - - ### **Y** - - *No Expansions* - - - ### **Z** - - *No Expansions* - ----- -## Standalone -Expansions listed here don't need any plugin or extra library to function properly, unless mentioned otherwise. -A majority of these Expansions are maintained by the PlaceholderAPI team and can be considered *official*. - -- ### **Advancements** - > /papi ecloud download Advancements - - More info about this expansion can be found on the [GitHub-Repository](https://github.com/matahombres/Advancements). - - ``` - %Advancements_% - %Advancements_player_;% - %Advancements_list% - %Advancements_list_% - %Advancements_playerList_% - %Advancements_playerList_,% - %Advancements_listFormat% - %Advancements_playerListFormat_% - %Advancements_completedAmount% - %Advancements_completedAmount_% - %Advancements_playerCompletedAmount_% - %Advancements_playerCompletedAmount_,% - %Advancements_remainingAmount% - %Advancements_remainingAmount_% - %Advancements_playerRemainingAmount_% - %Advancements_playerRemainingAmount_,% - ``` - ----- - -- ### **Animations** - > /papi ecloud download Animations - - ```html - %animations_Text% - %animations_Text% - %animations_Text% - ``` - - Please note: When using placeholders within the animation text, you must use the bracket variant. - Use `{player_name}` instead of `%player_name%` within the ` ` tags. - - Please visit the [dedicated wiki](https://github.com/Niall7459/KiteBoard-Documentation/wiki/Animations-and-Modifiers) for all available tags. - ----- - -- ### **Armor** - > /papi ecloud download Armor - - Gives you info about your armor - - ``` - Chose one value that's inside () and replace SLOT with one of the following: helmet, chestplate, leggings, boots. - - %armor_amount_SLOT% - %armor_color_(red/green/blue/hex)_SLOT% - %armor_durability_(left/max)_SLOT% - %armor_has_SLOT% - %armor_material_SLOT% - %armor_maxamount_SLOT% - ``` - ----- - -- ### **ASCII** - > /papi ecloud download ASCII - - Returns the [ASCII Value](http://www.asciitable.com/) based on input - - ``` - %ascii_% - ``` - - Ex: `%ascii_37%` returns `%` - ----- - -- ### **Attribute** - > /papi ecloud download Attribute - - Adds placeholders to access [Attributes](https://hub.spigotmc.org/javadocs/spigot/org/bukkit/attribute/Attribute.html). ([Minecraft wiki](https://minecraft.fandom.com/wiki/Attribute)] - **The expansion can be used only on 1.9+** - - ``` - // Available for all game versions - %attribute_player_has_% - whether the player has a certain attribute - %attribute_player_baseValue_% - returns the base value of an attribute - %attribute_player_value_% - returns the value of an attribute with all the modifiers applied - - // 1.11+ - %attribute_player_defaultValue_% - returns the default value of an attribute - ``` - ----- - -- ### **BungeeCord** - > /papi ecloud download Bungee - - Allows you to show, how many players are online on the entire network, or just on a specific server. - - ``` - %bungee_total% - %bungee_% - ``` - ----- - -- ### **CalculateNumbers** - > NO DOWNLOAD COMMAND - - Download the jar from [broken1arrow/CalculateNumbers/releases](https://github.com/broken1arrow/CalculateNumbers/releases) - - The idea with this expansion is that you should be able to charge dynamically, - for example in the deluxe menu. For tools, weapons - and armor when players need to - repair their belongings. Has also added optional so you can also combine it with - rank plugin if - you have one. - - Use decimal,to get two decimal digits. - - ``` - %number_numbervalue,tool:{a placeholder from your ranking plugin}% - %number_numbervalue,decimal,tool:{a placeholder from your ranking plugin}% - %number_numbervalue,armor:{a placeholder from your ranking plugin}% - %number_numbervalue,decimal,armor:{a placeholder from your ranking plugin}% - ``` - ----- - -- ### **ChangeOutput** - > /papi ecloud download changeoutput - - Allows you to change the output based on what other placeholders return. - - More information can be found on the [GitHub Repository](https://github.com/Kqliber/Expansion-ChangeOutput) - - ``` - %changeoutput__input:_matcher:_ifmatch:_else:% - ``` - - * `` - * equals - match the input exactly - * ignorecase - match the input while ignoring cases - * ignorecolor - match the input while ignoring colour codes - * contains - check if the match contains input - * \>= - check if the input is larger than or equal to the matcher - * \> - check if the input is larger than the matcher - * <= - check if the input is less than or equal to the matcher - * < - check if the input is less than the matcher - * `` - this is your text that you wish to replace - * `` - this is the text we will be looking for to meet the conditions - * `` - if the input meets the condition, this text will be displayed - * `` - if the input does not meet the condition, this text will be displayed instead - - *All arguments can be replaced with other placeholders, wrapped in* `{}` - ----- - -- ### **CheckItem** - > /papi ecloud download CheckItem - - Allows you to check the inventory of a player for a certain item. - - ``` - %checkitem_,,<...>% - Returns if user has the item - %checkitem_amount_,,<...>% - Returns amount of items the user has - %checkitem_remove_,,<...>% - Removes the items from the players inventory - Can be used with amount, it just has to be after. (Ex. %checkitem_amount_remove_<...>%) Please be careful as it does REMOVE ITEMS FOR GOOD - %checkitem_give_,,<...>% - Gives the player items. Returns true if successful, returns the number of items NOT given if unsuccessful. (When unsuccessful items can still be given, it just might not be all of them) - %checkitem_getinfo:_,,<...>% - Returns information about an item in a slot. Returns information in the same order listed on this wiki. List is seperated via " &r" (Ex. %checkitem_getinfo:0_mat:) - ``` - - *Notes:* - *- `mainhand` and `offhand` work in `getinfo:`* - *- `give` and `remove` placeholders are **DISABLED** by default. See PlaceholderAPI `config.yml` file to enable.* - - **Modifiers** - You can combine different modifiers to check for different values. - Available modifiers are: - - `namecontains:` - Checks if the item's display name contains ``* \*\* ~ - - `namestartswith:` - Checks if the item's display name starts with ``* \*\* ~ - - `nameequals:` - Checks if the item's display name equals ``* \*\* ^ ~ - - `mat:` - Checks if the item is `` (For example: `STONE`) ^ ~ - - `amt:` - Checks if the player has `` of items ^ ~ - - `data:` - Checks if the item has data `` (Example: Red wool has `14` as data (`WOOL:14`)). - This is only for 1.12 and older! ^ ~ - - `custommodeldata:` - Checks if the item has CustomModelData `` - This is only for 1.14 and newer! ^ ~ - - `lorecontains:` - Checks if the item's lore contains ``* ~ - ***Combined with `getinfo` you can specify a number for `` and the specific lore line will be returned*** - - `loreequals:` - Checks if the item's lore equals `` Lines are separated by `|` ^ ~ - ***Combined with `getinfo` you can specify a number for `` and the specific lore line will be returned*** - - `matcontains:` - Checks if the item's material contains ``* - - `enchantments:;` - Checks if the item's enchantments contains `` with an optional `=level` - Uses vanilla minecraft enchantment names ^ ~ - - `enchanted` - Checks if the item is enchanted (with anything) ~ - - `potiontype:` - Checks if the item has the potiontype ([Click here for potion types](https://hub.spigotmc.org/javadocs/spigot/org/bukkit/potion/PotionType.html)) ^ ~ - - `potionextended:` - Checks if a potion is extended ^ ~ - - `potionupgraded:` - Checks if a potion is upgraded ^ ~ - - `strict` - Requires `mat:` modifier. Strictly checks the name and lore for an item. (If a Stone named `Test` is in your inventory, and you're using `%checkitem_mat:stone,strict%`, it will return false) - - `inhand` - Check if the item is in the player's hand. `inhand` will check *both* hands. You can add `:main` or `:off` to specify. (Ex: `inhand:main`) - - `inslot:` - Check if the item is in a specific slot ([Click here for valid slots](https://i.imgur.com/3YCrfC8.png)) - - `nbtstrings:=;=` - Checks if the item's nbtStrings contains `` with the value of ``. * ^ ~ - - `nbtints:=;=` - Checks if the item's nbtInts contains `` with the value of ``. * ^ ~ - - *For nbt data you can use compounds by putting `..` inside your string Example (`%checkitem_nbtstrings:PublicBukkitValues..executableitems:ei-id=Free_Money%`)* ^ - - **Notes:** - - \* means case-sensitive - - ** means only one can be used - - ^ means that the modifier supports the `give` placeholder - - ~ means that the modifier works with the `getinfo` placeholder - - To use Commas in strings you must escape them using `\` (Ex: `loreequals:Milk\, Eggs\, Bread`) - - **Placeholders are supported, but they need to be in brackets! (Ex: `%player_name%` would be `{player_name}`** - ----- - -- ### **CooldownBar** - > /papi ecloud download CooldownBar - - More info about this expansion can be found on the [GitHub-Repository](https://github.com/aBo0oDyy/CooldownBar-Expansion). - - ``` - %cooldownbar_{placeholder}% - %cooldownbar_{placeholder}_p:% - %cooldownbar_{placeholder}_i:% - %cooldownbar_{placeholder}_r:% - %cooldownbar_{placeholder}_l:% - %cooldownbar_{placeholder}_c:% - %cooldownbar_{placeholder}_rdy:% - %cooldownbar_{essentials_kit_time_until_available_tools}_p:&a■_i:&e■_r:&7■_l:5_c:100_rdy:&aReadytoclaim!% - %cooldownbar_percentage_{placeholder}% - %cooldownbar_percentage_{placeholder}_c:% - %cooldownbar_percentage_{placeholder}_d:% - %cooldownbar_percentage_{essentials_kit_time_until_available_tools}_c:120_d:0% - ``` - ----- - -- ### **Enchantment** - > Download it from [here](https://github.com/TeamVK/PAPI-Enchantment/releases) - - More info about this expansion can be found on the [GitHub-Repository](https://github.com/TeamVK/PAPI-Enchantment). - - `<>` is required. - - ``` - %enchantment_list% # a list of enchantments on the item a player is holding (separated by ',') - %enchantment_listLF% # a list of enchantments on the item a player is holding (separated by '\n') - %enchantment_roman_list% # a list of enchantments on the item a player is holding (separated by ',') - %enchantment_roman_listLF% # a list of enchantments on the item a player is holding (separated by '\n') - %enchantment__level% # a level of the specified enchantment on the item a player is holding - ``` - ----- - -- ### **Formatter** - > /papi ecloud download Formatter - - More info about this expansion can be found on the [Codeberg-Repository](https://codeberg.org/Andre601/Formatter-Expansion). - - `[]` is optional and `<>` is required. - - ``` - %formatter_number_format_% - %formatter_number_format_[locale]:[pattern]_% - - %formatter_number_from:_to:_% # Converts from one time unit to another - - %formatter_number_round_% - %formatter_number_[precision]:[roundingmode]_% - - %formatter_number_shorten_% - - %formatter_number_time_% - %formatter_number_time__% # Handles number as - - %formatter_text_length_% - - %formatter_text_lowercase_% - - %formatter_text_replace_[target]_[replacement]_% - - %formatter_text_substring_[start]:[end]_% - - %formatter_text_uppercase_% - ``` - ----- - -- ### **[GraalJS](https://github.com/ruViolence/GraalJS-Expansion)** - > /papi ecloud download GraalJS - - More info about this expansion can be found on the [GitHub-Repository](https://github.com/ruViolence/GraalJS-Expansion). - - ``` - %graaljs_% - %graaljs__arg1% - %graaljs__arg1,arg2,arg3% - ``` - ----- - -- ### **[Javascript](https://api.extendedclip.com/expansions/javascript/)** - > NO DOWNLOAD COMMAND - - Gives you a way, to use javascript, to give a different output, depending on conditions. - - ``` - %javascript_% - ``` - ----- - -- ### **ListPlayers** - > /papi ecloud download ListPlayers - - Lists players with a certain permission or in a certain world... 'nuf said. - - ``` - %listplayers_with_perm_% - %listplayers_in_world_% - ``` - ----- - -- ### **LocalTime** - > /papi ecloud download LocalTime - - ``` - %localtime_time% - %localtime_time_% - %localtime_timezone_% - %localtime_timezone_,% - ``` - - Please read the [SimpleDateFormat] Javadoc page about possible formats and [this post][TimeZoneIDs] about available time zone IDs for ``. - ----- - -- ### **Math** - > /papi ecloud download Math - - Lets you make simple or advanced calculations. - Any placeholder that returns a number is supported (Use `{placeholder}` instead of `%placeholder%`) - - Supports all calculations you can do with [EvalEx](https://github.com/uklimaschewski/EvalEx). - Note that the `%` can't be used within the placeholder and that you have to use `[prc]` instead. - - ``` - %math_% - %math_[precision]:[rounding]_% - ``` - ----- - -- ### **MVdW Placeholders** - > /papi ecloud download MVdW - - Lets you use placeholders from [MVdWPlaceholderAPI](https://www.spigotmc.org/resources/11182/). - MVdWPlaceholderAPI and one of **[Maxims plugins](https://www.spigotmc.org/resources/2691/)**, that use it, are required! - A list of his placeholders can be found [here](https://www.spigotmc.org/wiki/mvdw-placeholders/) - - ``` - %mvdw_% - ``` - ----- - -- ### **MySQL** - > NO DOWNLOAD COMMAND - - ``` - %mysql_% - ``` - - `` is a set query that can be found in the config.yml under `plugins/PlaceholderAPI/expansion/MySQL`. - ----- - -- ### **MySQLTokens** - > NO DOWNLOAD COMMAND - - ``` - %mysqltokens_tokens% - ``` - ----- - -- ### **NumberFormatter** - > Download it from [here](https://github.com/TeamVK/PAPI-NumberFormatter/releases) - - More info about this expansion can be found on the [PAPI-NumberFormatter](https://github.com/TeamVK/PAPI-NumberFormatter). - - For instance: - - if %tokenenchant_token_long% returns 43535709321,
- %nf_4X_tokenenchant_token_long% will return 43B,
- %nf_###E0X_tokenenchant_token_long% will return 43.5B,
- %nf_#,##0.#_tokenenchant_token_long% will return 43,535,709,321
- %nf_#,##0.0#:IT_tokenenchant_token_long% will return 43.535.709.321,0
- - `[]` is optional and `<>` is required. - - ``` - %nf_[:locale]_% # Converts a number produced by %other_placeholder% to a number using the specified format. - ``` - ----- - -- ### **OtherPlayer** - > /papi ecloud download OtherPlayer - - Lets you get placeholders for other players. (Not the one that triggers the action) - - ``` - %otherplayer_displayname_% - %otherplayer_gamemode_% - %otherplayer_hasperm__perm_% - %otherplayer_haspotioneffect__effect_% - %otherplayer_health_% - %otherplayer_hunger_% - %otherplayer_iteminhand_% - %otherplayer_ip_% - %otherplayer_level_% - %otherplayer_locx_% - %otherplayer_locy_% - %otherplayer_locz_% - %otherplayer_oxygen_% - %otherplayer_spells_% - %otherplayer_uuid_% - %otherplayer_world_% - ``` - ----- - -- ### **ParseNear** - > /papi ecloud download ParseNear - - Lets you parse any placeholder for the closest player. Will return blank if no player is found. - - ``` - %parsenear_% # Parses placeholder for closest player - %parsenear__% # Parses placeholder for closest player in a radius - ``` - ----- - -- ### **ParseOther** - > /papi ecloud download ParseOther - - Lets you parse any placeholder for another player. - You must use the unsafe placeholder to parse placeholders for `username` or `uuid`. - Make sure to include the `{}` brackets, as it won't work without them. - - ``` - %parseother_{username}_{placeholder_without_percent_signs}% - %parseother_unsafe_{placeholder_for_username}_{placeholder_without_percent_signs}% - %parseother_{uuid}_{placeholder_without_percent_signs}% - %parseother_unsafe_{placeholder_for_uuid}_{placeholder_without_percent_signs}% - ``` - ----- - -- ### **Pinger** - > /papi ecloud download Pinger - - Lets you ping a server through an IP or domain (with port), to check the online-status and to receive some information. - The placeholders have a "warmup" time of around one or two minutes after installing the expansion. - - **Note**: These placeholders have a separate update-delay in the config.yml of PlaceholderAPI - - Replace `testplugins.com:25565` with your own server/IP. - ``` - %pinger_gameversion_testplugins.com:25565% - %pinger_version_testplugins.com:25565% - %pinger_online_testplugins.com:25565% - %pinger_isonline_testplugins.com:25565% - %pinger_max_testplugins.com:25565% - %pinger_players_testplugins.com:25565% - %pinger_motd_testplugins.com:25565% - %pinger_pingversion_testplugins.com:25565% - ``` - `%pinger_online_testplugins.com:25565%` and `%pinger_isonline_testplugins.com:25565%` do the exact same thing. - ----- - -- ### **Player** - > /papi ecloud download Player - - Gives you various placeholders for the player, that triggers the action. - - ``` - %player_allow_flight% - %player_armor_helmet_name% - %player_armor_helmet_data% - %player_armor_helmet_durability% - %player_armor_chestplate_name% - %player_armor_chestplate_data% - %player_armor_chestplate_durability% - %player_armor_leggings_name% - %player_armor_leggings_data% - %player_armor_leggings_durability% - %player_armor_boots_name% - %player_armor_boots_data% - %player_armor_boots_durability% - %player_bed_x% - %player_bed_y% - %player_bed_z% - %player_bed_world% - %player_biome% - %player_biome_capitalized% - %player_block_underneath% - %player_can_pickup_items% - %player_colored_ping% - %player_compass_world% - %player_compass_x% - %player_compass_y% - %player_compass_z% - %player_custom_name% - %player_current_exp% - %player_direction% - %player_direction_xz% - %player_displayname% - %player_list_name% - %player_exp% - %player_exp_to_level% - %player_first_join_date% - %player_first_played% - %player_first_join% - %player_first_played_formatted% - %player_fly_speed% - %player_food_level% - %player_gamemode% - %player_has_empty_slot% - %player_has_played_before% - %player_empty_slots% - %player_has_health_boost% - %player_has_potioneffect_% - %player_has_permission_% - %player_health% - %player_health_boost% - %player_health_rounded% - %player_health_scale% - %player_ip% - %player_online% - %player_is_whitelisted% - %player_is_banned% - %player_is_flying% - %player_is_sneaking% - %player_is_sprinting% - %player_is_sleeping% - %player_is_inside_vehicle% - %player_is_op% - %player_item_in_hand% - %player_item_in_hand_name% - %player_item_in_hand_data% - %player_item_in_hand_durability% - %player_item_in_hand_level_% - %player_item_in_offhand% - %player_item_in_offhand_name% - %player_item_in_offhand_data% - %player_item_in_offhand_durability% - %player_item_in_offhand_level_% - %player_locale% - %player_locale_display_name% - %player_locale_short% - %player_locale_country% - %player_locale_display_country% - %player_last_damage% - %player_last_played% - %player_last_join% - %player_last_played_formatted% - %player_last_join_date% - %player_level% - %player_light_level% - %player_max_air% - %player_max_health% - %player_max_health_rounded% - %player_max_no_damage_ticks% - %player_minutes_lived% - %player_name% - %player_no_damage_ticks% - %player_ping% - %player_ping_% - %player_remaining_air% - %player_saturation% - %player_seconds_lived% - %player_sleep_ticks% - %player_thunder_duration% - %player_ticks_lived% - %player_time% - %player_time_offset% - %player_total_exp% - %player_uuid% - %player_walk_speed% - %player_weather_duration% - %player_world% - %player_world_type% - %player_world_time_12% - %player_world_time_24% - %player_x% - %player_y% - %player_z% - %player_yaw% - %player_pitch% - %player_absorption% - ``` - ----- - -- ### PlayerList - > /papi ecloud download playerlist - - More info about this expansion can be found on the [GitHub-Repository](https://github.com/Tanguygab/PlayerList-PlaceholderAPI-Expansion/wiki). - - Create a list in PAPI's config and retrieve it through placeholders! - ``` - %playerlist__% - ``` - ----- - -- ### **Plugin** - > /papi ecloud download Plugin - - Returns information about the specified plugin. - - ``` - %plugin_isenabled_% - %plugin_isdisabled_% - %plugin_exists_% - ``` - ----- - -- ### **Progress** - > /papi ecloud download progress - - More info about this expansion can be found on the [GitHub-Repository](https://github.com/aBo0oDyy/Progress-Expansion). - - ``` - %progress_bar_{placeholder}% - %progress_bar_{placeholder}_c:% - %progress_bar_{placeholder}_p:% - %progress_bar_{placeholder}_r:% - %progress_bar_{placeholder}_l:% - %progress_bar_{placeholder}_m:% - %progress_bar_{placeholder}_fullbar:% - - # Example - %progress_bar_{placeholder}_c:&a■_p:&e■_r:&7■_l:10_m:100_fullbar:&aCompleted!% - ``` - ----- - -- ### **RainbowColor** - > /papi ecloud download RainbowColor - - More info about the expansion can be found on the [GitHub-Repository](https://github.com/aBo0oDyy/RainbowColor-Expansion). - - ``` - %RainbowColor_% - %RainbowColor_custom_,,_% - - e.g. %RainbowColor_custom_a,f,e,b_This is an example% - ``` - ----- - -- ### **RandomColor** - > /papi ecloud download RandomColor - - More info about the expansion can be found on the [GitHub-Repository](https://github.com/Andre601/RandomColor). - - ``` - %randomcolor_all% - %randomcolor_color% - %randomcolor_combined% - %randomcolor_format% - %randomcolor_selected_% - ``` - ----- - -- ### **RandomNumber** - > Download it from [here](https://github.com/TeamVK/PAPI-RandomNumber/releases) - - More info about the expansion can be found on the [GitHub-Repository](https://github.com/TeamVK/PAPI-RandomNumber). - - It returns an auto-scaled random number. If you did not specify the scale, the scale will be automatically computed. If both min and max are integer numbers, the returned random number will also be an integer. - - ``` - %randomnumber_value% - %randomnumber_value_scale% - %randomnumber_value_min_max% - %randomnumber_value_min_max_scale% - ``` - ----- - -- ### **RedisBungee** - > /papi ecloud download RedisBungee - - Same like the [BungeeCord-placeholders](#bungeecord), but for RedisBungee - - ``` - %redisbungee_total% - %redisbungee_% - ``` - ----- - -- ### **RelCon** - > /papi ecloud download RelCon - - More info about the expansion can be found on the [GitHub-Repository](https://github.com/PlaceholderAPI/RelCon-Expansion). - - ``` - %rel_relcon_player___[text2]% - %rel_relcon_player__% - %rel_relcon_viewer___[text2]% - %rel_relcon_viewer__% - ``` - ----- - -- ### **RNG** - > /papi ecloud download RNG - - More info about the expansion can be found on the [GitHub-Repository](https://github.com/Kqliber/Expansion-RNG). - - ``` - %rng_online_player% - %rng_random% - %rng_,% - ``` - ----- - -- ### **ScoreboardObjectives** - > /papi ecloud download ScoreboardObjectives - - Get info from a scoreboard objective. - - More info about the expansion can be found on the [Spigot Page](https://www.spigotmc.org/resources/placeholderapi-scoreboard-objectives-placeholder.48236/) - - ``` - %objective_displayname_{}% - %objective_score_{}% - %objective_score_{}_{[otherEntry]}% - %objective_scorep_{}% - %objective_scorep_{}_{[otherPlayer]}% - %objective_scoreposhigh_{}_{<#>}% - %objective_scoreposlow_{}_{<#>}% - %objective_entryposhigh_{}_{<#>}% - %objective_entryposlow_{}_{<#>}% - ``` - ----- - -- ### **Server** - > /papi ecloud download Server - - Lets you get information about the server. - - ``` - %server_name% - %server_online% - %server_version% - %server_max_players% - %server_unique_joins% - %server_uptime% - %server_ram_used% - %server_ram_free% - %server_ram_total% - %server_ram_max% - %server_tps% - %server_tps_1% - %server_tps_5% - %server_tps_15% - %server_tps_1_colored% - %server_tps_5_colored% - %server_tps_15_colored% - %server_online_% - %server_has_whitelist% - %server_total_chunks% - %server_total_living_entities% - %server_total_entities% - %server_time_% - %server_countdown__