### Full Command Definition Example Source: https://jd.papermc.io/paper/1.21.11/org/bukkit/plugin/PluginDescriptionFile.html This example demonstrates a complete command definition including description, aliases, permission, permission message, and usage. ```yaml commands: flagrate: description: Set yourself on fire. aliases: [combust_me, combustMe] permission: inferno.flagrate permission-message: You do not have / usage: Syntax error! Perhaps you meant / PlayerName? burningdeaths: description: List how many times you have died by fire. aliases: - burning_deaths - burningDeaths permission: inferno.burningdeaths usage: | / [player] Example: / - see how many times you have burned to death Example: / CaptainIce - see how many times CaptainIce has burned to death # The next command has no description, aliases, etc. defined, but is still valid # Having an empty declaration is useful for defining the description, permission, and messages from a configuration dynamically apocalypse: ``` -------------------------------- ### Plugin.yml Example Source: https://jd.papermc.io/paper/1.21.11/org/bukkit/plugin/PluginDescriptionFile.html This is a basic example of a plugin.yml file. It includes essential fields like name, version, description, and provides. Ensure all required fields are present for your plugin to load correctly. ```yaml name: Inferno provides: [Hell] version: 1.4.1 description: This plugin is so 31337. You can set yourself on fire. # We could place every author in the authors list, but chose not to for illustrative purposes # Also, having an author distinguishes that person as the project lead, and ensures their ``` -------------------------------- ### options Source: https://jd.papermc.io/paper/1.21.11/index-all.html Gets the ConfigurationOptions for this Configuration. ```APIDOC ## options ### Description Gets the `ConfigurationOptions` for this `Configuration`. ### Method `options()` ### Parameters None ### Request Example None ### Response #### Success Response (200) - **ConfigurationOptions** (ConfigurationOptions) - The configuration options. #### Response Example ```json { "options": "" } ``` ``` -------------------------------- ### getUsage() Source: https://jd.papermc.io/paper/1.21.11/index-all.html Gets an example usage of this command. ```APIDOC ## getUsage() ### Description Gets an example usage of this command. ### Method (Not specified, likely a getter method) ### Endpoint (Not applicable for SDK methods) ### Parameters None ### Request Example (Not applicable for SDK methods) ### Response - **String**: An example usage string for the command. ``` -------------------------------- ### Initialize PluginDescriptionFile with Details Source: https://jd.papermc.io/paper/1.21.11/org/bukkit/plugin/PluginDescriptionFile.html Creates a new instance using explicit plugin name, version, and main class path. ```java public PluginDescriptionFile(@NotNull @NotNull String pluginName, @NotNull @NotNull String pluginVersion, @NotNull @NotNull String mainClass) ``` -------------------------------- ### getStartLevel Source: https://jd.papermc.io/paper/1.21.11/index-all.html Gets the starting level for an enchantment. ```APIDOC ## getStartLevel() ### Description Gets the level that this Enchantment should start at. ### Method N/A (Method in class) ### Endpoint N/A ### Parameters None ### Request Example None ### Response #### Success Response (N/A) - **Integer** (int) - The starting level. ### Response Example None ``` -------------------------------- ### IndexHelpTopic.buildPreamble(CommandSender) Source: https://jd.papermc.io/paper/1.21.11/index-all.html Builds the topic preamble. ```APIDOC ## buildPreamble(CommandSender) ### Description Builds the topic preamble. ### Method `buildPreamble(CommandSender)` ### Class `org.bukkit.help.IndexHelpTopic` ``` -------------------------------- ### getLimitedLifetimeTicks() Source: https://jd.papermc.io/paper/1.21.11/index-all.html Gets the number of ticks remaining until the vex will start to take damage. ```APIDOC ## getLimitedLifetimeTicks() ### Description Gets the number of ticks remaining until the vex will start to take damage. ### Method ```java Vex.getLimitedLifetimeTicks() ``` ``` -------------------------------- ### GET getWorld Source: https://jd.papermc.io/paper/1.21.11/org/bukkit/util/BlockTransformer.TransformationState.html Retrieves the block state that existed at the location before the transformation started. ```APIDOC ## GET getWorld ### Description Creates a clone of the block state that was at the location of the currently modified block at the start of the transformation process and caches it for the current transformer. ### Method GET ### Response - **BlockState** (object) - A clone of the world block state. ``` -------------------------------- ### PluginDescriptionFile.getLoad() / getLoadOrder() Source: https://jd.papermc.io/paper/1.21.11/org/bukkit/plugin/class-use/PluginLoadOrder.html Retrieves the phase of server startup that the plugin should be loaded. ```APIDOC ## GET org.bukkit.plugin.PluginDescriptionFile.getLoad() ### Description Gives the phase of server startup that the plugin should be loaded. ### Response - **@NotNull PluginLoadOrder** (Enum) - The load order phase. ``` -------------------------------- ### getTreasureLocation() - Dolphin Source: https://jd.papermc.io/paper/1.21.11/index-all.html Gets the treasure location this dolphin tries to guide players to. ```APIDOC ## getTreasureLocation() ### Description Gets the treasure location this dolphin tries to guide players to. ### Method `getTreasureLocation()` ### Interface `org.bukkit.entity.Dolphin` ``` -------------------------------- ### Initialize FixedSetPrompt Source: https://jd.papermc.io/paper/1.21.11/org/bukkit/conversations/FixedSetPrompt.html Example of creating a new FixedSetPrompt instance with a defined set of valid input strings. ```java foo = new FixedSetPrompt("bar", "cheese", "panda"); ``` -------------------------------- ### getVoidDamageMinBuildHeightOffset Source: https://jd.papermc.io/paper/1.21.11/index-all.html Gets the offset applied to `WorldInfo.getMinHeight()` to determine the height at which void damage starts to apply. ```APIDOC ## getVoidDamageMinBuildHeightOffset() ### Description Gets the offset applied to `WorldInfo.getMinHeight()` to determine the height at which void damage starts to apply. ### Method Method ### Endpoint org.bukkit.World ``` -------------------------------- ### getDeathAnimationTicks Source: https://jd.papermc.io/paper/1.21.11/index-all.html Get the current time in ticks relative to the start of this dragon's death animation. ```APIDOC ## getDeathAnimationTicks() ### Description Get the current time in ticks relative to the start of this dragon's death animation. ### Method Method in interface org.bukkit.entity.EnderDragon ### Endpoint Get the current time in ticks relative to the start of this dragon's death animation. ``` -------------------------------- ### BookMeta.Spigot Constructor Source: https://jd.papermc.io/paper/1.21.11/org/bukkit/inventory/meta/BookMeta.Spigot.html Initializes a new instance of the BookMeta.Spigot class. ```APIDOC ## BookMeta.Spigot Constructor ### Description Initializes a new instance of the BookMeta.Spigot class. ### Method `public Spigot()` ### Endpoint N/A (Constructor) ``` -------------------------------- ### JavaPlugin.init() (overload 2) Source: https://jd.papermc.io/paper/1.21.11/org/bukkit/class-use/Server.html Initializes the JavaPlugin with various parameters including the Server instance. ```APIDOC ## POST JavaPlugin.init(Server server, PluginDescriptionFile description, File dataFolder, File file, ClassLoader classLoader, PluginMeta configuration, Logger logger) ### Description Initializes the `JavaPlugin` with the provided `Server` instance, `PluginDescriptionFile`, `File` objects, `ClassLoader`, `PluginMeta`, and `Logger`. ### Method POST ### Endpoint javaPlugin.init(Server server, PluginDescriptionFile description, File dataFolder, File file, ClassLoader classLoader, PluginMeta configuration, Logger logger) ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body - **server** (Server) - Required - The Server instance. - **description** (PluginDescriptionFile) - Required - The plugin description file. - **dataFolder** (File) - Required - The data folder for the plugin. - **file** (File) - Required - The plugin file. - **classLoader** (ClassLoader) - Required - The class loader for the plugin. - **configuration** (PluginMeta) - Optional - The plugin configuration metadata. - **logger** (Logger) - Required - The logger for the plugin. ### Request Example ```java // Assuming all parameters are properly initialized instances javaPlugin.init(server, descriptionFile, dataFolder, pluginFile, classLoader, pluginMeta, logger); ``` ### Response #### Success Response (200) Void #### Response Example None ``` -------------------------------- ### Inventory Iterator API Source: https://jd.papermc.io/paper/1.21.11/org/bukkit/inventory/Inventory.html APIs to get an iterator for the inventory items, starting from the beginning or a specified index. ```APIDOC ## GET /api/inventory/iterator ### Description Returns an iterator for the inventory items. ### Method GET ### Endpoint /api/inventory/iterator ### Response #### Success Response (200) - **iterator** (ListIterator) - An iterator for the ItemStacks in the inventory. #### Response Example { "iterator": [ { "material": "STONE", "amount": 64 }, { "material": "DIRT", "amount": 32 } ] } ## GET /api/inventory/iterator/startIndex ### Description Returns an iterator starting at the given index. If the index is positive, then the first call to next() will return the item at that index; if it is negative, the first call to previous will return the item at index (getSize() + index). ### Method GET ### Endpoint /api/inventory/iterator/startIndex ### Parameters #### Query Parameters - **index** (int) - Required - The index to start the iterator from. ### Response #### Success Response (200) - **iterator** (ListIterator) - An iterator starting at the specified index. #### Response Example { "iterator": [ { "material": "WOOD", "amount": 16 }, { "material": "COBBLESTONE", "amount": 64 } ] } ``` -------------------------------- ### RegionizedServerInitEvent Source: https://jd.papermc.io/paper/1.21.11/io/papermc/paper/threadedregions/package-summary.html The RegionizedServerInitEvent is an event that is called after the server has been initialized but before it starts ticking regions in parallel. This event is useful for performing setup tasks that need to occur after the server is ready but before the main ticking loop begins. ```APIDOC ## RegionizedServerInitEvent ### Description This event is called after the server is initialised but **before** the server begins ticking regions in parallel. ### Event Details This event signifies a point in the server lifecycle where all core server components are set up, and the server is ready to start its region-based ticking mechanism. It provides a hook for plugins or other systems to perform actions during this critical phase. ### Related Packages - `io.papermc.paper` - `io.papermc.paper.threadedregions.scheduler` ### Usage Example (Conceptual) ```java @EventHandler public void onRegionizedServerInit(RegionizedServerInitEvent event) { // Perform actions after server initialization and before region ticking System.out.println("Server initialized, preparing for region ticking..."); // Example: Register custom region logic or modify initial server state } ``` ``` -------------------------------- ### SkinPatchBuilder Initialization Source: https://jd.papermc.io/paper/1.21.11/io/papermc/paper/datacomponent/item/class-use/ResolvableProfile.SkinPatchBuilder.html Demonstrates how to create a new instance of the SkinPatchBuilder. ```APIDOC ## POST /api/skinpatch/create ### Description Creates a new builder instance for a skin patch. ### Method POST ### Endpoint /api/skinpatch/create ### Response #### Success Response (200) - **builder_id** (string) - The unique identifier for the newly created skin patch builder. #### Response Example ```json { "builder_id": "new_patch_builder_123" } ``` ``` -------------------------------- ### YamlConfigurationOptions.width() Source: https://jd.papermc.io/paper/1.21.11/index-all.html Gets how long a line can be, before it gets split. ```APIDOC ## width() ### Description Gets how long a line can be, before it gets split. ### Method `width()` ### Class `org.bukkit.configuration.file.YamlConfigurationOptions` ``` -------------------------------- ### Command Classes Overview Source: https://jd.papermc.io/paper/1.21.11/org/bukkit/command/package-use.html Overview of key classes for command handling in Bukkit. ```APIDOC ## Bukkit Command API Classes This section provides documentation for the primary classes used for command handling within the Bukkit API, specifically those relevant to plugin development. ### Command **Description**: Represents a Command, which executes various tasks upon user input. ### CommandExecutor **Description**: Represents a class which contains a single method for executing commands. ### CommandSender **Description**: Represents the entity that executed a command. ### PluginCommand **Description**: Represents a `Command` belonging to a plugin. ### TabCompleter **Description**: Represents a class which can suggest tab completions for commands. ### TabExecutor **Description**: This class is provided as a convenience to implement both `TabCompleter` and `CommandExecutor`. ``` -------------------------------- ### GET /armorstand/disabled-slots Source: https://jd.papermc.io/paper/1.21.11/org/bukkit/entity/ArmorStand.html Gets the list of disabled slots. ```APIDOC ## GET /armorstand/disabled-slots ### Description Get the list of disabled slots. ### Method GET ### Response #### Success Response (200) - **disabledSlots** (Set) - List of disabled slots ``` -------------------------------- ### JavaPlugin.init() (overload 1) Source: https://jd.papermc.io/paper/1.21.11/org/bukkit/class-use/Server.html Initializes the JavaPlugin with various parameters including the Server instance. ```APIDOC ## POST JavaPlugin.init(PluginLoader loader, Server server, PluginDescriptionFile description, File dataFolder, File file, ClassLoader classLoader) ### Description Initializes the `JavaPlugin` with the provided `PluginLoader`, `Server` instance, `PluginDescriptionFile`, `File` objects, and `ClassLoader`. ### Method POST ### Endpoint javaPlugin.init(PluginLoader loader, Server server, PluginDescriptionFile description, File dataFolder, File file, ClassLoader classLoader) ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body - **loader** (PluginLoader) - Required - The plugin loader. - **server** (Server) - Required - The Server instance. - **description** (PluginDescriptionFile) - Required - The plugin description file. - **dataFolder** (File) - Required - The data folder for the plugin. - **file** (File) - Required - The plugin file. - **classLoader** (ClassLoader) - Required - The class loader for the plugin. ### Request Example ```java // Assuming all parameters are properly initialized instances javaPlugin.init(pluginLoader, server, descriptionFile, dataFolder, pluginFile, classLoader); ``` ### Response #### Success Response (200) Void #### Response Example None ``` -------------------------------- ### PluginMeta.getLoadOrder() Source: https://jd.papermc.io/paper/1.21.11/org/bukkit/plugin/class-use/PluginLoadOrder.html Retrieves the phase of the server startup logic that the plugin should be loaded. ```APIDOC ## GET io.papermc.paper.plugin.configuration.PluginMeta.getLoadOrder() ### Description Returns the phase of the server startup logic that the plugin should be loaded. ### Response - **PluginLoadOrder** (Enum) - The load order phase. ``` -------------------------------- ### GET /armorstand/equipment Source: https://jd.papermc.io/paper/1.21.11/org/bukkit/entity/ArmorStand.html Gets the inventory of the armor stand. ```APIDOC ## GET /armorstand/equipment ### Description Gets the inventory with the equipment worn by the living entity. ### Method GET ### Response #### Success Response (200) - **equipment** (EntityEquipment) - The living entity's inventory ``` -------------------------------- ### getBlockState() - FallingBlock Source: https://jd.papermc.io/paper/1.21.11/index-all.html Get the data of the falling block represented as a `BlockState`, which includes potential NBT data that gets applied when the block gets placed on landing. ```APIDOC ## getBlockState() ### Description Get the data of the falling block represented as a `BlockState` which includes potential NBT data that gets applied when the block gets placed on landing. ### Method Method in interface org.bukkit.entity.FallingBlock ``` -------------------------------- ### Retrieve Load Order Source: https://jd.papermc.io/paper/1.21.11/org/bukkit/plugin/PluginDescriptionFile.html Returns the server startup phase during which the plugin should be loaded. ```java @NotNull public @NotNull PluginLoadOrder getLoadOrder() ``` -------------------------------- ### GET /armorstand/item Source: https://jd.papermc.io/paper/1.21.11/org/bukkit/entity/ArmorStand.html Gets the item in a specific equipment slot. ```APIDOC ## GET /armorstand/item ### Description Returns the item the armor stand has equipped in the given equipment slot. ### Method GET ### Parameters #### Query Parameters - **slot** (EquipmentSlot) - Required - The equipment slot to get ### Response #### Success Response (200) - **item** (ItemStack) - The ItemStack in the equipment slot ``` -------------------------------- ### HelpTopic Methods Source: https://jd.papermc.io/paper/1.21.11/org/bukkit/command/class-use/CommandSender.html Methods within org.bukkit.help that utilize CommandSender. ```APIDOC ## HelpTopic Methods ### Description Methods in org.bukkit.help that take a CommandSender as a parameter. ### Method `protected @NotNull String buildIndexLine(@NotNull CommandSender sender, @NotNull HelpTopic topic)` Builds individual lines in the index topic. `protected @NotNull String buildPreamble(@NotNull CommandSender sender)` Builds the topic preamble. `boolean canSee(@NotNull CommandSender sender)` Checks if a sender can see a help topic. `boolean canSee(@NotNull CommandSender player)` Determines if a `Player` is allowed to see this help topic. `@NotNull String getFullText(@NotNull CommandSender forWho)` Returns the full description of this help topic that is displayed when the user requests this topic's details. `@NotNull String getFullText(@NotNull CommandSender sender)` Returns the full description of this help topic. ``` -------------------------------- ### HelpTopic Factory and Map Methods Source: https://jd.papermc.io/paper/1.21.11/org/bukkit/help/class-use/HelpTopic.html Methods for creating and retrieving HelpTopic instances. ```APIDOC ## HelpTopic Management ### Methods for Creating Topics #### `HelpTopicFactory.createTopic(TCommand command)` - **Description**: Accepts a command and constructs a custom `HelpTopic` for it. - **Returns**: A `@Nullable HelpTopic`. ### Methods for Retrieving Topics #### `HelpMap.getHelpTopic(String topicName)` - **Description**: Returns a help topic for a given topic name. - **Parameters**: - **topicName** (String) - Required - The name of the topic to retrieve. - **Returns**: A `@Nullable HelpTopic`. #### `HelpMap.getHelpTopics()` - **Description**: Returns a collection of all registered help topics. - **Returns**: A `@NotNull Collection`. ``` -------------------------------- ### GET /getSendViewDistance Source: https://jd.papermc.io/paper/1.21.11/org/bukkit/World.html Gets the sending view distance for the world. ```APIDOC ## GET /getSendViewDistance ### Description Gets the sending view distance for this world. Sending view distance is the view distance where chunks will load in for players in this world. ### Method GET ### Response #### Success Response (200) - **int** - The sending view distance for this world. ``` -------------------------------- ### Get Block Sound Group Source: https://jd.papermc.io/paper/1.21.11/org/bukkit/block/Block.html Gets the `SoundGroup` for this block. ```APIDOC ## getBlockSoundGroup ### Description Gets the `SoundGroup` for this block. ### Method `getBlockSoundGroup` ### Returns - `SoundGroup` - The sound group for this block. ``` -------------------------------- ### HelpTopic.getFullText(CommandSender) Source: https://jd.papermc.io/paper/1.21.11/index-all.html Returns the full description of this help topic that is displayed when the user requests this topic's details. ```APIDOC ## getFullText(CommandSender) ### Description Returns the full description of this help topic that is displayed when the user requests this topic's details. ### Method Method in class org.bukkit.help.HelpTopic ``` -------------------------------- ### Get Idle Timeout Source: https://jd.papermc.io/paper/1.21.11/org/bukkit/Server.html Gets the idle kick timeout. ```APIDOC ## GET /api/server/idle-timeout ### Description Gets the idle kick timeout. ### Method GET ### Endpoint /api/server/idle-timeout ### Response #### Success Response (200) - **idleTimeout** (integer) - The idle timeout in minutes ``` -------------------------------- ### Bukkit Source: https://jd.papermc.io/paper/1.21.11/index-all.html Gets the server configuration. ```APIDOC ## getServerConfig() ### Description Gets the server configuration. ### Method Static method in class org.bukkit.Bukkit ``` -------------------------------- ### IndexHelpTopic.getFullText(CommandSender) Source: https://jd.papermc.io/paper/1.21.11/index-all.html Returns the full description of this help topic that is displayed when the user requests this topic's details. ```APIDOC ## getFullText(CommandSender) ### Description Returns the full description of this help topic that is displayed when the user requests this topic's details. ### Method Method in class org.bukkit.help.IndexHelpTopic ``` -------------------------------- ### GET /getConnectionThrottle Source: https://jd.papermc.io/paper/1.21.11/org/bukkit/Bukkit.html Gets the connection throttle setting value. ```APIDOC ## GET /getConnectionThrottle ### Description Gets the value of the connection throttle setting. ### Method GET ### Response #### Success Response (200) - **throttle** (long) - the value of the connection throttle setting ``` -------------------------------- ### Get Horse Inventory Source: https://jd.papermc.io/paper/1.21.11/org/bukkit/inventory/class-use/HorseInventory.html This snippet shows how to get the inventory of a horse entity. ```APIDOC ## GET /api/horse/{id}/inventory ### Description Retrieves the inventory associated with a specific horse entity. ### Method GET ### Endpoint `/api/horse/{id}/inventory` ### Parameters #### Path Parameters - **id** (string) - Required - The unique identifier of the horse. ### Response #### Success Response (200) - **inventory** (HorseInventory) - The inventory object of the horse. #### Response Example ```json { "inventory": { ... HorseInventory object ... } } ``` ``` -------------------------------- ### options Source: https://jd.papermc.io/paper/1.21.11/org/bukkit/configuration/file/FileConfiguration.html Retrieves the configuration options for the current instance. ```APIDOC ## options ### Description Gets the ConfigurationOptions for this Configuration. Setters through this method are chainable. ### Returns - **FileConfigurationOptions** - Options for this configuration. ``` -------------------------------- ### Get Server Icon Source: https://jd.papermc.io/paper/1.21.11/org/bukkit/Server.html Gets an instance of the server's default server-icon. ```APIDOC ## GET /api/server/icon ### Description Gets an instance of the server's default server-icon. ### Method GET ### Endpoint /api/server/icon ### Response #### Success Response (200) - **serverIcon** (CachedServerIcon) - The default server-icon; null values may be used by the implementation to indicate no defined icon, but this behavior is not guaranteed ``` -------------------------------- ### Server.Spigot Constructor Source: https://jd.papermc.io/paper/1.21.11/org/bukkit/Server.Spigot.html Initializes a new instance of the Server.Spigot class. ```APIDOC ## Server.Spigot Constructor ### Description Initializes a new instance of the Server.Spigot class. ### Method `Spigot()` ### Endpoint N/A (Constructor) ``` -------------------------------- ### Get or Create Scoreboard Criteria Source: https://jd.papermc.io/paper/1.21.11/org/bukkit/Server.html Get (or create) a new Criteria by its name. ```APIDOC ## GET /api/server/scoreboard/criteria/{name} ### Description Get (or create) a new `Criteria` by its name. ### Method GET ### Endpoint /api/server/scoreboard/criteria/{name} ### Parameters #### Path Parameters - **name** (string) - Required - The criteria name ### Response #### Success Response (200) - **criteria** (Criteria) - The criteria object ``` -------------------------------- ### PluginBootstrap Methods Source: https://jd.papermc.io/paper/1.21.11/io/papermc/paper/plugin/bootstrap/PluginBootstrap.html Methods for bootstrapping a plugin and creating the main JavaPlugin instance. ```APIDOC ## bootstrap(BootstrapContext context) ### Description Called by the server, allowing you to bootstrap the plugin with a context that provides things like a logger and your shared plugin configuration file. ### Parameters - **context** (BootstrapContext) - Required - The server provided context. --- ## createPlugin(PluginProviderContext context) ### Description Called by the server to instantiate your main class. Plugins may override this logic to define custom creation logic for said instance, like passing additional constructor arguments. ### Parameters - **context** (PluginProviderContext) - Required - The server created bootstrap object. ### Response - **JavaPlugin** - The server requested instance of the plugin's main class. ``` -------------------------------- ### Get DialogInstancesProvider Instance Source: https://jd.papermc.io/paper/1.21.11/io/papermc/paper/registry/data/dialog/class-use/DialogInstancesProvider.html This snippet shows how to get a static instance of DialogInstancesProvider. ```APIDOC ## GET DialogInstancesProvider ### Description Retrieves a static instance of the DialogInstancesProvider. ### Method GET ### Endpoint DialogInstancesProvider.instance() ### Parameters None ### Request Example None ### Response #### Success Response (200) - **DialogInstancesProvider** (object) - An instance of DialogInstancesProvider. #### Response Example ```json { "instance": "" } ``` ``` -------------------------------- ### Configuration Classes Overview Source: https://jd.papermc.io/paper/1.21.11/org/bukkit/configuration/class-use/Configuration.html Overview of classes within org.bukkit.configuration and org.bukkit.configuration.file that handle plugin configurations. ```APIDOC ## Package: org.bukkit.configuration ### Description Classes dedicated to handling a plugin's runtime configuration. ## Package: org.bukkit.configuration.file ### Description Classes dedicated to facilitating `configurations` to be read and stored on the filesystem. ## Classes implementing Configuration in org.bukkit.configuration ### MemoryConfiguration This is a `Configuration` implementation that does not save or load from any source, and stores all values in memory only. ## Classes implementing Configuration in org.bukkit.configuration.file ### FileConfiguration This is a base class for all File based implementations of `Configuration`. ### YamlConfiguration An implementation of `Configuration` which saves all files in Yaml. ``` -------------------------------- ### JavaPlugin.init (overload 1) Source: https://jd.papermc.io/paper/1.21.11/org/bukkit/plugin/class-use/PluginDescriptionFile.html Initializes a JavaPlugin with the provided parameters, including its PluginDescriptionFile. This method is final. ```APIDOC ## POST JavaPlugin.init ### Description Initializes a JavaPlugin with the provided parameters, including its PluginDescriptionFile. This method is final. ### Method POST ### Endpoint N/A (Method within a class) ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body - **loader** (PluginLoader) - The plugin loader. - **server** (Server) - The server instance. - **description** (PluginDescriptionFile) - The plugin's description file. - **dataFolder** (File) - The plugin's data folder. - **file** (File) - The plugin's file. - **classLoader** (ClassLoader) - The plugin's class loader. ### Request Example None ### Response #### Success Response (200) - **final void** - Indicates successful initialization. #### Response Example None ``` -------------------------------- ### Get Nearest Color Source: https://jd.papermc.io/paper/1.21.11/org/bukkit/map/MapPalette.html Gets the closest Color in the map palette to a given Color. ```APIDOC ## POST /api/color/nearest ### Description Gets the closest Color in the map palette to a given Color. ### Method POST ### Endpoint /api/color/nearest ### Parameters #### Request Body - **color** (Color) - Required - The Color to match against the map palette. ### Request Example { "color": {"r": 255, "g": 0, "b": 0} } ### Response #### Success Response (200) - **nearestColor** (Color) - The nearest Color from the map palette. #### Response Example { "nearestColor": {"r": 250, "g": 5, "b": 5} } ``` -------------------------------- ### org.bukkit.configuration.file Package Source: https://jd.papermc.io/paper/1.21.11/org/bukkit/configuration/package-use.html Facilitates reading and storing configurations on the filesystem. ```APIDOC ## Package: org.bukkit.configuration.file ### Description Classes dedicated to facilitating `configurations` to be read and stored on the filesystem. ``` -------------------------------- ### Get Block Destruction Speed Source: https://jd.papermc.io/paper/1.21.11/org/bukkit/block/Block.html Gets the speed at which this block will be destroyed by a given ItemStack. ```APIDOC ## getDestroySpeed ### Description Gets the speed at which this block will be destroyed by a given `ItemStack`. ### Method `getDestroySpeed` ### Parameters #### Path Parameters - `itemStack` (ItemStack) - Required - `ItemStack` used to mine this Block ### Returns - `float` - The speed that this Block will be mined by the given `ItemStack`. ``` -------------------------------- ### Get Translation Key (Deprecated) Source: https://jd.papermc.io/paper/1.21.11/org/bukkit/block/Block.html Gets the translation key for this block. This method is deprecated. ```APIDOC ## getTranslationKey ### Description Get the translation key, suitable for use in a translation component. ### Method `getTranslationKey` ### Returns - `String` - The translation key. ### Deprecation Deprecated, for removal: This API element is subject to removal in a future version. Use `Translatable.translationKey()` instead. ``` -------------------------------- ### Bukkit.getServer() Source: https://jd.papermc.io/paper/1.21.11/org/bukkit/class-use/Server.html Retrieves the current Server singleton instance. ```APIDOC ## GET Bukkit.getServer() ### Description Gets the current `Server` singleton. ### Method GET ### Endpoint Bukkit.getServer() ### Parameters None ### Request Example None ### Response #### Success Response (200) - **Server** (Server) - The current Server singleton instance. #### Response Example ```java Server server = Bukkit.getServer(); ``` ``` -------------------------------- ### Get Block Sound Group (Deprecated) Source: https://jd.papermc.io/paper/1.21.11/org/bukkit/block/Block.html Gets the `BlockSoundGroup` for this block. This method is deprecated. ```APIDOC ## getSoundGroup ### Description Gets the `BlockSoundGroup` for this block. This object contains the block, step, place, hit, and fall sounds. ### Method `getSoundGroup` ### Returns - `BlockSoundGroup` - The sound group for this block. ### Deprecation Deprecated, for removal: This API element is subject to removal in a future version. Use `getBlockSoundGroup()` instead. ``` -------------------------------- ### POST /org/bukkit/help/HelpMap/registerHelpTopicFactory Source: https://jd.papermc.io/paper/1.21.11/org/bukkit/help/class-use/HelpTopicFactory.html Registers a HelpTopicFactory to a specific command class to handle custom help topic generation. ```APIDOC ## POST /org/bukkit/help/HelpMap/registerHelpTopicFactory ### Description Associates a HelpTopicFactory object with a given command base class to manipulate the default command and topic assistance system. ### Method POST ### Endpoint /org/bukkit/help/HelpMap/registerHelpTopicFactory ### Parameters #### Request Body - **commandClass** (Class) - Required - The command base class to associate with the factory. - **factory** (HelpTopicFactory) - Required - The factory object to register. ### Response #### Success Response (200) - **void** - The operation returns no value. ``` -------------------------------- ### Get Computed Block Biome Source: https://jd.papermc.io/paper/1.21.11/org/bukkit/block/Block.html Gets the computed biome at the block's location. ```java Biome getComputedBiome() ``` -------------------------------- ### HelpTopic Class Methods Source: https://jd.papermc.io/paper/1.21.11/org/bukkit/help/HelpTopic.html Overview of the methods available for managing and customizing help topics within the Bukkit API. ```APIDOC ## HelpTopic Class Methods ### Description Methods for managing help topic visibility, content, and retrieval for the /help command system. ### Methods - **amendCanSee(String amendedPermission)**: Overrides the permission required to view the topic. - **amendTopic(String amendedShortText, String amendedFullText)**: Updates the short and full text descriptions of the topic. - **applyAmendment(String baseText, String amendment)**: Utility to ensure custom implementations comply with amendment logic. - **canSee(CommandSender player)**: Abstract method to determine if a sender can view the topic. - **getFullText(CommandSender forWho)**: Retrieves the full description for the topic. - **getName()**: Returns the unique name of the help topic. - **getShortText()**: Returns the brief description for index display. ``` -------------------------------- ### SimpleCommandMap Constructor Source: https://jd.papermc.io/paper/1.21.11/org/bukkit/class-use/Server.html Constructs a SimpleCommandMap with a Server instance. ```APIDOC ## POST SimpleCommandMap(Server server, Map backing) ### Description Constructs a `SimpleCommandMap` with the provided `Server` instance and backing map. ### Method POST ### Endpoint new SimpleCommandMap(Server server, Map backing) ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body - **server** (Server) - Required - The Server instance. - **backing** (Map) - Required - The backing map for commands. ### Request Example ```java // Assuming 'myServer' is an instance of Server and 'commandMap' is a Map SimpleCommandMap simpleCommandMap = new SimpleCommandMap(myServer, commandMap); ``` ### Response #### Success Response (200) - **SimpleCommandMap** (SimpleCommandMap) - The created SimpleCommandMap instance. #### Response Example None ``` -------------------------------- ### LoadingIntMap get Method Source: https://jd.papermc.io/paper/1.21.11/co/aikar/util/LoadingIntMap.html Documentation for the 'get' method of the LoadingIntMap class. This method is deprecated. ```APIDOC ## Method Details ### get `@Nullable public V get(int key)` **Deprecated**: This API element is subject to removal in a future version. **Specified by:** `get` in interface `it.unimi.dsi.fastutil.ints.Int2ObjectFunction` **Overrides:** `get` in class `it.unimi.dsi.fastutil.ints.Int2ObjectOpenHashMap` ``` -------------------------------- ### ConfigurationOptions Methods Source: https://jd.papermc.io/paper/1.21.11/org/bukkit/configuration/ConfigurationOptions.html Documentation for the instance methods available in the ConfigurationOptions class. ```APIDOC ## Methods: ConfigurationOptions ### `configuration()` #### Description Returns the `Configuration` that this object is responsible for. #### Method `@NotNull Configuration configuration()` #### Returns - **Configuration** - Parent configuration. ### `pathSeparator()` #### Description Gets the char that will be used to separate `ConfigurationSection`s. This value does not affect how the `Configuration` is stored, only in how you access the data. The default value is '.'. #### Method `char pathSeparator()` #### Returns - **char** - Path separator. ### `pathSeparator(char value)` #### Description Sets the char that will be used to separate `ConfigurationSection`s. This value does not affect how the `Configuration` is stored, only in how you access the data. The default value is '.'. #### Method `@NotNull ConfigurationOptions pathSeparator(char value)` #### Parameters - **value** (`char`) - Path separator. #### Returns - **@NotNull ConfigurationOptions** - This object, for chaining. ### `copyDefaults()` #### Description Checks if the `Configuration` should copy values from its default `Configuration` directly. If this is true, all values in the default Configuration will be directly copied, making it impossible to distinguish between values that were set and values that are provided by default. As a result, `ConfigurationSection.contains(java.lang.String)` will always return the same value as `ConfigurationSection.isSet(java.lang.String)`. The default value is false. #### Method `boolean copyDefaults()` #### Returns - **boolean** - Whether or not defaults are directly copied. ### `copyDefaults(boolean value)` #### Description Sets if the `Configuration` should copy values from its default `Configuration` directly. If this is true, all values in the default Configuration will be directly copied, making it impossible to distinguish between values that were set and values that are provided by default. As a result, `ConfigurationSection.contains(java.lang.String)` will always return the same value as `ConfigurationSection.isSet(java.lang.String)`. The default value is false. #### Method `@NotNull ConfigurationOptions copyDefaults(boolean value)` #### Parameters - **value** (`boolean`) - Whether or not defaults are directly copied. #### Returns - **@NotNull ConfigurationOptions** - This object, for chaining. ``` -------------------------------- ### Deprecated Get Player Locale Source: https://jd.papermc.io/paper/1.21.11/org/bukkit/entity/Player.html Deprecated method to get the player's current locale. ```APIDOC ## getLocale (Deprecated) ### Description Deprecated. in favour of `locale()` Gets the player's current locale. The value of the locale String is not defined properly. The vanilla Minecraft client will use lowercase language / country pairs separated by an underscore, but custom resource packs may use any format they wish. ### Method `@Deprecated String getLocale()` ### Response #### Success Response (200) - `String` - the player's locale #### Response Example ```json { "locale": "en_US" } ``` ``` -------------------------------- ### init Source: https://jd.papermc.io/paper/1.21.11/org/bukkit/plugin/java/PluginClassLoader.html Initializes the class loader and links it to the provided JavaPlugin instance. ```APIDOC ## init ### Description Initializes both this configured plugin class loader and the java plugin passed to link to each other. This logic is to be called exactly once. ### Parameters - **plugin** (JavaPlugin) - Required - The JavaPlugin that should be interlinked with this class loader. ``` -------------------------------- ### Get Nearby Players Source: https://jd.papermc.io/paper/1.21.11/org/bukkit/World.html Gets nearby players within a specified radius from a given location. ```APIDOC ## GET /api/world/entities/nearby/players ### Description Gets nearby Players within the specified radius (bounding box). ### Method GET ### Endpoint /api/world/entities/nearby/players ### Query Parameters - **loc** (Location) - Required - Center location. - **radius** (double) - Required - Radius. ### Response #### Success Response (200) - **players** (Collection) - The collection of players near the location. ``` -------------------------------- ### Create a JarLibrary Instance Source: https://jd.papermc.io/paper/1.21.11/io/papermc/paper/plugin/loader/library/impl/JarLibrary.html Instantiate a JarLibrary to reference a JAR file on the local filesystem. The path is relative to the JVM's start directory. The library will error if the file does not exist. ```java final JarLibrary customLibrary = new JarLibrary(Path.of("libs/custom-library-1.24.jar")); ``` -------------------------------- ### BlockData.getSoundGroup() Source: https://jd.papermc.io/paper/1.21.11/index-all.html Gets the block's `SoundGroup` which can be used to get its step sound, hit sound, and others. ```APIDOC ## BlockData.getSoundGroup() ### Description Gets the block's `SoundGroup` which can be used to get its step sound, hit sound, and others. ### Method N/A (Java Method) ### Endpoint N/A ### Parameters None ### Request Example None ### Response #### Success Response - **soundGroup** (SoundGroup) - The sound group of the block. ``` -------------------------------- ### Get Capture Full Time Source: https://jd.papermc.io/paper/1.21.11/org/bukkit/ChunkSnapshot.html Gets the full world time in ticks when a chunk snapshot was captured. ```APIDOC ## GET /api/world/capture/time ### Description Gets the full world time in ticks when a chunk snapshot was captured. ### Method GET ### Endpoint /api/world/capture/time ### Response #### Success Response (200) - **time** (long) - The world time in ticks. #### Response Example ```json { "time": 1234567890 } ``` ``` -------------------------------- ### Example: Creating a Tag in PreFlattenTagRegistrar Source: https://jd.papermc.io/paper/1.21.11/io/papermc/paper/tag/PreFlattenTagRegistrar.html This example demonstrates how to create and set a tag using PreFlattenTagRegistrar within a plugin's bootstrap process. It requires implementing PluginBootstrap and using LifecycleEventManager to hook into the TAGS.preFlatten event. ```java class YourBootstrapClass implements PluginBootstrap { public static final TagKey AXE_PICKAXE = ItemTypeTagKeys.create(Key.key("papermc:axe_pickaxe")); @Override public void bootstrap(BootstrapContext context) { final LifecycleEventManager manager = context.getLifecycleManager(); manager.registerEventHandler(LifecycleEvents.TAGS.preFlatten(RegistryKey.ITEM), event -> { final PreFlattenTagRegistrar registrar = event.registrar(); registrar.setTag(AXE_PICKAXE, Set.of( TagEntry.tagEntry(ItemTypeTagKeys.PICKAXES), TagEntry.tagEntry(ItemTypeTagKeys.AXES) )); }); } } ``` -------------------------------- ### JavaPlugin.init (overload 2) Source: https://jd.papermc.io/paper/1.21.11/org/bukkit/plugin/class-use/PluginDescriptionFile.html Initializes a JavaPlugin with additional configuration and logger. This method is final. ```APIDOC ## POST JavaPlugin.init ### Description Initializes a JavaPlugin with additional configuration and logger. This method is final. ### Method POST ### Endpoint N/A (Method within a class) ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body - **server** (Server) - The server instance. - **description** (PluginDescriptionFile) - The plugin's description file. - **dataFolder** (File) - The plugin's data folder. - **file** (File) - The plugin's file. - **classLoader** (ClassLoader) - The plugin's class loader. - **configuration** (@Nullable PluginMeta) - Optional plugin configuration metadata. - **logger** (Logger) - The logger instance for the plugin. ### Request Example None ### Response #### Success Response (200) - **final void** - Indicates successful initialization. #### Response Example None ``` -------------------------------- ### getPose Source: https://jd.papermc.io/paper/1.21.11/index-all.html Gets the entity's current pose. Also used to get the entity's new pose. ```APIDOC ## getPose() ### Description Gets the entity's current pose. Also used to get the entity's new pose. ### Method N/A (Method Signature) ### Endpoint N/A ### Parameters N/A ### Request Example N/A ### Response N/A ``` -------------------------------- ### FileConfiguration Constructors Source: https://jd.papermc.io/paper/1.21.11/org/bukkit/configuration/file/FileConfiguration.html Details on how to create instances of the FileConfiguration class. ```APIDOC ## Constructor Details ### FileConfiguration() Creates an empty `FileConfiguration` with no default values. ### FileConfiguration(@Nullable Configuration defaults) Creates an empty `FileConfiguration` using the specified `Configuration` as a source for all default values. **Parameters:** - `defaults` (Configuration) - Default value provider ``` -------------------------------- ### getPort Source: https://jd.papermc.io/paper/1.21.11/index-all.html Get server (public facing) port. Also used to get the game port that the server runs on. ```APIDOC ## getPort() ### Description Get server (public facing) port. Also used to get the game port that the server runs on. ### Method N/A (Method Signature) ### Endpoint N/A ### Parameters N/A ### Request Example N/A ### Response N/A ``` -------------------------------- ### FileConfiguration Constructors Source: https://jd.papermc.io/paper/1.21.11/org/bukkit/configuration/file/FileConfiguration.html Details on how to instantiate a FileConfiguration object. ```APIDOC ## FileConfiguration Constructors ### Constructor `FileConfiguration()` ### Description Creates an empty `FileConfiguration` with no default values. ### Constructor `FileConfiguration(@Nullable Configuration defaults)` ### Description Creates an empty `FileConfiguration` using the specified `Configuration` as a source for all default values. ``` -------------------------------- ### Get Block Destruction Speed (with enchants) Source: https://jd.papermc.io/paper/1.21.11/org/bukkit/block/Block.html Gets the speed at which this block will be destroyed by a given ItemStack, considering enchantments. ```APIDOC ## getDestroySpeed (with enchants) ### Description Gets the speed at which this block will be destroyed by a given `ItemStack`. ### Method `getDestroySpeed` ### Parameters #### Path Parameters - `itemStack` (ItemStack) - Required - `ItemStack` used to mine this Block - `considerEnchants` (boolean) - Required - `true` to look at enchants on the itemstack ### Returns - `float` - The speed that this Block will be mined by the given `ItemStack`. ``` -------------------------------- ### ActionButton Creation and Configuration Source: https://jd.papermc.io/paper/1.21.11/io/papermc/paper/registry/data/dialog/class-use/ActionButton.html Methods for creating and building ActionButton instances. ```APIDOC ## ActionButton.create ### Description Creates a new action button with the specified label, tooltip, width, and action. ### Parameters - **label** (Component) - Required - The text label for the button. - **tooltip** (Component) - Optional - The tooltip text for the button. - **width** (int) - Required - The width of the button (1-1024). - **action** (DialogAction) - Optional - The action to perform when clicked. ## ActionButton.Builder.build ### Description Builds the ActionButton instance with the configured values. ``` -------------------------------- ### UUIDItemTagType Example Source: https://jd.papermc.io/paper/1.21.11/org/bukkit/inventory/meta/tags/ItemTagType.html An example implementation of a custom ItemTagType for handling UUIDs, demonstrating how to map UUIDs to byte arrays. ```APIDOC ## UUIDItemTagType Example ### Description This example shows how to implement `ItemTagType` for a custom complex type, specifically `UUID`. It demonstrates the conversion between a `UUID` object and its primitive `byte[]` representation. ### Class Definition ```java public class UUIDItemTagType implements ItemTagType { @Override public Class getPrimitiveType() { return byte[].class; } @Override public Class getComplexType() { return UUID.class; } @Override public byte[] toPrimitive(UUID complex, ItemTagAdapterContext context) { ByteBuffer bb = ByteBuffer.wrap(new byte[16]); bb.putLong(complex.getMostSignificantBits()); bb.putLong(complex.getLeastSignificantBits()); return bb.array(); } @Override public UUID fromPrimitive(byte[] primitive, ItemTagAdapterContext context) { ByteBuffer bb = ByteBuffer.wrap(primitive); long firstLong = bb.getLong(); long secondLong = bb.getLong(); return new UUID(firstLong, secondLong); } } ``` ``` -------------------------------- ### Create and start a Timing handler Source: https://jd.papermc.io/paper/1.21.11/co/aikar/timings/Timings.html Creates and immediately starts a Timing object, intended for use with try-with-resources blocks. ```java try (Timing ignored = Timings.ofStart(plugin, someName)) { // timed section } ``` ```java try (Timing ignored = Timings.ofStart(plugin, someName, groupHandler)) { // timed section } ```