# PlaceholderAPI (PAPI) Integration

<span style="white-space: pre-wrap;">GWorld v2 offers </span>**native support**<span style="white-space: pre-wrap;"> for </span>[PlaceholderAPI](https://github.com/PlaceholderAPI/PlaceholderAPI). This means you do not need to download an additional expansion via the PAPI-eCloud. Once PlaceholderAPI is installed on your server, GWorld registers its placeholders automatically.

## Available Placeholders

<span style="white-space: pre-wrap;">All GWorld placeholders use the prefix </span>`<span class="editor-theme-code">%gworld_</span>`.

<table id="bkmrk-placeholderdescripti"><colgroup><col></col><col></col><col></col></colgroup><tbody><tr><th>Placeholder

</th><th>Description

</th><th>Example Output

</th></tr><tr><td>`<span class="editor-theme-code">%gworld_alias%</span>`

</td><td>The formatted display name (alias) of the world the player is currently in.

</td><td>`<span class="editor-theme-code">§6Survival</span>`

</td></tr><tr><td>`<span class="editor-theme-code">%gworld_alias_<worldname>%</span>`

</td><td>The formatted display name of a specifically named world.

</td><td>`<span class="editor-theme-code">%gworld_alias_world_the_end%</span>`

<span style="white-space: pre-wrap;"> ➔ </span>

`<span class="editor-theme-code">§5The End</span>`

</td></tr><tr><td>`<span class="editor-theme-code">%gworld_name%</span>`

</td><td>The technical folder name of the world the player is currently in.

</td><td>`<span class="editor-theme-code">world_survival_v2</span>`

</td></tr><tr><td>`<span class="editor-theme-code">%gworld_name_<worldname>%</span>`

</td><td>Returns the technical name of the requested world. Useful for scripts or validations.

</td><td>`<span class="editor-theme-code">%gworld_name_lobby%</span>`

<span style="white-space: pre-wrap;"> ➔ </span>

`<span class="editor-theme-code">lobby</span>`

</td></tr></tbody></table>

<p class="callout info">**Fallback Info:**<span style="white-space: pre-wrap;"> If a world has no alias set, the technical world name is returned automatically. If the player is offline or the placeholder is called incorrectly, an empty string (</span>`<span class="editor-theme-code">""</span>`) is output so it doesn't break the layout of your tab list or scoreboard.</p>

<p class="callout warning">**Warning:**<span style="white-space: pre-wrap;"> If the world is not managed by GWorld, an empty string (</span>`<span class="editor-theme-code">""</span>`) is also output!</p>

---

## Examples

Here are some examples of how you can use the placeholders in other plugins:

### 1. In the Tab List / Scoreboard

<span style="white-space: pre-wrap;">You want to show your players where they currently are. Use the alias placeholder for this, as it supports color codes (e.g. </span>`<span class="editor-theme-code">&a</span>`<span style="white-space: pre-wrap;">): </span>

`<span class="editor-theme-code">Current world: %gworld_alias%</span>`

### 2. In Chat Formats

<span style="white-space: pre-wrap;">Insert the placeholder into your chat format to display the world as a prefix before the player's name: </span>

`<span class="editor-theme-code">chat-format: "[%gworld_alias%] %player_name%: %message%"</span>`

### 3. In GUI Menus

<span style="white-space: pre-wrap;">If you are building a worlds menu, you can use the nice </span>**alias**<span style="white-space: pre-wrap;"> for the item icon, but you must use the </span>**technical name**<span style="white-space: pre-wrap;"> for the teleport command in the background:</span>

```yaml
items:
  survival_world:
    material: GRASS_BLOCK
    display_name: 'Teleport to: %gworld_alias_farmworld%'
    left_click_commands:
      - '[player] gtp %gworld_name_farmworld%'
```