CommandAPI 9.6.0
An API for the command UI introduced in Minecraft 1.13
dev.jorel.commandapi.CommandAPIBukkitConfig Class Reference

A class that contains information needed to configure the CommandAPI on Bukkit-based servers. More...

+ Inheritance diagram for dev.jorel.commandapi.CommandAPIBukkitConfig:

Public Member Functions

 CommandAPIBukkitConfig (JavaPlugin plugin)
 Creates a new CommandAPIBukkitConfig object. More...
 
CommandAPIBukkitConfig shouldHookPaperReload (boolean hooked)
 Sets the CommandAPI to hook into Paper's ServerResourcesReloadedEvent when available if true. More...
 
CommandAPIBukkitConfig skipReloadDatapacks (boolean skip)
 Sets whether the CommandAPI should skip its datapack reload step after the server has finished loading. More...
 
CommandAPIBukkitConfig useMojangMappings (boolean useMojangMappings)
 Sets whether the CommandAPI should use Mojang mappings as opposed to Spigot's mappings for internal calls. More...
 
CommandAPIBukkitConfig usePluginNamespace ()
 
CommandAPIBukkitConfig setNamespace (String namespace)
 
CommandAPIBukkitConfig instance ()
 
Impl verboseOutput (boolean value)
 Sets verbose output logging for the CommandAPI if true. More...
 
Impl silentLogs (boolean value)
 Silences all logs (including warnings, but not errors) for the CommandAPI if true. More...
 
Impl useLatestNMSVersion (boolean value)
 Sets whether the CommandAPI should run the latest available version of NMS support, regardless of Minecraft version. More...
 
Impl beLenientForMinorVersions (boolean value)
 Sets whether the CommandAPI should load a (potentially unsupported) NMS version when updating to a minor release of Minecraft. More...
 
Impl missingExecutorImplementationMessage (String value)
 Sets the message to display to users when a command has no executor. More...
 
Impl dispatcherFile (File file)
 Specifies the location for the CommandAPI to store the internal representation of Brigadier's command tree. More...
 
Impl addSkipSenderProxy (String... names)
 
Impl addSkipSenderProxy (List< String > names)
 

Detailed Description

A class that contains information needed to configure the CommandAPI on Bukkit-based servers.

Constructor & Destructor Documentation

◆ CommandAPIBukkitConfig()

dev.jorel.commandapi.CommandAPIBukkitConfig.CommandAPIBukkitConfig ( JavaPlugin  plugin)

Creates a new CommandAPIBukkitConfig object.

Variables in this constructor are required to load the CommandAPI on Bukkit properly.

Parameters
pluginThe JavaPlugin that is loading the CommandAPI This is used when registering events.

Member Function Documentation

◆ beLenientForMinorVersions()

Impl dev.jorel.commandapi.CommandAPIConfig< Impl >.beLenientForMinorVersions ( boolean  value)
inherited

Sets whether the CommandAPI should load a (potentially unsupported) NMS version when updating to a minor release of Minecraft.

As an example, this setting can allow updating to 1.21.2 from 1.21.1 but doesn't allow updating to 1.22 from 1.21.2. Unlike useLatestNMSVersion(boolean), this setting does not blindly load the latest NMS version, but will prefer loading the correct NMS implementation when available.

Parameters
valuewhether the CommandAPI should assume that minor Minecraft releases do not cause incompatibilities
Returns
this CommandAPIConfig

◆ dispatcherFile()

Impl dev.jorel.commandapi.CommandAPIConfig< Impl >.dispatcherFile ( File  file)
inherited

Specifies the location for the CommandAPI to store the internal representation of Brigadier's command tree.

Parameters
filea file pointing to where to store Brigadier's JSON command dispatcher, for example new File(getDataFolder(), "command_registration.json"). If this argument is null, this file will not be created.
Returns
this CommandAPIConfig

◆ missingExecutorImplementationMessage()

Impl dev.jorel.commandapi.CommandAPIConfig< Impl >.missingExecutorImplementationMessage ( String  value)
inherited

Sets the message to display to users when a command has no executor.

Available formatting parameters are:

  • s - the executor class (lowercase)
  • S - the executor class (normal case)
Parameters
valuethe message to display when a command has no executor
Returns
this CommandAPIConfig

◆ shouldHookPaperReload()

CommandAPIBukkitConfig dev.jorel.commandapi.CommandAPIBukkitConfig.shouldHookPaperReload ( boolean  hooked)

Sets the CommandAPI to hook into Paper's ServerResourcesReloadedEvent when available if true.

This helps CommandAPI commands to work in datapacks after /minecraft:reload is run.

Parameters
hookedwhether the CommandAPI should hook into Paper's ServerResourcesReloadedEvent
Returns
this CommandAPIBukkitConfig

◆ silentLogs()

Impl dev.jorel.commandapi.CommandAPIConfig< Impl >.silentLogs ( boolean  value)
inherited

Silences all logs (including warnings, but not errors) for the CommandAPI if true.

Parameters
valuewhether logging suppression should be enabled
Returns
this CommandAPIConfig

◆ skipReloadDatapacks()

CommandAPIBukkitConfig dev.jorel.commandapi.CommandAPIBukkitConfig.skipReloadDatapacks ( boolean  skip)

Sets whether the CommandAPI should skip its datapack reload step after the server has finished loading.

This does not skip reloading of datapacks when invoked manually when shouldHookPaperReload(boolean) is set.

Parameters
skipwhether the CommandAPI should skip reloading datapacks when the server has finished loading
Returns
this CommandAPIBukkitConfig

◆ useLatestNMSVersion()

Impl dev.jorel.commandapi.CommandAPIConfig< Impl >.useLatestNMSVersion ( boolean  value)
inherited

Sets whether the CommandAPI should run the latest available version of NMS support, regardless of Minecraft version.

This may produce unexpected results if the latest NMS version is not supported by the CommandAPI. This can be used to potentially provide compatibility with future Minecraft versions before the CommandAPI pushes a release to support it.

Parameters
valuewhether the latest version of NMS should be used
Returns
this CommandAPIConfig

◆ useMojangMappings()

CommandAPIBukkitConfig dev.jorel.commandapi.CommandAPIBukkitConfig.useMojangMappings ( boolean  useMojangMappings)

Sets whether the CommandAPI should use Mojang mappings as opposed to Spigot's mappings for internal calls.

If set to true, the CommandAPI will use Mojang mappings.

Parameters
useMojangMappingswhether the CommandAPI should use Mojang mappings for internal calls
Returns
this CommandAPIBukkitConfig
Deprecated:
Use the commandapi-bukkit-shade-mojang-mapped depdendency instead of commandapi-bukkit-shade if you want to use mojang mappings.

◆ usePluginNamespace()

CommandAPIBukkitConfig dev.jorel.commandapi.CommandAPIBukkitConfig.usePluginNamespace ( )

◆ verboseOutput()

Impl dev.jorel.commandapi.CommandAPIConfig< Impl >.verboseOutput ( boolean  value)
inherited

Sets verbose output logging for the CommandAPI if true.

Parameters
valuewhether verbose output should be enabled
Returns
this CommandAPIConfig