> For the complete documentation index, see [llms.txt](https://edseries-plugins.gitbook.io/p/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://edseries-plugins.gitbook.io/p/edlang/features/packet-translator.md).

# Packet translator

The packet translator is what makes EdLang work with every plugin. It needs **PacketEvents**.

Every packet sent to a player is looked at on its way out. When it contains a placeholder, the placeholder is replaced in **that player's** language in the copy sent to that player. Nothing on the server changes: the item in a chest, the hologram entity, the scoreboard team all keep their placeholders, so the next player gets their own language.

A packet without a placeholder is let through **without being decoded**: its raw bytes are scanned for the two markers (`%lang_`, `{lang:`) eight bytes at a time, which takes well under a microsecond for a normal packet. Only packets that contain a marker are decoded, translated and re-encoded. See [Performance](/p/edlang/reference/performance.md).

## What it covers

Each can be switched off in `config.yml` under `packets:`.

| Option                 | Texts                                                                                                                    |
| ---------------------- | ------------------------------------------------------------------------------------------------------------------------ |
| `chat`                 | Plugin chat messages, also the ones most chat plugins send.                                                              |
| `player-chat`          | Signed player chat: the sender's name and the chat decoration.                                                           |
| `action-bar`           | Action bars.                                                                                                             |
| `titles`               | Titles and subtitles.                                                                                                    |
| `boss-bars`            | Boss bar titles.                                                                                                         |
| `scoreboards`          | Sidebar and below-name titles, score lines, team prefixes and suffixes (most scoreboard and nametag plugins).            |
| `tab-list`             | Tab list header, footer and player names.                                                                                |
| `inventories`          | Menu titles.                                                                                                             |
| `items`                | Item names, lore and written book pages: inventories, the cursor, villager trades, armour and held items seen by others. |
| `entities`             | Entity names and holograms (text displays, armour stands, NPC names), dropped items, item frames, item displays.         |
| `signs`                | Sign texts, also signs in chunks as they load.                                                                           |
| `advancements`         | Advancement and toast titles and descriptions.                                                                           |
| `death-messages`       | The death screen message.                                                                                                |
| `disconnect`           | Kick and disconnect screens.                                                                                             |
| `resource-pack-prompt` | The text of the server resource pack prompt.                                                                             |

Placeholders are found in plain text, in hover texts, and in the arguments of translatable texts (vanilla death and join messages that carry a name).

## Language changes

With `refresh-on-change: true` (default), a player who changes their language (with `/lang`, by changing their Minecraft language, or after `/edlang reload`) gets their holograms, entity names, items, boss bars, sidebar and tab texts sent again right away, in the new language. An open EdLang menu is redrawn in place.

## Creative mode

In creative mode the client sends items back to the server as it sees them, which would store translated texts in the real items. `packets.creative-mode`:

* `restore` (default): items shown to a creative player carry their original texts hidden inside the client's copy; when the client sends an item back, the originals are put back. The real items never change.
* `skip`: items are not translated for players in creative mode.

Switching into or out of creative mode re-sends the player's inventory, so it is always in the right state.

## Text matching (EdLang 1 servers)

`text-matching.enabled` turns on EdLang 1's way of working: item, entity and screen texts that are already translated (an item made for a Spanish player before you used placeholders) are recognised in any language and shown in the viewer's. It decodes every item, so it is heavier: leave it off on new servers. Servers upgraded from EdLang 1 keep it on.

## Limits

* The server list (MOTD) is not translated: there is no player, and no language, yet.
* Signs already loaded when a player changes language show the new language the next time their chunk loads.
* A menu of another plugin that is open while the player changes language shows the new title when it is opened again (its items update at once).
* Plugins that draw text into images (maps, resource-pack fonts made of pictures) can't be translated.
