Skip to content

Kotlin Interface Map ​

The plugin world imports these host interfaces. Kotlin exposes them in pumpkin; for example, WIT boss-bar becomes pumpkin.BossBar. Each WIT link opens its source definition.

WIT definitionGenerated Kotlin namespacePurpose
loggingLoggingServer logging.
guiGuiGUI resources and their inventories.
scoreboardScoreboardScoreboard resources.
serverServerGlobal server and player lookup.
textTextText components.
commandCommandCommand trees, senders, arguments, execution, and suggestions. commands manages callback IDs.
contextContextContext.Context registration, server access, and plugin data folder.
i18nI18nTranslation and locale support.
schedulerSchedulerDelayed/repeating tasks and cancellation. PumpkinPlugin.tasks manages both callback forms.
worldWorldWorlds, blocks, entities, chunks, and generation. Custom AI and generators call back into PumpkinPlugin.
entityEntityEntity-related types exposed across the API.
boss-barBossBarBoss bar types and resources.
formsFormsBedrock forms.
java-dialogsJavaDialogsJava Edition dialogs.
status-effectStatusEffectStatus effect types and instances.
block-entityBlockEntityBlock entity types and resources.
ipcIpcSend messages to another plugin; inbound messages use handleIpcMessage.
attributesAttributesEntity attributes and modifiers.
playerPlayerPlayer resources and operations, including inventory access.
advancementAdvancementAdvancement definitions and progress.
recipeRecipeRecipe definitions and registration.
inventoryInventoryInventory and player-inventory resource operations.
datapackDatapackDatapack inspection and management.
enchantmentsEnchantmentsEnchantment types.
damage-typesDamageTypesDamage types.
screensScreensScreen and container types.
statisticsStatisticsPlayer statistics categories and types.
displayDisplayDisplay and interaction entities.
game-rulesGameRulesGame rule definitions and values.
game-eventsGameEventsGame event types.
potionsPotionsPotion types.
entity-statusesEntityStatusesEntity status and animation types.

WIT names as Kotlin definitions ​

The generated Kotlin names and types follow the WIT definitions:

WITKotlin
context resource contextContext.Context; also aliased as PluginContext by the handwritten API
inventory resource inventoryInventory.Inventory
event variant eventEvent.Event
world resource worldWorld.World
u8, u16, u32, u64UByte, UShort, UInt, ULong
s32, bool, stringInt, Boolean, String
list<u8>, option<T>List<UByte>, nullable T?
result<T, E>Kotlin Result<T> at the generated call boundary

WIT register-event-with-handle becomes context.registerEventWithHandle(handlerId, eventType, priority, blocking) and returns a ULong. WIT get-item: func(slot: u32) -> option<item-stack> becomes inventory.getItem(slot: UInt): ItemStack.ItemStack?. IDE completion shows the members in your API version.

These operations connect generated WIT calls to the Kotlin registration APIs:

WIT operationGenerated Kotlin callKotlin API
context.register-event-with-handle and unregister-eventcontext.registerEventWithHandle(id, type, priority, blocking) and context.unregisterEvent(registrationId)events.listen(...) and EventSubscription.unregister()
command.execute-with-handler-id and context.register-commandcommand.executeWithHandlerId(id) then context.registerCommand(command, permission)commands.register(...)
command-node.suggest-with-handler-idnode.suggestWithHandlerId(id)commands.onSuggestions(...)
scheduler.schedule-delayed-taskScheduler.scheduleDelayedTask(id, delayTicks)tasks.afterTicks(...)
scheduler.schedule-repeating-task and cancel-taskScheduler.scheduleRepeatingTask(id, delayTicks, periodTicks) and Scheduler.cancelTask(taskId)tasks.everyTicks(...) and ScheduledTask.cancel()
mob.add-custom-ai-goalmob.addCustomAiGoal(priority, goalId)aiGoals.register(...)
world.set-chunk-generatorworld.setChunkGenerator(generatorId)chunkGenerators.set(...)
ipc.send-ipc-messageIpc.sendIpcMessage(recipient, message)Outbound IPC; the recipient uses ipc.onMessage(...)

The Kotlin API assigns handler IDs for its registration methods. Direct calls through generated bindings require you to manage those IDs.

Shared type interfaces ​

These interfaces define types used by host imports and plugin exports. They are not separate imports in the plugin world:

WIT definitionsKotlin namespaces
common, uuidCommon, Uuid
biomes, sounds, particlesBiomes, Sounds, Particles
java-packets, bedrock-packetsJavaPackets, BedrockPackets
item-stack, data-componentsItemStack, DataComponents
permission, event, metadata, entity-typesPermission, Event, Metadata, EntityTypes

Resource methods such as Inventory.Inventory.getItem and setItem need no callback or handler ID. The callback reference covers operations that do.

Released under the MIT License.