The Adventure docs are currently a work in progress. Some areas may have limited coverage or may not be entirely up to date. Feel free to join our discord at https://discord.gg/MMfhJ8F if you have any questions.
Migrating from text 3.x¶
Adventure is an evolution of the text 3.x API. If you’ve worked with
the text API before, the switch to Adventure should be quick and relatively
painless. For the most part, you’ll just need to depend on the Adventure API
and the relevant Platforms you support and replace references
to classes in
next.kyori.adventure.text, though see
below for major breaking changes.
A word of caution¶
However, before you continue, it is strongly recommended you read about Audiences. Unlike text, Adventure defines a standard interface for sending content (including chat messages) to viewers. In addition, Adventure defines interfaces for other gameplay mechanics that can be arbitrarily sent to players.
Breaking changes from text 3.x¶
In text 3.x, you would deserialize a component that used a color code prefix that
differed from the section symbol normally used by using
In Adventure, the API to use is
TextColor renamed to
In order to accomodate the new RGB colors introduced in 1.16, all the named text colors
were moved to the
NamedTextColor class. References to the old
should be updated to refer to
If you have a need to interoperate with clients using the old text 3.x API, you
can use the
adventure-text-serializer-legacy-text3 artifact, which includes a
LegacyText3ComponentSerializer that can convert from Adventure to text 3.x
components and back. Note that RGB colors will be downsampled.