Skip to content

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

Sponsor me
on GitHub

Supported Types

List all supported @Context types for platforms:

Platform/ExtensionTypes
BukkitCommandSender, Player, World, Location
VelocityCommandSource, Player, ServerConnection, RegisteredServer, ServerInfo
BungeeCordCommandSender, ProxiedPlayer,
MinestomCommandSender, Player, Instance
AdventureAudience
SpongeCommandCause, ServerPlayer
Fabric (client)FabricClientCommandSource, ClientPlayerEntity,
Fabric (server)ServerCommandSource, ServerPlayerEntity,
JDAUser, Guild, Member, MessageChannelUnion, MessageChannel, Channel, SlashCommandInteractionEvent

TIP

These types are supported by default and represent context information for the command execution. Also, you can create a custom context provider for your types! Check out the Custom Context.

How to use

java
@Command(name = "balance")
public class BalanceCommand {
    @Execute(name = "world")
    void balance(@Context Player sender, @Context World world) {
        // ...
    }
    
    @Execute
    void balance(@Sender Player sender) { // You can also use @Sender alias
        // ...
    }
}

Made by LiteDevelopers and Contributors with ❤️