CommandAPI 11.1.0
An API for the command UI introduced in Minecraft 1.13
dev.jorel.commandapi.CommandAPIBukkit< Source > Class Template Referenceabstract
+ Inheritance diagram for dev.jorel.commandapi.CommandAPIBukkit< Source >:

Public Member Functions

JavaPlugin getPlugin ()
 
NMS< Source > getNMS ()
 
CommandRegistrationStrategy< Source > getCommandRegistrationStrategy ()
 
void onLoad ()
 
void onDisable ()
 
abstract BukkitCommandSender<? extends CommandSender > wrapCommandSender (CommandSender sender)
 
void registerPermission (String string)
 
void preCommandRegistration (String commandName)
 
void postCommandRegistration (RegisteredCommand registeredCommand, LiteralCommandNode< Source > resultantNode, List< LiteralCommandNode< Source > > aliasNodes)
 
LiteralCommandNode< Source > registerCommandNode (LiteralArgumentBuilder< Source > node, String namespace)
 
void unregister (String commandName, boolean unregisterNamespaces)
 
BukkitCommandAPIMessenger setupMessenger ()
 
BukkitCommandAPIMessenger getMessenger ()
 
final CommandDispatcher< Source > getBrigadierDispatcher ()
 
CommandAPILogger getLogger ()
 
void updateRequirements (AbstractPlayer<?> player)
 
Argument< String > newConcreteMultiLiteralArgument (String nodeName, String[] literals)
 
Argument< String > newConcreteLiteralArgument (String nodeName, String literal)
 
CommandAPICommand newConcreteCommandAPICommand (CommandMetaData< CommandSender > meta)
 
void registerBukkitRecipesSafely (Iterator< Recipe > recipes)
 
BukkitCommandSender<? extends CommandSender > getSenderForCommand (CommandContext< Source > cmdCtx, boolean forceNative)
 
Source getBrigadierSourceFromCommandSender (AbstractCommandSender<? extends CommandSender > sender)
 
SuggestionProvider< Source > getSuggestionProvider (SuggestionProviders suggestionProvider)
 
BukkitCommandSender<? extends CommandSender > getCommandSenderFromCommandSource (Source css)
 
void createDispatcherFile (File file, CommandDispatcher< Source > dispatcher) throws IOException
 
void reloadDataPacks ()
 
CommandMap getCommandMap ()
 
Platform activePlatform ()
 
CommandRegistrationStrategy< Source > createCommandRegistrationStrategy ()
 
void onEnable ()
 Platform-specific stuff that should happen when the CommandAPI is enabled.
 

Static Public Member Functions

static< Source > CommandAPIBukkit< Source > get ()
 
static InternalBukkitConfig getConfiguration ()
 
static void unregister (String commandName, boolean unregisterNamespaces, boolean unregisterBukkit)
 Unregisters a command from the CommandGraph, so it can't be run anymore. More...
 
static< T > void initializeNBTAPI (Class< T > nbtContainerClass, Function< Object, T > nbtContainerConstructor)
 Initializes the CommandAPI's implementation of an NBT API. More...
 

Protected Member Functions

void stopCommandRegistrations ()
 
void checkDependencies ()
 

Protected Attributes

JavaPlugin plugin
 
NMS< Source > nms
 

Static Protected Attributes

static InternalBukkitConfig config
 

Member Function Documentation

◆ getMessenger()

◆ initializeNBTAPI()

static< T > void dev.jorel.commandapi.CommandAPIBukkit< Source >.initializeNBTAPI ( Class< T >  nbtContainerClass,
Function< Object, T >  nbtContainerConstructor 
)
static

Initializes the CommandAPI's implementation of an NBT API.

If you are shading the CommandAPI, you should be using CommandAPIBukkitConfig#initializeNBTAPI(Class, Function) in your onLoad method instead of calling this method.

Parameters
<T>the type that the NBT compound container class is
nbtContainerClassthe NBT compound container class. For example, NBTContainer.class
nbtContainerConstructora function that takes an Object (NMS NBTTagCompound) and returns an instance of the provided NBT compound container. For example, NBTContainer::new.

◆ onLoad()

◆ unregister()

static void dev.jorel.commandapi.CommandAPIBukkit< Source >.unregister ( String  commandName,
boolean  unregisterNamespaces,
boolean  unregisterBukkit 
)
static

Unregisters a command from the CommandGraph, so it can't be run anymore.

This Bukkit-specific unregister has an additional parameter, unregisterBukkit, compared to CommandAPI#unregister(String, boolean).

Parameters
commandNamethe name of the command to unregister
unregisterNamespaceswhether the unregistration system should attempt to remove versions of the command that start with a namespace. E.g. minecraft:command, bukkit:command, or plugin:command. If true, these namespaced versions of a command are also unregistered.
unregisterBukkitwhether the unregistration system should unregister Vanilla or Bukkit commands. If true, only Bukkit commands are unregistered, otherwise only Vanilla commands are unregistered. For the purposes of this parameter, commands registered using the CommandAPI are Vanilla commands, and commands registered by other plugin using Bukkit API are Bukkit commands.

◆ wrapCommandSender()

abstract BukkitCommandSender<? extends CommandSender > dev.jorel.commandapi.CommandAPIBukkit< Source >.wrapCommandSender ( CommandSender  sender)
abstract