Mimic

interface Mimic(source)

Mimic provides access to abstraction APIs.

Threading

Methods that change a player or a block must be called on the thread owning it, which is the main thread on Paper and the region's thread on Folia. Changes via Levels, Classes and Resources, and Blocks methods taking a block, throw IllegalStateException on any other thread. Each API describes its own rules.

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard
abstract val blocks: Blocks

Vanilla and custom blocks from all plugins: identify placed blocks, set and break them, get items placing them. See Blocks for details and examples. To make your plugin's blocks available here, use registerBlockProvider.

Link copied to clipboard
abstract val classes: Classes

Classes of players from all RPG plugins: read them, check class requirements, change classes. See Classes for details and examples. To make your plugin's classes available here, use registerClassProvider.

Link copied to clipboard
abstract val items: Items

Vanilla and custom items from all plugins: create them by ID, identify stacks, list and validate IDs. See Items for details and examples. To make your plugin's items available here, use registerItemProvider.

Link copied to clipboard

Returns BukkitItemsRegistry combining items of all item providers. Unlike items, it searches an ID without a namespace over all providers.

Link copied to clipboard
abstract val levels: Levels

Levels of players from all RPG plugins: read them, check level requirements, give or take experience. See Levels for details and examples. To make your plugin's levels available here, use registerLevelProvider.

Link copied to clipboard
abstract val resources: Resources

Resources of players from all RPG plugins, like mana and stamina: read them, take costs, give them back. See Resources for details and examples. To make your plugin's resources available here, use registerResourceProvider.

Functions

Link copied to clipboard

Returns map containing all known BukkitClassSystem.Providers, where key is a provider ID.

Link copied to clipboard

Returns map containing all known BukkitItemsRegistry, where key is an item registry ID.

Link copied to clipboard

Returns map containing all known BukkitLevelSystem.Providers, where key is a provider ID.

Link copied to clipboard

Returns map containing all known BukkitPlayerInventory.Providers, where key is a provider ID.

Link copied to clipboard

Returns top priority BukkitClassSystem for the given player. It is a shorthand for getClassSystemProvider().getSystem(player).

Link copied to clipboard
Link copied to clipboard

Returns top priority BukkitLevelSystem for the given player. It is a shorthand for getLevelSystemProvider().getSystem(player).

Link copied to clipboard
Link copied to clipboard
@ApiStatus.Experimental
open fun getPlayerInventory(player: Player): BukkitPlayerInventory

Returns top priority BukkitPlayerInventory for the given player. It is a shorthand for getPlayerInventoryProvider().getSystem(player).

Link copied to clipboard
Link copied to clipboard
open fun registerBlockProvider(provider: BlockProvider, apiLevel: Int, plugin: Plugin): BlockProvider?

Registers the given provider of blocks with normal priority.

abstract fun registerBlockProvider(provider: BlockProvider, apiLevel: Int, plugin: Plugin, priority: ServicePriority): BlockProvider?

Registers the given provider of blocks.

Link copied to clipboard
open fun registerClassProvider(provider: ClassProvider, apiLevel: Int, plugin: Plugin): ClassProvider?

Registers the given provider of classes with normal priority.

abstract fun registerClassProvider(provider: ClassProvider, apiLevel: Int, plugin: Plugin, priority: ServicePriority): ClassProvider?

Registers the given provider of classes.

Link copied to clipboard

Registers the given provider for BukkitClassSystem with normal priority.

Registers the given provider for BukkitClassSystem.

Link copied to clipboard
open fun registerItemProvider(provider: ItemProvider, apiLevel: Int, plugin: Plugin): ItemProvider?

Registers the given provider of items with normal priority.

abstract fun registerItemProvider(provider: ItemProvider, apiLevel: Int, plugin: Plugin, priority: ServicePriority): ItemProvider?

Registers the given provider of items.

Link copied to clipboard
open fun registerItemsRegistry(registry: BukkitItemsRegistry, apiLevel: Int, plugin: Plugin): BukkitItemsRegistry?

Registers the given registry with normal priority.

abstract fun registerItemsRegistry(registry: BukkitItemsRegistry, apiLevel: Int, plugin: Plugin, priority: ServicePriority): BukkitItemsRegistry?

Registers the given registry.

Link copied to clipboard
open fun registerLevelProvider(provider: LevelProvider, apiLevel: Int, plugin: Plugin): LevelProvider?

Registers the given provider of level tracks with normal priority.

abstract fun registerLevelProvider(provider: LevelProvider, apiLevel: Int, plugin: Plugin, priority: ServicePriority): LevelProvider?

Registers the given provider of level tracks.

Link copied to clipboard

Registers the given provider for BukkitLevelSystem with normal priority.

Registers the given provider for BukkitLevelSystem.

Link copied to clipboard

Registers the given provider for BukkitPlayerInventory with normal priority.

Registers the given provider for BukkitPlayerInventory.

Link copied to clipboard
open fun registerResourceProvider(provider: ResourceProvider, apiLevel: Int, plugin: Plugin): ResourceProvider?

Registers the given provider of resources with normal priority.

abstract fun registerResourceProvider(provider: ResourceProvider, apiLevel: Int, plugin: Plugin, priority: ServicePriority): ResourceProvider?

Registers the given provider of resources.