Merge pull request #1032 from Andre601/wiki

[Proposal] Move Wiki to GitHub Pages using MkDocs
This commit is contained in:
Andre_601 2024-01-26 14:32:48 +01:00 committed by GitHub
commit fad217cd15
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
48 changed files with 9404 additions and 8823 deletions

67
.github/workflows/publish_site.yml vendored Normal file
View File

@ -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 mkdocs-material
- 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

View File

@ -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'

41
.theme/main.html Normal file
View File

@ -0,0 +1,41 @@
{% extends "base.html" %}
{% block extrahead %}
{% if page and page.meta %}
{% set title = config.site_name %}
{% if page.meta.title %}
<meta property="og:title" content="{{ page.meta.title }} - {{ title }}">
<meta name="twitter:title" content="{{ page.meta.title }} - {{ title }}">
{% elif page.title and not page.is_homepage %}
<meta property="og:title" content="{{ title }} - {{ page.title | striptags }}">
<meta name="twitter:title" content="{{ title }} - {{ page.title | striptags }}">
{% else %}
<meta property="og:title" content="{{ title }}">
<meta name="twitter:title" content="{{ title }}">
{% endif %}
{% if page.meta.description %}
<meta property="og:description" content="{{ page.meta.description }}">
<meta name="twitter:description" content="{{ page.meta.description }}">
{% else %}
<meta property="og:description" content="{{ config.site_description }}">
<meta name="twitter:description" content="{{ config.site_description }}">
{% endif %}
{% endif %}
<meta name="theme-color" content="#4051b5">
<meta property="og:type" content="website">
<meta property="og:url" content="{{ page.canonical_url }}">
<meta property="og:image" content="{{ config.site_url | url }}assets/img/favicons/android-chrome-512x512.png">
<meta property="og:image:type" content="image/png">
<meta name="twitter:card" content="summary">
<meta name="twitter:creator" content="Chaos League Wiki Team">
<meta name="twitter:image" content="{{ config.site_url | url }}assets/img/favicons/android-chrome-512x512.png">
<link rel="apple-touch-icon" sizes="180x180" href="{{ config.site_url | url }}assets/img/favicons/apple-touch-icon.png">
<link rel="icon" type="image/png" sizes="32x32" href="{{ config.site_url | url }}assets/img/favicons/favicon-32x32.png">
<link rel="icon" type="image/png" sizes="16x16" href="{{ config.site_url | url }}assets/img/favicons/favicon-16x16.png">
<link referrerpolicy="manifest" href="{{ config.site_url | url }}assets/web.manifest">
{% endblock %}

View File

@ -0,0 +1,24 @@
<div class="md-copyright">
<div class="md-copyright__highlight">
&copy; PlaceholderAPI Team and Contributors.<br>
All content is licensed under
<a href="https://github.com/PlaceholderAPI/PlaceholderAPI/blob/master/LICENSE" target="_blank" rel="noopener">
<span class="twemoji">{% include ".icons/octicons/law-16.svg" %}</span> GNU GPL v3.0
</a>
unless stated otherwise.<br>
<br>
<a href="#__consent"><span class="twemoji">{% include ".icons/octicons/gear-16.svg" %}</span> Manage Cookies</a>
</div>
{% if not config.extra.generator == false %}
Made with
<a href="https://www.mkdocs.org" target="_blank" rel="noopener">
MkDocs
</a>,
<a href="https://squidfunk.github.io/mkdocs-material/" target="_blank" rel="noopener">
Material for MkDocs
</a> and
<a href="https://facelessuser.github.io/pymdown-extensions/" target="_blank" rel="noopener">
PyMdown Extensions
</a>
{% endif %}
</div>

View File

@ -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 <player|me> <string>`](#papi-bcparse)
- [`/papi cmdparse <player|me> <string>`](#papi-cmdparse)
- [`/papi parse <player|me> <string>`](#papi-parse)
- [`/papi parserel <player> <player> <string>`](#papi-parserel)
- **[eCloud Commands](#ecloud-commands)**
- [`/papi ecloud clear`](#papi-ecloud-clear)
- [`/papi ecloud disable`](#papi-ecloud-disable)
- [`/papi ecloud download <expansion> [version]`](#papi-ecloud-download)
- [`/papi ecloud enable`](#papi-ecloud-enable)
- [`/papi ecloud info <expansion> [version]`](#papi-ecloud-info)
- [`/papi ecloud list <all|<author>|installed>`](#papi-ecloud-list)
- [`/papi ecloud placeholders <expansion>`](#papi-ecloud-placeholders)
- [`/papi ecloud refresh`](#papi-ecloud-refresh)
- [`/papi ecloud status`](#papi-ecloud-status)
- **[Expansion Commands](#expansion-commands)**
- [`/papi info <expansion>`](#papi-info)
- [`/papi list`](#papi-list)
- [`/papi register <jar file>`](#papi-register)
- [`/papi unregister <jar file>`](#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**:
* `<player|me>` - The Player to parse values of the placeholder (Use `me` for yourself).
* `<Text with placeholders>` - 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**:
- `<player|me>` - The player to parse placeholders against. Use `me` for yourself.
- `<Command with placeholders>` - 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**:
* `<player|me>` - The Player to parse values of the placeholder (Use `me` for yourself).
* `<Text with placeholders>` - The text to parse.
**Example**:
```
/papi parse funnycube My group is %vault_group%
```
- #### `/papi parserel`
**Description**:
Parses a relational placeholder.
**Arguments**:
* `<player1>` - The first player.
* `<player2>` - the second player to compare with.
* `<Text with placeholders>` - 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**:
- `<expansion>` - 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**:
- `<expansion>` - 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**:
- `<all|<author>|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**:
- `<expansion>` - 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)**:
- `<expansion>` - 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**:
- `<filename>` - The file to register (including the file-extension).
**Example**:
```
/papi register MyExpansion.jar
```
- #### `/papi unregister`
**Description**:
Unregisters the specified expansion.
**Arguments**:
- `<filename>` - 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.

62
FAQ.md
View File

@ -1,62 +0,0 @@
[readme]: https://github.com/PlaceholderAPI/PlaceholderAPI/blob/wiki/README.md
Here are frequently asked questions about stuff related to PlaceholderAPI.
## What is an Expansion?
An expansion (aka PlaceholderExpansion) usualy refers to a separate jar file that is added to PlaceholderAPI's `expansion` folder to add extra placeholders to use in other plugins.
External PlaceholderExpansions are downloaded from PlaceholderAPI's eCloud through the [[`/papi ecloud download <expansion>`|Commands#papi-ecloud-download]] command.
Some plugins may provide their PlaceholderExpansion directly without any external jar file being used.
## It only shows `%placeholder%` and not the variable
When a plugin or `/papi parse me %placeholder%` only returns the placeholder itself and no value should you check for the following things:
- ### The expansion is actually installed.
In many cases is the cause that the expansion of the placeholder is missing.
Just execute `/papi ecloud download <name of expansion>` followed by `/papi reload` to activate it. You can find a list of Expansions and their Placeholders [[on this page|Placeholders]].
**NOTE!**
Not all placeholders come in their own expansion. Some plugins *hardcode* them in and load them on startup, when hooking into PlaceholderAPI.
- ### Plugin actually supports PlaceholderAPI
It can happen that the plugin you use to display the placeholder in doesn't support PlaceholderAPI. In such a case check, if the parse command returns the actual value of a placeholder.
If that is the case while the plugin is still displaying the placeholder, can this be an indicator of the plugin not supporting PlaceholderAPI.
You can find a list of plugins supporting PlaceholderAPI [[here|Plugins-using-PlaceholderAPI]].
Just make sure that "Supports placeholders" has a check mark in front of it.
- ### No typo in the placeholder
Double-check that the placeholder you set doesn't contain a typo. You can use `/papi ecloud placeholders <expansion>` (replace `<expansion>` with the name of the expansion) to get a list of all the placeholders the expansion may have.
Keep in mind that this only works for separate expansions on the eCloud and not for those that are loaded by plugins.
- ### Plugin is enabled
If an expansion depends on a plugin, make sure you have the plugin installed and that it is enabled (Shows green in `/pl`).
## I can't download the expansion
Make sure, that the connection to the cloud (https://api.extendedclip.com) isn't blocked by a firewall or similar.
Next step would be to check if the expansion actually exists on the cloud. Not all plugins provide their placeholders through a separate jar on the cloud. Some have them build in and register them on startup.
If both checks failed, go to the cloud-page and download the jar manually. Put it then in the `expansions` folder of PlaceholderAPI (`/plugins/PlaceholderAPI/expansions`).
Finally execute `/papi reload` to load the expansion.
## How can other plugins use my placeholders with PlaceholderAPI?
A tutorial can be found [[here|Hook into PlaceholderAPI]]!
## Can I help on this wiki?
You sure can!
We welcome contributions to our wiki by everyone. If you found a typo or want to improve this wiki in another way, head over to the [Wiki's readme file][readme] to find out about how you can contribute towards this wiki.
## PlaceholderAPI is posting an error about an outdated expansion?
```
[00:00:01 ERROR]: [PlaceholderAPI] Failed to load Expansion class <expansion> (Is a dependency missing?)
[00:00:01 ERROR]: [PlaceholderAPI] Cause: NoClassDefFoundError <path>
```
If you receive the above error, try to do the following steps:
- Make sure any required dependency of the mentioned expansion (e.g. a plugin) is installed.
- Make sure you use the latest version supported for the server version you use.
- If you downloaded the jar from the ecloud, make sure it isn't malformed/corrupted.
If the issue persists after you've done those checks, report it to the author of the expansion.
In most cases is the issue that either a dependency is missing or that the expansion tries to use outdated methods from PlaceholderAPI.

79
Home.md
View File

@ -1,79 +0,0 @@
<p align="center">
<img src="https://raw.githubusercontent.com/PlaceholderAPI/PlaceholderAPI/wiki/img/wiki-logo.png" alt="PlaceholderAPI">
</p>
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]]

