Skip to content

Hey there! If you like my work, you can support me by sponsoring me on GitHub. Thanks! ❤

Sponsor me
on GitHub

Usage of Adventure

CAUTION

Remember to replace SENDER with your sender type that corresponds to the platform you are using.
For example, if you are using Bukkit, you should replace SENDER with CommandSender or Player.

Argument

For example, you can use the Component object as an argument in your command:

java
@Execute(name = "tell")
void tell(@Context SENDER sender, @Arg SENDER target, @Join Component message) {
    target.sendMessage(message);
}

Response

You can also use the Component object as a response:

java
@Execute(name = "info")
Component info() {
    return Component.text("This is an example of the Component response.");
}

Colorizer

Colorizer is a feature that allows you to colorize the Component object in the @Arg argument.

If you want to use the default colorizer, you need to enable it in the LiteCommands builder:

java
.extension(new LiteAdventureExtension<SENDER>()
    .colorizeArgument(true)
)
java
.extension(new LiteAdventurePlatformExtension<SENDER>(this.audienceProvider)
    .colorizeArgument(true)
)

You can force enable the colorizer for the specific argument:

java
@Execute(name = "colorize")
void colorize(@Arg @Key("color") Component colorized) {
    // ...
}

And you can also force disable the colorizer:

java
@Execute(name = "raw")
void raw(@Arg @Key("raw") Component notColorized) {
    // ...
}

Serializer (Colorizer)

Serializer is used to colorize the Component object in the @Arg argument and the response.

You can modify the default serializer by using the miniMessage() and legacyColor() methods in the LiteCommands builder:

java
.extension(new LiteAdventureExtension<SENDER>()
    .miniMessage(true)
    .legacyColor(true)
)
java
.extension(new LiteAdventurePlatformExtension<SENDER>(this.audienceProvider)
    .miniMessage(true)
    .legacyColor(true)
)

The miniMessage() method enables the MiniMessage support. Read more about it here. The legacyColor() method enables the legacy color support. &c, &a, etc.

If you want to use the custom serializer, you need to set it in the LiteCommands builder:

java
.extension(new LiteAdventureExtension<SENDER>()
    .serializer(this.miniMessage)
)
java
.extension(new LiteAdventurePlatformExtension<SENDER>(this.audienceProvider)
    .serializer(this.miniMessage)
)

Made by LiteDevelopers and Contributors with ❤️

Layout Switch

Adjust the layout style of VitePress to adapt to different reading needs and screens.

Expand all
The sidebar and content area occupy the entire width of the screen.
Expand sidebar with adjustable values
Expand sidebar width and add a new slider for user to choose and customize their desired width of the maximum width of sidebar can go, but the content area width will remain the same.
Expand all with adjustable values
Expand sidebar width and add a new slider for user to choose and customize their desired width of the maximum width of sidebar can go, but the content area width will remain the same.
Original width
The original layout width of VitePress

Page Layout Max Width

Adjust the exact value of the page width of VitePress layout to adapt to different reading needs and screens.

Adjust the maximum width of the page layout
A ranged slider for user to choose and customize their desired width of the maximum width of the page layout can go.

Content Layout Max Width

Adjust the exact value of the document content width of VitePress layout to adapt to different reading needs and screens.

Adjust the maximum width of the content layout
A ranged slider for user to choose and customize their desired width of the maximum width of the content layout can go.

Spotlight

Highlight the line where the mouse is currently hovering in the content to optimize for users who may have reading and focusing difficulties.

ONOn
Turn on Spotlight.
OFFOff
Turn off Spotlight.