crwdns130767:0crwdne130767:0

crwdns130769:0:javadoc:crwdne130769:0

  • crwdns130771:0crwdne130771:0

    • crwdns130773:0crwdne130773:0

    • crwdns130775:0crwdne130775:0

crwdns130777:0crwdne130777:0

import org.spongepowered.api.text.Text;
import org.spongepowered.api.command.spec.CommandSpec;

// /mail read
CommandSpec readCmd = CommandSpec.builder()
    .permission("myplugin.mail.read")
    .description(Text.of("Read your inbox"))
    .executor(...)
    .build();

// /mail send
CommandSpec sendCmd = CommandSpec.builder()
    .permission("myplugin.mail.send")
    .description(Text.of("Send a mail"))
    .arguments(...)
    .executor(...)
    .build();

crwdns130779:0:javadoc:crwdne130779:0

import org.spongepowered.api.Sponge;

CommandSpec mailCommandSpec = CommandSpec.builder()
    .permission("myplugin.mail")
    .description(Text.of("Send and receive mails"))
    .child(readCmd, "read", "r", "inbox")
    .child(sendCmd, "send", "s", "write")
    .build();

Sponge.getCommandManager().register(plugin, mailCommandSpec, "mail", "email");

Note

crwdns130781:0:javadoc:crwdne130781:0