View File

@ -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%`.

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -9,8 +9,7 @@
[expansion-generator]: https://papi.andre601.ch
[andre]: https://github.com/Andre601
[andrew]: https://github.com/Andrew-Chen-Wang
[action]: https://github.com/Andrew-Chen-Wang/github-wiki-action
[mkdocs]: https://www.mkdocs.org
<!-- Images -->
@ -30,7 +29,7 @@ You need to make a fork of the PlaceholderAPI Repository to contribute towards t
To fork the repository, click the button on the top-right that says "Fork". In the new page, select the account/organisation you want to fork this repository towards and make sure to have "Copy the `master` branch only" unchecked, so that the `wiki` branch is copied too.
After this, click "Create fork".
![fork repo](./img/readme/fork.png)
![fork repo](docs/assets/img/readme/fork.png)
The forking process should only take a few seconds and you should be redirected to your fork afterwards.
@ -38,7 +37,7 @@ The forking process should only take a few seconds and you should be redirected
All main changes to the wiki are made on the dedicated `wiki` branch.
Before you try to make any changes should you make sure that you have the `wiki` branch selected. To do that, check the button next to the `X branches` text. If it says anything other than `wiki` will you need to click it and select the right branch.
![select branch](./img/readme/select-branch.png)
![select branch](docs/assets/img/readme/select-branch.png)
### Fetch Changes from Upstream
This is only required when you already had a fork and didn't update it for some time.
@ -48,10 +47,10 @@ Depending on the status of your branch can the prompt show different outcomes:
- `This branch is not behind the upstream PlaceholderAPI:wiki`
Your fork's `wiki` branch is up-to-date with the latest changes from Upstream (This Repository). You don't have to update anything.
![upstream up-to-date](./img/readme/up-to-date.png)
![upstream up-to-date](docs/assets/img/readme/up-to-date.png)
- `This branch is out-of-date`
Your fork's `wiki` branch is outdated and should be updated. Press the "Update branch" button to do so.
![upstream needs update](./img/readme/needs-update.png)
![upstream needs update](docs/assets/img/readme/needs-update.png)
### Commit changes
To commit changes will you need to choose, if you want to directly commit to your fork's `wiki` branch, or make a dedicated branch for it.
@ -59,7 +58,7 @@ To commit changes will you need to choose, if you want to directly commit to you
#### Make separate branch (Optional)
If you want to have a dedicated branch for it, will you need to click the button saying `wiki`, type in the small text field the name of the branch you want to use and click the text saying `Create branch: <branch> from 'wiki'`
![create branch](./img/readme/new-branch.png)
![create branch](docs/assets/img/readme/new-branch.png)
After that should you now have a separate branch that is based of the `wiki` branch and you can finally commit changes to it.
@ -81,13 +80,13 @@ These rules are as follows:
When you add a new expansion to the wiki's [Placeholder page][placeholders] will you need to follow the following format:
````markdown
- ### [:name](:link)
> :command
:text
```
:placeholders
```
> :command
:text
```
:placeholders
```
````
There are a few extra rules you need to also keep in mind:
@ -107,29 +106,29 @@ When your Expansion's entry is after and/or before other entries will you need t
##### Example:
````markdown
- ### SomeExpansion
> NO DOWNLOAD COMMAND
```
%someexpansion_placeholder%
```
> NO DOWNLOAD COMMAND
```
%someexpansion_placeholder%
```
----
- ### YourExpansion
> NO DOWNLOAD COMMAND
```
%yourexpansion_placeholder%
```
> NO DOWNLOAD COMMAND
```
%yourexpansion_placeholder%
```
----
- ### AnotherExpansion
> NO DOWNLOAD COMMAND
```
%anotherexpansion_placeholder%
```
> NO DOWNLOAD COMMAND
```
%anotherexpansion_placeholder%
```
````
After you added your expansion to this page will you also need to add an entry to the list at the top of the page.
@ -144,8 +143,8 @@ Similar to the [Placeholders page][placeholders] does this page follow a specifi
```markdown
- [:name](:link)
- [?] Supports placeholders.
- [?] Provides own placeholders. [:page]
- [?] Supports placeholders.
- [?] Provides own placeholders. [:page]
```
Here are the following rules:
@ -157,7 +156,7 @@ Here are the following rules:
This means that f.e. https://www.spigotmc.org/resources/placeholderapi.6245/ becomes https://www.spigotmc.org/resources/6245/
- `[?]` needs to be replaced with either `[ ]` or `[x]` depending on whether the mentioned option is supported or not.
- `:page` needs to replace with the right value, depending on the conditions.
- If your plugin provides own Placeholders for other plugins to use can you set `**[[Link|Placeholders#:name]]**` where `:name` is the title you set in the placeholders page.
- If your plugin provides own Placeholders for other plugins to use can you set `**[[Link](placeholder-list.md#:name)]**` where `:name` is the title you set in the placeholders page.
- If your plugin does not provide own placeholders will you need to set `Link`.
### Make a Pull request
@ -166,15 +165,15 @@ After you made your changes is it time to make a Pull request.
When you made changes to the branch should GitHub show you a prompt with a button saying "Compare & pull request". This prompt also shows up when you visit the upstream Repository while having changes on your fork.
Press the button to proceed.
![pr prompt](./img/readme/pr-prompt.png)
![pr prompt](docs/assets/img/readme/pr-prompt.png)
By default will GitHub select the `master` branch as the target, which is not what we want. To fix this, click the button saying `base:master` and select the `wiki` branch.
> **Note**
> [!NOTE]
> When the branch selection only shows branches and not the actual repositories does it mean that you're prompted to PR to your own fork.
> To fix this, press the "compare across forks" text shown, select `PlaceholderAPI/PlaceholderAPI` as the target repository (left side) and your fork as the source. Then select the wiki branch as mentioned above.
![create pr](./img/readme/create-pr.png)
![create pr](docs/assets/img/readme/create-pr.png)
Finally, fill out the Pull request template and submit the Pull request.
Congratulations! You've successfully made a Pull request for the wiki.
@ -187,4 +186,4 @@ A simple [online-tool][expansion-generator] is provided by Andre601 that allows
### Credits
- The Wiki is maintained by [Andre601][andre].
- We use the [GitHub Wiki Action][action] by [Andrew-Chen-Wang][andrew] to update the PlaceholderAPI wiki through GitHub Actions.
- We use [MkDocs][mkdocs] to turn the Markdown files into static HTML pages that then get uploaded to GitHub Pages through GitHub Actions.

View File

@ -1,23 +0,0 @@
[papi]: https://placeholderapi.com
[discordImg]: https://img.shields.io/discord/164280494874165248.svg?logo=discord&label=Discord&colorB=7289DA
[discord]: https://helpch.at/discord
[jenkinsImg]: https://img.shields.io/badge/Download%20from-Jenkins-brightgreen.svg
[jenkins]: http://ci.extendedclip.com/job/PlaceholderAPI/
[licenseImg]: https://img.shields.io/github/license/PlaceholderAPI/PlaceholderAPI.svg
[license]: https://github.com/PlaceholderAPI/PlaceholderAPI/blob/master/LICENSE
[issuesImg]: https://img.shields.io/github/issues-raw/PlaceholderAPI/PlaceholderAPI.svg?logo=github&logoColor=white
[issues]: https://github.com/PlaceholderAPI/PlaceholderAPI/issues
[versionImg]: https://img.shields.io/nexus/placeholderapi/me.clip/placeholderapi?server=https%3A%2F%2Frepo.extendedclip.com&label=API%20Version
[plugin-page]: https://spigotmc.org/resources/6245
> © 2015 - 2023 [PlaceholderAPI Team][papi]
> Thanks for using PlaceholderAPI.
>
> **[Plugin-page]** | **[[Placeholders]]** | **[[Plugins using PlaceholderAPI]]** | **[[Hook into PlaceholderAPI]]**
>
> ![versionImg] [![jenkinsImg]][jenkins] [![licenseImg]][license] [![issuesImg]][issues] [![discordImg]][discord]

View File

@ -1,79 +0,0 @@
<p align="center">
<img src="https://raw.githubusercontent.com/PlaceholderAPI/PlaceholderAPI/wiki/img/icon.png" alt="PlaceholderAPI">
</p>
**[[Main page|Home]]**
### 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]]

1
docs/CNAME Normal file
View File

@ -0,0 +1 @@
wiki.placeholderapi.com

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 70 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 537 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

View File

Before

Width:  |  Height:  |  Size: 18 KiB

After

Width:  |  Height:  |  Size: 18 KiB

View File

Before

Width:  |  Height:  |  Size: 55 KiB

After

Width:  |  Height:  |  Size: 55 KiB

View File

Before

Width:  |  Height:  |  Size: 32 KiB

After

Width:  |  Height:  |  Size: 32 KiB

View File

Before

Width:  |  Height:  |  Size: 12 KiB

After

Width:  |  Height:  |  Size: 12 KiB

View File

Before

Width:  |  Height:  |  Size: 12 KiB

After

Width:  |  Height:  |  Size: 12 KiB

View File

Before

Width:  |  Height:  |  Size: 9.9 KiB

After

Width:  |  Height:  |  Size: 9.9 KiB

View File

Before

Width:  |  Height:  |  Size: 19 KiB

After

Width:  |  Height:  |  Size: 19 KiB

View File

Before

Width:  |  Height:  |  Size: 12 KiB

After

Width:  |  Height:  |  Size: 12 KiB

View File

Before

Width:  |  Height:  |  Size: 12 KiB

After

Width:  |  Height:  |  Size: 12 KiB

View File

@ -0,0 +1,31 @@
document$.subscribe(async => {
const api_code = document.querySelectorAll('[data-md-component="api-version"]');
function loadAPIInfo(data) {
const version = data["version"];
const versionToken = "{version}";
for (const codeBlock of api_code) {
codeBlock.innerHTML = codeBlock.innerHTML.replace(new RegExp(versionToken, 'g'), version);
}
}
async function fetchAPIInfo() {
const release = await fetch("https://papi-repo-proxy.vercel.app/repo/latest-release").then(_ => _.json());
const data = {
"version": release.name
}
__md_set("__api_tag", data, sessionStorage);
loadAPIInfo(data);
}
if(location.href.includes("/developers/using-placeholderapi")) {
const cachedApi = __md_get("__api_tag", sessionStorage);
if ((cachedApi != null) && (cachedApi["version"])) {
loadAPIInfo(cachedApi);
} else {
fetchAPIInfo();
}
}
})

View File

@ -0,0 +1 @@
{"name":"","short_name":"","icons":[{"src":"./img/favicons/android-chrome-192x192.png","sizes":"192x192","type":"image/png"},{"src":"./img/favicons/android-chrome-512x512.png","sizes":"512x512","type":"image/png"}],"theme_color":"#ffffff","background_color":"#ffffff","display":"standalone"}

View File

@ -0,0 +1,61 @@
:root {
--magiclink-github-icon: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16"><path d="M8 0c4.42 0 8 3.58 8 8a8.013 8.013 0 0 1-5.45 7.59c-.4.08-.55-.17-.55-.38 0-.27.01-1.13.01-2.2 0-.75-.25-1.23-.54-1.48 1.78-.2 3.65-.88 3.65-3.95 0-.88-.31-1.59-.82-2.15.08-.2.36-1.02-.08-2.12 0 0-.67-.22-2.2.82-.64-.18-1.32-.27-2-.27-.68 0-1.36.09-2 .27-1.53-1.03-2.2-.82-2.2-.82-.44 1.1-.16 1.92-.08 2.12-.51.56-.82 1.28-.82 2.15 0 3.06 1.86 3.75 3.64 3.95-.23.2-.44.55-.51 1.07-.46.21-1.61.55-2.33-.66-.15-.24-.6-.83-1.23-.82-.67.01-.27.38.01.53.34.19.73.9.82 1.13.16.45.68 1.31 2.69.94 0 .67.01 1.3.01 1.49 0 .21-.15.45-.55.38A7.995 7.995 0 0 1 0 8c0-4.42 3.58-8 8-8Z"></path></svg>');
--magiclink-github-pull-icon: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16"><path d="M1.5 3.25a2.25 2.25 0 1 1 3 2.122v5.256a2.251 2.251 0 1 1-1.5 0V5.372A2.25 2.25 0 0 1 1.5 3.25Zm5.677-.177L9.573.677A.25.25 0 0 1 10 .854V2.5h1A2.5 2.5 0 0 1 13.5 5v5.628a2.251 2.251 0 1 1-1.5 0V5a1 1 0 0 0-1-1h-1v1.646a.25.25 0 0 1-.427.177L7.177 3.427a.25.25 0 0 1 0-.354ZM3.75 2.5a.75.75 0 1 0 0 1.5.75.75 0 0 0 0-1.5Zm0 9.5a.75.75 0 1 0 0 1.5.75.75 0 0 0 0-1.5Zm8.25.75a.75.75 0 1 0 1.5 0 .75.75 0 0 0-1.5 0Z"></path></svg>');
--magiclink-github-issue-icon: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16"><path d="M8 9.5a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3Z"></path><path d="M8 0a8 8 0 1 1 0 16A8 8 0 0 1 8 0ZM1.5 8a6.5 6.5 0 1 0 13 0 6.5 6.5 0 0 0-13 0Z"></path></svg>');
--magiclink-github-discussion-icon: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16"><path d="M1.75 1h8.5c.966 0 1.75.784 1.75 1.75v5.5A1.75 1.75 0 0 1 10.25 10H7.061l-2.574 2.573A1.458 1.458 0 0 1 2 11.543V10h-.25A1.75 1.75 0 0 1 0 8.25v-5.5C0 1.784.784 1 1.75 1ZM1.5 2.75v5.5c0 .138.112.25.25.25h1a.75.75 0 0 1 .75.75v2.19l2.72-2.72a.749.749 0 0 1 .53-.22h3.5a.25.25 0 0 0 .25-.25v-5.5a.25.25 0 0 0-.25-.25h-8.5a.25.25 0 0 0-.25.25Zm13 2a.25.25 0 0 0-.25-.25h-.5a.75.75 0 0 1 0-1.5h.5c.966 0 1.75.784 1.75 1.75v5.5A1.75 1.75 0 0 1 14.25 12H14v1.543a1.458 1.458 0 0 1-2.487 1.03L9.22 12.28a.749.749 0 0 1 .326-1.275.749.749 0 0 1 .734.215l2.22 2.22v-2.19a.75.75 0 0 1 .75-.75h1a.25.25 0 0 0 .25-.25Z"></path></svg>');
}
.md-typeset .magiclink-repository.magiclink-github:not(.magiclink-ignore)::before {
-webkit-mask-image: var(--magiclink-github-icon);
mask-image: var(--magiclink-github-icon);
}
.md-typeset .magiclink-pull:not(.magiclink-ignore)::before {
-webkit-mask-image: var(--magiclink-github-pull-icon);
mask-image: var(--magiclink-github-pull-icon);
}
.md-typeset .magiclink-issue:not(.magiclink-ignore)::before {
-webkit-mask-image: var(--magiclink-github-issue-icon);
mask-image: var(--magiclink-github-issue-icon);
}
.md-typeset .magiclink-discussion:not(.magiclink-ignore)::before {
-webkit-mask-image: var(--magiclink-github-discussion-icon);
mask-image: var(--magiclink-github-discussion-icon);
}
.md-typeset .magiclink-repository.magiclink-github:not(.magiclink-ignore)::before,
.md-typeset .magiclink-pull:not(.magiclink-ignore)::before,
.md-typeset .magiclink-issue:not(.magiclink-ignore)::before,
.md-typeset .magiclink-discussion:not(.magiclink-ignore)::before {
position: absolute;
top: 0;
left: 0;
display: block;
box-sizing: border-box;
width: 1.25em;
height: 1.25em;
background-size: 1.25em;
background-color: var(--md-typeset-a-color);
transition: background-color 125ms;
-webkit-mask-repeat: no-repeat;
mask-repeat: no-repeat;
-webkit-mask-size: contain;
mask-size: contain;
content: "";
}
.md-typeset .magiclink-repository.magiclink-github:not(.magiclink-ignore):hover::before,
.md-typeset .magiclink-pull:not(.magiclink-ignore):hover::before,
.md-typeset .magiclink-issue:not(.magiclink-ignore):hover::before,
.md-typeset .magiclink-discussion:not(.magiclink-ignore):hover::before {
background-color: var(--md-accent-fg-color);
}
.md-typeset .magiclink-repository.magiclink-github:not(.magiclink-ignore),
.md-typeset .magiclink-pull:not(.magiclink-ignore),
.md-typeset .magiclink-issue:not(.magiclink-ignore),
.md-typeset .magiclink-discussion:not(.magiclink-ignore) {
position: relative;
padding-left: 1.375em;
}

View File

@ -0,0 +1,7 @@
.md-header__button.md-logo img {
height: 3rem;
}
.hide-list ul > li {
list-style-type: none;
}

View File

@ -1,3 +1,9 @@
---
description: List of common issues and how to solve them.
---
# Common Issues
This page lists common issues you may encounter with PlaceholderAPI and how you can solve them.
If you have more questions, feel free to join the [Discord Server](https://discord.gg/helpchat).

View File

@ -0,0 +1,484 @@
---
description: Comprehensive guide on how to create a PlaceholderExpansion for other plugins to use through PlaceholderAPI.
---
# Creating a PlaceholderExpansion
This page will cover how you can create your own [`PlaceholderExpansion`][placeholderexpansion] which you can either integrate into your own plugin (Recommended) or [upload to the eCloud](expansion-cloud.md).
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](../users/commands.md#papi-ecloud-download).
## Table of contents
- [Getting started](#getting-started)
- [Common Expansion Parts](#common-expansion-parts)
- [Making an Internal Expansion](#making-an-internal-expansion)
- [Full Example](#full-example-internal)
- [Register your Expansion](#register-your-expansion)
- [Making an External Expansion](#making-an-external-expansion)
- [Full Example (Without Dependency)](#full-example-external-no-dependency)
- [Full Example (With Dependency)](#full-example-external-dependency)
- [Making a relational Expansion](#making-a-relational-expansion)
- [Full Example](#full-example-relational)
## 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 Expansion Parts
All shown examples will share the same common parts that belong the the [`PlaceholderExpansion`][placeholderexpansion] class.
In order to not repeat the same basic info for each method throughout this page, and to greatly reduce the overall length, we will cover the most basic/necessary ones here.
#### Basic PlaceholderExpansion Structure
/// note |
Tab the :material-plus-circle: icons in the code block below for additional information.
///
```{ .java .annotate title="SomeExpansion.java" }
package at.helpch.placeholderapi.example.expansion;
import me.clip.placeholderapi.expansion.PlaceholderExpansion;
public class SomeExpansion extends PlaceholderExpansion {
@Override
public String getAuthor() {
return "Author"; // (1)
}
@Override
public String getIdentifier() {
return "example"; // (2)
}
@Override
public String getVersion() {
return "1.0.0"; // (3)
}
}
```
1. This method allows you to set the name of the expansion's author.
2. The identifier is the part in the placeholder that is between the first `%` (or `{` if bracket placeholders are used) and the first `_`.
The identifier may not contain `%`, `{`, `}` or `_`.
If you still want to use them in your expansion name, override the `getName()` method.
3. This method returns the version of the expansion.
Due to it being a string are you not limited to numbers alone, but it is recommended to stick with a number pattern.
PlaceholderAPI uses this String to compare with the latest version on the eCloud (if uploaded to it) to see if a new version is available.
If your expansion is included in a plugin, this does not matter.
You must also choose between one of these two methods for handling the actual parsing of placeholders (Exception being expansions providing [relational placeholders](#making-a-relational-expansion)):
- `onRequest(OfflinePlayer, String)`
The first parameter is the player that the placeholders are parsed against, given as an OfflinePlayer instance. This can be null.
The second parameter is the content of the placeholder after the first `_` and before the closing `%` (or `}` if bracket placeholders are used). This String is never null.
If not explicity overriden, this will automatically call `onPlaceholderRequest(Player, String)`, passing the parameters as-is to it.
This method is recommended as it allows the usage of offline players, meaning the player does not need to be online to obtain certain certain data from them such as name or UUID.
- `onPlaceholderRequest(Player, String)`
The first parameter is the player that the placeholders are parsed against, given as a Player instance. This can be null.
The second parameter is the content of the placeholder after the first `_` and before the closing `%` (or `}` if bracket placeholders are used). This String is never null.
If not set, this method will return `null` which PlaceholderAPI sees as an invalid placeholder.
/// note
PlaceholderAPI always calls `onRequest(Player, String)` in a PlaceholderExpansion.
///
----
## Making an Internal Expansion
Internal PlaceholderExpansions are classes directly integrated in the plugin they depend on.
This method of creating a PlaceholderExpansion is recommended as it has the following benefits:
- No `canRegister()` method override required. Since your expansion is part of the plugin it depends on is this override not required.
- Easier access to plugin data. Using dependency injection, you can more easily access data of your plugin such as config values.
/// warning | Important!
Internal PlaceholderExpansions are not automatically registered by PlaceholderAPI, due to them not being a separate jar file located in the expansion folder.
Please see the [Regsister your Expansion](#register-your-expansion) section for more details.
You are also required to override and set `persistent()` to `true`. This tells PlaceholderAPI to not unload your expansion during plugin reload, as it would otherwise unregister your expansion, making it no longer work.
///
/// details | Full Example
attrs: { id: full-example-internal }
type: example
//// note |
Please see the [Basic PlaceholderExpansion Structure](#basic-placeholderexpansion-structure) section for an explanation of all common methods in this example.
Tab the :material-plus-circle: icons in the code block below for additional information.
////
```{ .java .annotate title="SomeExpansion.java" }
package at.helpch.placeholderapi.example.expansion;
import at.helpch.placeholderapi.example.SomePlugin;
import me.clip.placeholderapi.expansion.PlaceholderExpansion;
import org.bukkit.OfflinePlayer;
import org.jetbrains.annotations.NotNull;
public class SomeExpansion extends PlaceholderExpansion {
private final SomePlugin plugin; // (1)
public SomeExpansion(SomePlugin plugin) {
this.plugin = plugin;
}
@Override
@NotNull
public String getAuthor() {
return String.join(", ", plugin.getDescription().getAuthors()); // (2)
}
@Override
@NotNull
public String getIdentifier() {
return "example";
}
@Override
@NotNull
public String getVersion() {
return plugin.getDescription().getVersion(); // (3)
}
@Override
public boolean persist() {
return true; // (4)
}
@Override
public String onRequest(OfflinePlayer player, @NotNull String params) {
if (params.equalsIgnoreCase("placeholder1")) {
return plugin.getConfig().getString("placeholders.placeholder1", "default1"); // (5)
}
if (params.equalsIgnoreCase("placeholder2")) {
return plugin.getConfig().getString("placeholders.placeholder1", "default1"); // (6)
}
return null; // (7)
}
}
```
1. Mockup plugin used to showcase the use of dependency injection to access specific plugin related data.
2. We can use the authors set in the plugin's `plugin.yml` file as the authors of this expansion.
3. Since our expansion is internal can this version be the same as the one defined in the plugin's `plugin.yml` file.
4. This needs to be set, or else will PlaceholderAPI unregister our expansion during a plugin reload.
5. Example of accessing data of the plugin's `config.yml` file.
6. Example of accessing data of the plugin's `config.yml` file.
7. Reaching this means that an invalid params String was given, so we return `null` to tell PlaceholderAPI that the placeholder was invalid.
///
### Register your Expansion
Due to the PlaceholderExpansion being internal, does PlaceholderAPI not load it automatically, requiring us to do it manually.
This is being done by creating a new instance of your PlaceholderExpansion class and calling the `register()` method of it.
Here is a quick example:
```{ .java .annotate title="SomePlugin.java" }
package at.helpch.placeholderapi.example;
import at.helpch.placeholderapi.example.expansion.SomeExpansion;
import org.bukkit.Bukkit;
import org.bukkit.plugin.java.JavaPlugin;
public class SomePlugin extends JavaPlugin {
@Override
public void onEnable() {
if (Bukkit.getPluginManager().isPluginEnabled("PlaceholderAPI")) { // (1)
new SomeExpansion(this).register(); // (2)
}
}
}
```
1. We check that PlaceholderAPI is present and enabled on the server, or else we would get Exceptions.
Also, make sure you [set PlaceholderAPI as depend or softdepend](using-placeholderapi.md#set-placeholderapi-as-softdepend) in your plugin's `plugin.yml` file!
2. This registers our expansion in PlaceholderAPI. It also gives the Plugin class as dependency injection to the Expansion class, so that we can use it.
----
## Making an External Expansion
External Expansions are separate Jar files located inside PlaceholderAPI's `expansions` folder, that contain the [`PlaceholderExpansion`][placeholderexpansion] extending class.
It is recommended to only make external Expansions for the following situations.
- Your expansion does not rely on a plugin.
- Your expansion depends on a plugin and you can't directly include it (Plugin is not your own).
Should the above cases not match your situation, meaning your expansion is for a plugin you maintain, is the creation of an [internal Expansion](#making-an-internal-expansion) recommended.
Some benefits of an external expansion include automatic (re)loading of your expansion by PlaceholderAPI and having the option to [upload it to the eCloud](expansion-cloud.md) allowing the download of it through the [`/papi ecloud download` command](../users/commands.md#papi-ecloud-download).
Downsides include a more tedious setup in terms of checking for a required plugin being present.
/// details | Full Example (Without Dependency)
attrs: { id: full-example-external-no-dependency }
type: example
//// note |
Please see the [Basic PlaceholderExpansion Structure](#basic-placeholderexpansion-structure) section for an explanation of all common methods in this example.
Tab the :material-plus-circle: icons in the code block below for additional information.
////
This is an example expansion without any plugin dependency.
```{ .java .annotate title="SomeExpansion.java" }
package at.helpch.placeholderapi.example.expansion;
import me.clip.placeholderapi.expansion.PlaceholderExpansion;
import org.bukkit.OfflinePlayer;
import org.jetbrains.annotations.NotNull;
public class SomeExpansion extends PlaceholderExpansion {
@Override
@NotNull
public String getAuthor() {
return "Author";
}
@Override
@NotNull
public String getIdentifier() {
return "example";
}
@Override
@NotNull
public String getVersion() {
return "1.0.0";
}
@Override
public String onRequest(OfflinePlayer player, @NotNull String params) {
if (params.equalsIgnoreCase("placeholder1")) {
return "text1";
}
if (params.equalsIgnoreCase("placeholder2")) {
return "text2";
}
return null; // (1)
}
}
```
1. Reaching this means that an invalid params String was given, so we return `null` to tell PlaceholderAPI that the placeholder was invalid.
///
/// details | Full Example (With Dependency)
attrs: { id: full-example-external-dependency }
type: example
//// note |
Please see the [Basic PlaceholderExpansion Structure](#basic-placeholderexpansion-structure) section for an explanation of all common methods in this example.
Tab the :material-plus-circle: icons in the code block below for additional information.
////
This is an example expansion with a plugin dependency.
```{ .java .annotate title="SomeExpansion.java" }
package at.helpch.placeholderapi.example.expansion;
import at.helpch.placeholderapi.example.SomePlugin;
import me.clip.placeholderapi.expansion.PlaceholderExpansion;
import org.bukkit.Bukkit;
import org.bukkit.OfflinePlayer;
import org.jetbrains.annotations.NotNull;
public class SomeExpansion extends PlaceholderExpansion {
private SomePlugin plugin; // (1)
@Override
@NotNull
public String getAuthor() {
return "Author";
}
@Override
@NotNull
public String getIdentifier() {
return "example";
}
@Override
@NotNull
public String getVersion() {
return "1.0.0"
}
@Override
public String getRequiredPlugin() {
return "SomePlugin"; // (2)
}
@Override
public boolean canRegister() { // (3)
return (plugin = (SomePlugin) Bukkit.getPluginManager().getPlugin(getRequiredPlugin())) != null;
}
@Override
public String onRequest(OfflinePlayer player, @NotNull String params) {
if (params.equalsIgnoreCase("placeholder1")) {
return plugin.getConfig().getString("placeholders.placeholder1", "default1"); // (4)
}
if (params.equalsIgnoreCase("placeholder2")) {
return plugin.getConfig().getString("placeholders.placeholder1", "default1"); // (5)
}
return null; // (6)
}
}
```
1. We set the value of this instance in the `canRegister()` method, which means that it can't be set to be final.
2. The name of the plugin this expansion depends on.
It is recommended to set this, as it would result in PlaceholderAPI reporting any missing plugin for your expansion.
3. This does two things:
1. It sets the `plugin` instance to `SomePlugin` using Bukkit's PluginManager to retrieve a JavaPlugin instance that is cast to `SomePlugin`.
2. It checks if the retrieved instance is not null. If it is will this result in `canRegister()` returning false, resulting in PlaceholderAPI not loading our expansion.
4. Example of accessing data of the plugin's `config.yml` file.
5. Example of accessing data of the plugin's `config.yml` file.
6. Reaching this means that an invalid params String was given, so we return `null` to tell PlaceholderAPI that the placeholder was invalid.
///
----
## Making a relational Expansion
/// note
Relational Placeholders always start with `rel_` to properly identify them. This means that if you make a relational placeholder called `friends_is_friend` would the full placeholder be `%rel_friends_is_friend%`.
///
Relational PlaceholderExpansions are special in that bthey take two players as input, allowing you to give outputs based on their relation to each other.
To create a relational expansion you will need to implement the [`Relational`][relational] interface into your expansion. You also still need to extend the [`PlaceholderExpansion`][placeholderexpansion] class.
Implementing this interface will add the `onPlaceholderRequest(Player, Player, String)` with the first two arguments being the first and second player to use and the third argument being the content after the second `_` and before the final `%` (Or `}` if bracket placeholders are used) in the placeholder.
/// details | Full Example
attrs: { id: full-example-relational }
type: example
//// note |
Please see the [Basic PlaceholderExpansion Structure](#basic-placeholderexpansion-structure) section for an explanation of all common methods in this example.
Tab the :material-plus-circle: icons in the code block below for additional information.
////
This is a complete example of using relational placeholders.
For the sake of simplicity are we using the [internal Expansion setup](#making-an-internal-expansion) here and assume that `SomePlugin` offers a `areFriends(Player, Player)` method that returns true or false based on if the players are friends or not.
```{ .java .annotate title="SomeExpansion.java" }
package at.helpch.placeholderapi.example.expansion;
import at.helpch.placeholderapi.example.SomePlugin;
import me.clip.placeholderapi.expansion.PlaceholderExpansion;
import me.clip.placeholderapi.expansion.Relational
import org.bukkit.ChatColor;
import org.bukkit.Player;
import org.jetbrains.annotations.NotNull;
public class SomeExpansion extends PlaceholderExpansion implements Relational {
private final SomePlugin plugin; // (1)
public SomeExpansion(SomePlugin plugin) {
this.plugin = plugin;
}
@Override
@NotNull
public String getAuthor() {
return String.join(", ", plugin.getDescription().getAuthors()); // (2)
}
@Override
@NotNull
public String getIdentifier() {
return "example";
}
@Override
@NotNull
public String getVersion() {
return plugin.getDescription().getVersion(); // (3)
}
@Override
public boolean persist() {
return true; // (4)
}
@Override
public String onPlaceholderRequest(Player one, Player two, String identifier) {
if (one == null || two == null) {
return null; // (5)
}
if (identifier.equalsIgnoreCase("friends")) { // (6)
if (plugin.areFriends(one, two)) {
return ChatColor.GREEN + one.getName() + " and " + two.getName() + " are friends!";
} else {
return ChatColor.RED + one.getName() + " and " + two.getName() + " are not friends!";
}
}
return null; // (7)
}
}
```
1. Mockup plugin used to showcase the use of dependency injection to access specific plugin related data.
2. We can use the authors set in the plugin's `plugin.yml` file as the authors of this expansion.
3. Since our expansion is internal can this version be the same as the one defined in the plugin's `plugin.yml` file.
4. This needs to be set, or else will PlaceholderAPI unregister our expansion during a plugin reload.
5. Our placeholder requires both players to be present, so if either one is not will this return null.
6. In case the identifier matches (Meaning the placeholder is `%rel_example_friends%` or `{rel_example_friends}`) will we check if Player one and two are friends through our plugin's `areFriends(Player, Player)` method.
Should they be friends, return green text saying they are and else return red text saying they aren't.
7. Reaching this means that an invalid params String was given, so we return `null` to tell PlaceholderAPI that the placeholder was invalid.
Don't forget to [register your expansion](#register-your-expansion).
///
[placeholderexpansion]: https://github.com/PlaceholderAPI/PlaceholderAPI/blob/master/src/main/java/me/clip/placeholderapi/expansion/PlaceholderExpansion.java
[relational]: https://github.com/PlaceholderAPI/PlaceholderAPI/blob/master/src/main/java/me/clip/placeholderapi/expansion/Relational.java

View File

@ -1,68 +1,95 @@
---
description: Information about PlaceholderAPI's expansion cloud, including how to submit your own expansion or update it.
---
# eCloud
## About
PlaceholderAPI uses an expansion-cloud (A website that has all kinds of expansions stored), to download jar-files, that contain the placeholders for it to use.
PlaceholderAPI uses an expansion-cloud (A website that has all kinds of expansions stored), to download jar files, that contain the placeholders for it to use.
The expansion-cloud can be seen under https://api.extendedclip.com/home
## How it works
PlaceholderAPI connects to the ecloud on startup of your server, to check if the cloud is available and how many expansions are available on it.
If you run `/papi ecloud download <expansion>` PlaceholderAPI will connect to the site to first check if the specified expansion exists and then downloads it if it does.
Note that not all listed expansions are on the ecloud. Some are in the corresponding plugin itself and are registered on the startup of the server.
If you run [`/papi ecloud download <expansion>`](../users/commands.md#papi-ecloud-download), PlaceholderAPI will connect to the site to first check if the specified expansion exists and then downloads it if it does.
/// note
PlaceholderAPI can only download expansions that are verified on the eCloud. Any unverified expansion needs to be downloaded manually.
///
You can disable the connection to the cloud by setting `cloud_enabled` in the config.yml to false.
## Adding your own expansion
You can add your own expansion to the expansion-cloud for others to use.
In order to do that, you have to follow those steps:
1. Make sure you have created a seperate jar-file like explained on the page [[PlaceholderExpansion]].
1. Make sure you have created a seperate jar file as described in the [Creating a PlaceholderExpansion](creating-a-placeholderexpansion.md) page.
2. Create an account on the site, or log in, if you already have one.
3. Click on `Expansions` and then on [`Upload New`](https://api.extendedclip.com/manage/add/).
4. Fill out the required information. `Source URL` and `Dependency URL` are optional.
4. Fill out the required information. `Source URL` and `Dependency URL` are optional and would link to the source code and any dependency (plugin) of your expansion respectively.
5. Click on the button that says `Choose an file...` and select the jar of your expansion.
* **Important**! Make sure, that the name of the jar-file contains the same version like you set in the version-field!
/// warning |
**Important!**
Make sure, that the name of the jar file contains the same version like you set in the version field.
///
6. Click on `Submit Expansion`
Your expansion is now uploaded and will be reviewed by a moderator.
If everything is ok will your expansion be approved and will be available on the ecloud for PlaceholderAPI*.
> *You can only download verified Expansions through PlaceholderAPIs command, unless you enable the option `cloud_allow_unverified_expansions` in the config.yml
> Unverified expansions can be downloaded manually by going to the site and download it yourself.
> You can block specific expansions from being downloaded using the `PAPI_BLOCKED_EXPANSIONS` environment variable.
> It contains a comma separated list of expansion names, that should be blocked from being downloaded.
/// info | Note for Hosts
You can block specific expansions from being downloaded using the `PAPI_BLOCKED_EXPANSIONS` environment variable.
Just define it with a value of comma-separated expansion names that should not be downloadable by PlaceholderAPI.
This feature exists since version 2.11.4 of PlaceholderAPI.
///
## Updating your expansion
Before you update, please note the following:
If you aren't a verified dev and you upload an update, your expansion will become **unverified** until a moderator reviews the update and approves it!
It is recommended to only update the expansion, if it contains huge changes or bug fixes.
Updating your expansion will automatically make it unverified, requiring a site moderator to verify it again. This was made to combat malware from being uploaded and distributed.
To update your expansion, you first have to go to the list of [your expansions](https://api.extendedclip.com/manage/).
For that click on `Expansions` and select `Your Expansions`.
After that, follow those steps:
1. Click the name of the expansion, that you want to update.
2. Click on the button that says `Version`
3. Click on `Add Version`
4. Fill out the fields and upload the new jar.
* **Important**! Make sure, that the name of the jar-file contains the same version like you set in the version-field!
/// warning |
**Important!**
Make sure, that the name of the jar file contains the same version like you set in the version field.
///
5. Click on `Save Changes`
If you're a verified dev, your version will be approved and is available directly.
If you aren't a verified dev, you have to wait until a moderator approves the update.
Your version should now be uploaded to the eCloud. You can now ask a responsible staff member on the [HelpChat Discord](https://discord.gg/helpchat) to review your expansion to get it re-verified. Please remain patient and polite when asking.
## Downloading a specific expansion version
In some cases, you may want to use a specific, older version of expansion. Such a case could be for example, when you run an old server version and the newest version of an expansion uses methods that aren't available on that particular server version.
In some cases, you may want to use a specific, older version of an expansion. Such a case could be for example, when you run an old server version and the newest version of an expansion uses methods that aren't available on that particular server version, causing compatability issues.
For that case is there a way, to download a specific version of expansion. You can download the expansion either manually, or through PlaceholderAPI itself.
Here is how you can do it for each.
### Download with PlaceholderAPI
This is the easiest of both methods since it requires the least amount of effort.
Run the following command in-game or in your console to download a specific version:
`/papi ecloud download <expansion> [version]`
[`/papi ecloud download <expansion> [version]`](../users/commands.md#papi-ecloud-download)
To find out, what versions are available for the expansion, run `/papi ecloud info <expansion>`
You can then run `/papi ecloud versioninfo <expansion> <version>` to receive more infor about a specific version.
To find out, what versions are available for the expansion, run [`/papi ecloud info <expansion>`](../users/commands.md#papi-ecloud-info).
After you downloaded the specific version, run `/papi reload` to refresh the installed expansions.
After you downloaded the specific version, run [`/papi reload`](../users/commands.md#papi-reload) to refresh the installed expansions.
### Download manually
To download an expansion manually, you first have to connect to the website and go to the expansion of your choice.
There, you click on the button that says `Version` and click on the download-icon of the version you want to download.

37
docs/developers/index.md Normal file
View File

@ -0,0 +1,37 @@
---
description: Pages aimed at plugin developers who want to use PlaceholderAPI in their own plugin or want to make their own PlaceholderExpansion.
---
# Dev Guides
The pages listed under this section are meant for developers of plugins who want to either create PlaceholderExpansions or want to otherwise work with PlaceholderAPI (i.e. supporting external placeholders through it).
----
<div class="grid cards hide-list" markdown>
- ### Using PlaceholderAPI
----
Guide on how to use PlaceholderAPI in your own plugin.
- [:octicons-chevron-right-16: Go to Page](using-placeholderapi.md)
- ### Creating a PlaceholderExpansion
----
Comprehensive guide on how to create a PlaceholderExpansion for other plugins to use through PlaceholderAPI.
- [:octicons-chevron-right-16: Go to Page](creating-a-placeholderexpansion.md)
- ### eCloud
----
Information about PlaceholderAPI's expansion cloud, including how to submit your own expansion or update it.
- [:octicons-chevron-right-16: Go to Page](expansion-cloud.md)
</div>

View File

@ -1,28 +1,20 @@
[APIBadge]: https://img.shields.io/nexus/placeholderapi/me.clip/placeholderapi?server=https%3A%2F%2Frepo.extendedclip.com&label=API%20Version
---
description: Guide on how to use PlaceholderAPI in your own plugin.
---
[SpigotBadge]: https://img.shields.io/spiget/version/6245?label=Spigot
[Spigot]: https://spigotmc.org/resources/6245
[GitHubBadge]: https://img.shields.io/github/v/release/PlaceholderAPI/PlaceholderAPI?label=GitHub%20Release
[GitHub]: /PlaceholderAPI/PlaceholderAPI/releases/latest
> [![SpigotBadge]][Spigot] [![GitHubBadge]][GitHub]
>
> ![APIBadge]
>
> *The GitHub release may be different from the spigot release*
# Using PlaceholderAPI
This page is about using PlaceholderAPI in your own plugin, to either let other plugins use your plugin, or just use placeholders from other plugins in your own.
Please note, that the examples in this page are only available for **PlaceholderAPI 2.10.0 or higher**!
## First steps
Before you can actually make use of PlaceholderAPI, you first have to import it into your project.
### Import with Maven
To import PlaceholderAPI, simply add the following code to your **pom.xml**
Replace `{VERSION}` with the version listed at the top of this page.
```xml
Before you can actually make use of PlaceholderAPI, you first have to import it into your project.
Use the below code example matching your dependency manager.
/// tab | :simple-apachemaven: Maven
```{ .xml title="pom.xml" data-md-component="api-version" }
<repositories>
<repository>
<id>placeholderapi</id>
@ -33,17 +25,15 @@ Replace `{VERSION}` with the version listed at the top of this page.
<dependency>
<groupId>me.clip</groupId>
<artifactId>placeholderapi</artifactId>
<version>{VERSION}</version>
<version>{version}</version>
<scope>provided</scope>
</dependency>
</dependencies>
```
///
### Import with Gradle
Here is how you can import PlaceholderAPI through gradle.
Put this into your **Gradle.build**.
Replace `{VERSION}` with the version listed at the top of this page.
```gradle
/// tab | :simple-gradle: Gradle
```{ .groovy title="build.gradle" data-md-component="api-version" }
repositories {
maven {
url = 'https://repo.extendedclip.com/content/repositories/placeholderapi/'
@ -51,80 +41,102 @@ repositories {
}
dependencies {
compileOnly 'me.clip:placeholderapi:{VERSION}'
compileOnly 'me.clip:placeholderapi:{version}'
}
```
///
/// details | What is `{version}`?
type: question
Using Javascript, `{version}` is replaced with the latest available API version of PlaceholderAPI.
Should you see the placeholder as-is does it mean that you either block Javascript, or that the version couldn't be obtained in time during page load.
You can always find the latest version matching the API version on the [releases tab](https://github.com/PlaceholderAPI/PlaceholderAPI/releases) of the GitHub Repository.
///
### Set PlaceholderAPI as (soft)depend
Next step is to go to your plugin.yml or paper-plugin.yml and add PlaceholderAPI as a depend or softdepend, depending (no pun intended) on if it is optional or not.
**Example Softdepend**:
/// tab | :simple-spigotmc: plugin.yml
- `plugin.yml`
```yaml
name: ExamplePlugin
version: 1.0
author: author
main: your.main.path.Here
# This sets PlaceholderAPI as an optional dependency for your plugin.
softdepend: [PlaceholderAPI]
```
- `paper-plugin.yml`
```yaml
name: ExamplePlugin
version: 1.0
author: author
main: your.main.path.Here
dependencies:
server:
PlaceholderAPI:
# Load order is relative to the dependency. So here PlaceholderAPI loads before our plugin.
load: BEFORE
required: false
```
//// tab | Optional dependency
```yaml
name: ExamplePlugin
version: 1.0
author: author
main: your.main.path.Here
**Example Depend**:
# This sets PlaceholderAPI as an optional dependency for your plugin.
softdepend: [PlaceholderAPI]
```
////
- `plugin.yml`
```yaml
name: ExamplePlugin
version: 1.0
author: author
main: your.main.path.Here
# This sets PlaceholderAPI as a dependency for your plugin.
depend: [PlaceholderAPI]
```
- `paper-plugin.yml`
```yaml
name: ExamplePlugin
version: 1.0
author: author
main: your.main.path.Here
dependencies:
server:
PlaceholderAPI:
# Load order is relative to the dependency. So here PlaceholderAPI loads before our plugin.
load: BEFORE
required: true
```
//// tab | Required dependency
```yaml
name: ExamplePlugin
version: 1.0
author: author
main: your.main.path.Here
# This sets PlaceholderAPI as a required dependency for your plugin.
depend: [PlaceholderAPI]
```
////
///
/// tab | :fontawesome-regular-paper-plane: paper-plugin.yml
//// tab | Optional dependency
```yaml
name: ExamplePlugin
version: 1.0
author: author
main: your.main.path.Here
dependencies:
server:
PlaceholderAPI:
# Load order is relative to the dependency. So here PlaceholderAPI loads before our plugin.
load: BEFORE
required: false
```
////
//// tab | Required dependency
```yaml
name: ExamplePlugin
version: 1.0
author: author
main: your.main.path.Here
dependencies:
server:
PlaceholderAPI:
# Load order is relative to the dependency. So here PlaceholderAPI loads before our plugin.
load: BEFORE
required: true
```
////
///
## Adding placeholders to PlaceholderAPI
A full guide on how to create expansions can be found on the [[PlaceholderExpansion]] page of this wiki.
A full guide on how to create expansions can be found on the [Creating a PlaceholderExpansion](creating-a-placeholderexpansion.md) page.
## Setting placeholders in your plugin
PlaceholderAPI offers the ability, to automatically parse placeholders from other plugins within your own plugin, giving the ability for your plugin to support thousands of other placeholders without depending on each plugin individually.
To use placeholders from other plugins in our own plugin, we simply have to [(soft)depend on PlaceholderAPI](#set-placeholderapi-as-softdepend) and use the `setPlaceholders` method.
It is also important to point out, that any required plugin/dependency for an expansion has to be on the server and enabled, or the `setPlaceholders` method will just return the placeholder itself (do nothing).
**Example**:
Let's assume we want to send an own join message that shows the group a player has.
To achieve that, we can do the following:
/// example
Let's assume we want to send a custom join message that shows the primary group a player has.
To achieve this, we can do the following:
```java
package at.helpch.placeholderapi;
@ -166,7 +178,8 @@ public class JoinExample extends JavaPlugin implements Listener {
/*
* We parse the placeholders using "setPlaceholders"
* This would turn %vault_rank% into the name of the Group, that the
* joining player has.
* joining player has, assuming Vault and the Vault expansion are
* on the server.
*/
joinText = PlaceholderAPI.setPlaceholders(event.getPlayer(), joinText);
@ -174,3 +187,4 @@ public class JoinExample extends JavaPlugin implements Listener {
}
}
```
///

82
docs/faq.md Normal file
View File

@ -0,0 +1,82 @@
---
description: List of frequently asked questions and their answers.
---
# FAQ
Here are frequently asked questions about stuff related to PlaceholderAPI.
## What is an Expansion?
An expansion (or PlaceholderExpansion) refers to either a jar file or part of a plugin that provides placeholders to use through PlaceholderAPI itself.
Whether said expansion is a separate jar file or part of a plugin depends on the expansion itself and its main purpose.
Expansions that are separate jar files can be found on the eCloud and are downloadable through [`/papi ecloud download <expansion>`](users/commands.md#papi-ecloud-download) if the expansion is verified.
## It only shows `%placeholder%` and not the variable
When a plugin or [`/papi parse me %placeholder%`](users/commands.md#papi-parse) only returns the placeholder itself and no value should you check for the following things:
- ### The expansion is actually installed.
Some expansions may not be integrated into a plugin or don't even have a plugin to depend on, meaning that they may be their own separate jar file that you have to download.
Such expansions can usually be found on the eCloud of PlaceholderAPI and be downloaded using the [`/papi ecloud download <expansion>`](users/commands.md#papi-ecloud-download) command.
Whether an expansion is available on the eCloud or not can be found out in the [Placeholder List](users/placeholder-list.md) with any expansion displaying a papi command being downlodable.
- ### Plugin actually supports PlaceholderAPI
It can happen that the plugin you use to display the placeholder in doesn't support PlaceholderAPI. In such a case check, if the parse command returns the actual value of a placeholder.
If that is the case while the plugin is still displaying the placeholder, can this be an indicator of the plugin not supporting PlaceholderAPI.
You can find a list of plugins supporting PlaceholderAPI [here](users/plugins-using-placeholderapi.md).
Just make sure that "Supports placeholders" has a check mark in front of it.
- ### No typo in the placeholder
Double-check that the placeholder you set doesn't contain a typo. You can use [`/papi ecloud placeholders <expansion>`](users/commands.md#papi-ecloud-placeholders) (replace `<expansion>` with the name of the expansion) to get a list of all the placeholders the expansion may have.
Keep in mind that this only works for separate expansions on the eCloud and not for those that are loaded by plugins.
Additionally can the placeholder list from the eCloud be outdated. It is recommended to check the [Placeholder List](users/placeholder-list.md) or see if there is any documentation for the placeholders you want to use.
- ### Plugin is enabled
If an expansion depends on a plugin, make sure you have the plugin installed and that it is enabled (Shows green in `/pl`).
## I can't download the expansion
Make the following checks:
1. The connection to the eCloud (Located at https://api.extendedclip.com) is not blocked through a firewall or your server host.
2. The expansion you want to use is actually on the eCloud. Some expansions are included in a plugin directly.
3. The expansion is verified. Only verified expansions can be downloaded through PlaceholderAPI's download command. This is a security measure to prevent the spread of malware.
If the above checks are all fine and you still can't get the expansion through the download command, consider downloading it manually.
To do that, head to the expansion's page on the ecloud, download the jar file and put it into `/plugins/PlaceholderAPI/expansions/` before using [`/papi reload`](users/commands.md#papi-reload).
## How can other plugins use my placeholders with PlaceholderAPI?
See the [Using PlaceholderAPI](developers/using-placeholderapi.md) page.
## Can I help on this wiki?
You sure can!
We welcome contributions to our wiki by everyone. If you found a typo or want to improve this wiki in another way, head over to the [Wiki's readme file][readme] to find out about how you can contribute towards this wiki.
## PlaceholderAPI is posting an error about an outdated expansion?
```
[00:00:01 ERROR]: [PlaceholderAPI] Failed to load Expansion class <expansion> (Is a dependency missing?)
[00:00:01 ERROR]: [PlaceholderAPI] Cause: NoClassDefFoundError <path>
```
If you receive the above error, try to do the following steps:
- Make sure any required dependency of the mentioned expansion (e.g. a plugin) is installed.
- Make sure you use the latest version supported for the server version you use.
- If you downloaded the jar from the ecloud, make sure it isn't malformed/corrupted.
If the issue persists after you've done those checks, report it to the author of the expansion.
In most cases is the issue that either a dependency is missing or that the expansion tries to use outdated methods from PlaceholderAPI.
[readme]: https://github.com/PlaceholderAPI/PlaceholderAPI/blob/wiki/README.md

53
docs/index.md Normal file
View File

@ -0,0 +1,53 @@
# Welcome
![placeholderapi_logo](assets/img/wiki-logo.png){ align="center" }
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 community-curated list of all available Placeholder expansions and their placeholders.
## Navigation
<div class="grid cards hide-list" markdown>
- ### :material-account-file-text: User Guides
----
Pages aimed at server owners who want to utilize PlaceholderAPI.
Available pages:
- [:octicons-chevron-right-16: Commands](users/commands.md)
- [:octicons-chevron-right-16: Using Placeholders](users/using-placeholders.md)
- [:octicons-chevron-right-16: Placeholder List](users/placeholder-list.md)
- [:octicons-chevron-right-16: Plugins using PlaceholderAPI](users/plugins-using-placeholderapi.md)
- ### :material-file-code: Dev Guides
----
Pages aimed at plugin developers who want to use PlaceholderAPI in their own plugin or want to make their own PlaceholderExpansion.
Available pages:
- [:octicons-chevron-right-16: Using PlaceholderAPI](developers/using-placeholderapi.md)
- [:octicons-chevron-right-16: Creating a PlaceholderExpansion](developers/creating-a-placeholderexpansion.md)
- [:octicons-chevron-right-16: eCloud](developers/expansion-cloud.md)
- ### :material-alert-circle-outline: Common Issues
----
Common problems you may face while using PlaceholderAPI, and how to solve them.
- [:octicons-chevron-right-16: Go to Page](common-issues.md)
- ### :material-chat-question: FAQ
----
Frequently Asked Questions and their answers.
- [:octicons-chevron-right-16: Go to Page](faq.md)
</div>

323
docs/users/commands.md Normal file
View File

@ -0,0 +1,323 @@
---
description: Available commands within PlaceholderAPI.
---
# Commands
This page shows all commands, including with a detailed description of what every command does.
## Overview
- **[Parse Commands](#parse-commands)**
- [`/papi bcparse <player|me> <string>`](#papi-bcparse)
- [`/papi cmdparse <player|me> <string>`](#papi-cmdparse)
- [`/papi parse <player|me> <string>`](#papi-parse)
- [`/papi parserel <player> <player> <string>`](#papi-parserel)
- **[eCloud Commands](#ecloud-commands)**
- [`/papi ecloud clear`](#papi-ecloud-clear)
- [`/papi ecloud disable`](#papi-ecloud-disable)
- [`/papi ecloud download <expansion> [version]`](#papi-ecloud-download)
- [`/papi ecloud enable`](#papi-ecloud-enable)
- [`/papi ecloud info <expansion> [version]`](#papi-ecloud-info)
- [`/papi ecloud list <all|<author>|installed>`](#papi-ecloud-list)
- [`/papi ecloud placeholders <expansion>`](#papi-ecloud-placeholders)
- [`/papi ecloud refresh`](#papi-ecloud-refresh)
- [`/papi ecloud status`](#papi-ecloud-status)
- **[Expansion Commands](#expansion-commands)**
- [`/papi info <expansion>`](#papi-info)
- [`/papi list`](#papi-list)
- [`/papi register <jar file>`](#papi-register)
- [`/papi unregister <jar file>`](#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`
/// info |
**Description**:
Parses placeholders of a String and broadcasts the result to all players.
**Arguments**:
- `<player|me>` - The Player to parse values of the placeholder (Use `me` for yourself).
- `<Text with placeholders>` - The text to parse.
**Example**:
```
/papi bcparse funnycube My name is %player_name%!
```
///
#### `/papi cmdparse`
/// info |
**Description**:
Parses placeholders of a String and executes it as a command.
**Arguments**:
- `<player|me>` - The player to parse placeholders against. Use `me` for yourself.
- `<Command with placeholders>` - 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`
/// info |
**Description**:
Parses the placeholders in a given text and shows the result.
**Arguments**:
- `<player|me>` - The Player to parse values of the placeholder (Use `me` for yourself).
- `<Text with placeholders>` - The text to parse.
**Example**:
```
/papi parse funnycube My group is %vault_group%
```
///
#### `/papi parserel`
/// info |
**Description**:
Parses a relational placeholder.
**Arguments**:
- `<player1>` - The first player.
- `<player2>` - the second player to compare with.
- `<Text with placeholders>` - 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](../developers/expansion-cloud.md).
#### `/papi ecloud clear`
/// info |
**Description**:
Clears the cache for the eCloud.
///
#### `/papi ecloud disable`
/// info |
**Description**:
Disables the connection to the eCloud.
///
#### `/papi ecloud download`
/// info |
**Description**:
Allows you to download an expansion from the eCloud
**Arguments**:
- `<expansion>` - 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`
/// info |
**Description**:
Enables the connection to the eCloud
///
#### `/papi ecloud info`
/// info |
**Description**:
Gives information about a specific Expansion.
**Arguments**:
- `<expansion>` - The Expansion to retrieve information from.
- `[version]` - The Expansion's version to get information from.
**Example**:
```
/papi ecloud info Vault
```
///
#### `/papi ecloud list`
/// info |
**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**:
- `<all|<author>|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`
/// info |
**Description**:
List all placeholders of an Expansion.
**Arguments**:
- `<expansion>` - The Expansion to list placeholders of.
**Example**:
```
/papi ecloud placeholders Vault
```
///
#### `/papi ecloud refresh`
/// info |
**Description**:
Refresh the cached data from the eCloud.
///
#### `/papi ecloud status`
/// info |
**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`
/// info |
**Description**:
Gives you information about the specified Expansion.
**Argument(s)**:
- `<expansion>` - The Expansion to get info from (Needs to be registered and active).
**Example**:
```
/papi info Vault
```
///
#### `/papi list`
/// info |
**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`
/// info |
**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**:
- `<filename>` - The file to register (including the file-extension).
**Example**:
```
/papi register MyExpansion.jar
```
///
#### `/papi unregister`
/// info |
**Description**:
Unregisters the specified expansion.
**Arguments**:
- `<filename>` - 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`
/// info |
**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`
/// info |
**Description**:
Displays all the commands PlaceholderAPI currently offers.
///
#### `/papi reload`
/// info |
**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`
/// info |
**Description**:
Shows the current version and authors of PlaceholderAPI.
///

45
docs/users/index.md Normal file
View File

@ -0,0 +1,45 @@
---
description: Pages aimed at server owners who want to utilize PlaceholderAPI.
---
# User Guides
The pages listed under this section are meant for server owners who want to use PlaceholderAPI.
----
<div class="grid cards hide-list" markdown>
- ### Commands
----
List of all available commands in PlaceholderAPI.
- [:octicons-chevron-right-16: Go to Page](commands.md)
- ### Using Placeholders
----
User Guide on how to use placeholders in a plugin.
- [:octicons-chevron-right-16: Go to Page](using-placeholders.md)
- ### Placeholder List
----
Community-curated list of available PlaceholderExpansions and their placeholders.
- [:octicons-chevron-right-16: Go to Page](placeholder-list.md)
- ### Plugins using PlaceholderAPI
----
List of Plugins that support PlaceholderAPI and/or provide their own placeholders to use.
- [:octicons-chevron-right-16: Go to Page](plugins-using-placeholderapi.md)
</div>

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -1,28 +1,45 @@
---
description: User Guide on how to use placeholders in a plugin.
---
# Using Placeholders
This page is intended for server owners or server staff who want to learn how to use placeholders in a plugin.
If you're a developer and would like to learn how to provide placeholders or support placeholders from other plugins in your own, check out [[Hook into PlaceholderAPI]].
If you're a developer and would like to learn how to provide placeholders or support placeholders from other plugins in your own, check out [Using PlaceholderAPI](../developers/using-placeholderapi.md).
## Prerequisites
Before you can use placeholders should you check a few things first.
### Plugin supports PlaceholderAPI
The first and most important thing is, to find out if the plugin you want to use placeholders in is actually supporting PlaceholderAPI.
Chat-plugins such as EssentialsXChat do not natively support PlaceholderAPI and instead require separate plugins to "inject" the parsed placeholders into the final chat message.
One way to check, if a Plugin is supporing PlaceholderAPI, is to check the [[Plugins using PlaceholderAPI]] page.
One way to check, if a Plugin is supporing PlaceholderAPI, is to check the [Plugins using PlaceholderAPI](plugins-using-placeholderapi.md) page.
If the plugin is listed and if the `Supports placeholders` text has a check, does it mean that PlaceholderAPI support is available.
If the plugin isn't listed, can you usually check its plugin page, or any other source of information, such as a wiki, for clues on if PlaceholderAPI is supported.
### Proper Internet connection
PlaceholderAPI connects towards an eCloud located under https://api.extendedclip.com to retrieve information about placeholder expansions, but also to download said expansions from it.
Make sure that your server is allowing external connections to the above URL. If it doesn't, and you're using a host, contact their support and ask them to whitelist this URL.
/// info | Info for hosts
PlaceholderAPI provides and checks for a specific Environment variable to block the download of specific expansions.
Should you as a host want to block the download of specific expansions, add the `PAPI_BLOCKED_EXPANSIONS` Environment variable containing a comma-separated list of expansion names that PlaceholderAPI should not be able to download.
This feature exists since version 2.11.4 of PlaceholderAPI
///
## Download/Get Expansion
The way PlaceholderAPI's system works, allows a Placeholder Expansion and its corresponding placeholders to either be included within a plugin (If placeholder requires said plugin) or to be available as a separate jar file on the eCloud of PlaceholderAPI.
Depending on what type you have, will you need to do some extra steps to use the placeholder from the Placeholder Expansion.
One way to find out, if an Expansion is included or separate, is to check the [[Placeholders]] page for any entry of it.
One way to find out, if an Expansion is included or separate, is to check the [Placeholder List](placeholder-list.md) page for any entry of it.
If it exists on the page, can you check, if the line right after the title says `NO DOWNLOAD COMMAND` or `/papi ecloud download ...` (i.e. `/papi ecloud download Player`).
If the line says the former, does it mean, the expansion is part of the plugin and doesn't need any extra steps to be active (Unless the plugin author mentions otherwise).
@ -31,5 +48,6 @@ In the case of the later, will you need to download the expansion from the eClou
You can check what expansions are loaded by running `/papi list`.
## Use Expansion
Using the placeholders of the Expansion is a straigh forward process.
Simply put the right placeholder format (i.e. `%player_name%`) inside whatever configuration option supports it. Please refer to any manuals or wikis a plugin may offer about what options support placeholders.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 96 KiB

132
mkdocs.yml Normal file
View File

@ -0,0 +1,132 @@
site_name: PlaceholderAPI Wiki
site_description: Wiki of the Spigot Plugin PlaceholderAPI.
site_author: PlaceholderAPI Team and Contributors
site_url: 'https://wiki.placeholderapi.com'
repo_name: PlaceholderAPI/PlaceholderAPI
repo_url: https://github.com/PlaceholderAPI/PlaceholderAPI
theme:
name: material
custom_dir: '.theme'
logo: assets/img/favicons/android-chrome-512x512.png
icon:
admonition:
note: octicons/pencil-16
abstract: octicons/checklist-16
info: octicons/info-16
tip: octicons/rocket-16
success: octicons/check-circle-16
question: octicons/question-16
warning: octicons/alert-16
failure: octicons/x-circle-16
danger: octicons/zap-16
bug: octicons/bug-16
example: octicons/beaker-16
quote: octicons/comment-16
palette:
- media: '(prefers-color-scheme: light)'
scheme: default
primary: blue grey
accent: cyan
toggle:
icon: octicons/sun-24
name: 'Switch to dark theme'
- media: '(prefers-color-scheme: dark)'
scheme: slate
primary: black
accent: cyan
toggle:
icon: octicons/moon-24
name: 'Switch to light theme'
features:
- navigation.indexes
- navigation.tabs
- navigation.tabs.sticky
- navigation.sections
- navigation.top
- content.tooltips
- content.code.copy
extra:
consent:
title: Cookie consent
description: >-
We use cookies to recognize your repeated visits and preferences, as well
as to measure the effectiveness of our wiki and whether users find what
they're searching for. With your consent, you're helping us to make our
wiki better.
actions:
- accept
- reject
- manage
social:
- icon: fontawesome/regular/paper-plane
link: https://hangar.papermc.io/HelpChat/PlaceholderAPI
- icon: simple/spigotmc
link: https://www.spigotmc.org/resources/6245/
- icon: simple/discord
link: https://discord.gg/helpchat
nav:
- index.md
- User Guides:
- users/index.md
- users/commands.md
- users/using-placeholders.md
- users/placeholder-list.md
- users/plugins-using-placeholderapi.md
- Dev Guides:
- developers/index.md
- developers/using-placeholderapi.md
- developers/creating-a-placeholderexpansion.md
- developers/expansion-cloud.md
- common-issues.md
- faq.md
- Discord: https://discord.gg/helpchat
extra_javascript:
- assets/js/latest-release.js
extra_css:
- assets/stylesheets/link-icons.css
- assets/stylesheets/styling.css
markdown_extensions:
- attr_list
- toc:
permalink: true
- meta
- md_in_html
- pymdownx.superfences
- pymdownx.magiclink:
repo_url_shortener: true
repo_url_shorthand: true
provider: github
user: PlaceholderAPI
repo: PlaceholderAPI
normalize_issue_symbols: true
- pymdownx.emoji:
emoji_index: !!python/name:material.extensions.emoji.twemoji
emoji_generator: !!python/name:material.extensions.emoji.to_svg
- pymdownx.highlight
- pymdownx.inlinehilite
- pymdownx.blocks.admonition:
types:
- note
- abstract
- info
- tip
- success
- question
- warning
- failure
- danger
- bug
- example
- quote
- pymdownx.blocks.details
- pymdownx.blocks.tab:
alternate_style: true
- pymdownx.tasklist

1
requirements.txt Normal file
View File

@ -0,0 +1 @@
mkdocs-material==9.5.5