From 41d8c71c65a9948059fb02eb613b7c1db617bd7e Mon Sep 17 00:00:00 2001 From: Alexander Medvedev Date: Tue, 19 May 2026 17:43:50 +0200 Subject: [PATCH] first commit --- v0.1/bedrock-packets.wit | 400 ++++++++ v0.1/biomes.wit | 71 ++ v0.1/block-entity.wit | 84 ++ v0.1/boss-bar.wit | 83 ++ v0.1/command.wit | 224 +++++ v0.1/common.wit | 233 +++++ v0.1/context.wit | 33 + v0.1/data-components.wit | 116 +++ v0.1/enchantments.wit | 49 + v0.1/entity-types.wit | 163 ++++ v0.1/entity.wit | 1 + v0.1/event.wit | 392 ++++++++ v0.1/forms.wit | 51 + v0.1/gui.wit | 63 ++ v0.1/i18n.wit | 21 + v0.1/item-stack.wit | 59 ++ v0.1/java-dialogs.wit | 155 ++++ v0.1/java-packets.wit | 864 +++++++++++++++++ v0.1/log.wit | 14 + v0.1/metadata.wit | 19 + v0.1/particles.wit | 123 +++ v0.1/permission.wit | 46 + v0.1/player.wit | 796 ++++++++++++++++ v0.1/plugin.wit | 68 ++ v0.1/recipe.wit | 67 ++ v0.1/scheduler.wit | 24 + v0.1/scoreboard.wit | 72 ++ v0.1/server.wit | 122 +++ v0.1/sounds.wit | 1908 ++++++++++++++++++++++++++++++++++++++ v0.1/text.wit | 41 + v0.1/uuid.wit | 16 + v0.1/world.wit | 387 ++++++++ 32 files changed, 6765 insertions(+) create mode 100644 v0.1/bedrock-packets.wit create mode 100644 v0.1/biomes.wit create mode 100644 v0.1/block-entity.wit create mode 100644 v0.1/boss-bar.wit create mode 100644 v0.1/command.wit create mode 100644 v0.1/common.wit create mode 100644 v0.1/context.wit create mode 100644 v0.1/data-components.wit create mode 100644 v0.1/enchantments.wit create mode 100644 v0.1/entity-types.wit create mode 100644 v0.1/entity.wit create mode 100644 v0.1/event.wit create mode 100644 v0.1/forms.wit create mode 100644 v0.1/gui.wit create mode 100644 v0.1/i18n.wit create mode 100644 v0.1/item-stack.wit create mode 100644 v0.1/java-dialogs.wit create mode 100644 v0.1/java-packets.wit create mode 100644 v0.1/log.wit create mode 100644 v0.1/metadata.wit create mode 100644 v0.1/particles.wit create mode 100644 v0.1/permission.wit create mode 100644 v0.1/player.wit create mode 100644 v0.1/plugin.wit create mode 100644 v0.1/recipe.wit create mode 100644 v0.1/scheduler.wit create mode 100644 v0.1/scoreboard.wit create mode 100644 v0.1/server.wit create mode 100644 v0.1/sounds.wit create mode 100644 v0.1/text.wit create mode 100644 v0.1/uuid.wit create mode 100644 v0.1/world.wit diff --git a/v0.1/bedrock-packets.wit b/v0.1/bedrock-packets.wit new file mode 100644 index 0000000..4e1b926 --- /dev/null +++ b/v0.1/bedrock-packets.wit @@ -0,0 +1,400 @@ +package pumpkin:plugin@0.1.0; + +interface bedrock-packets { + use uuid.{ uuid }; + record s-animate { + action: string, + runtime-entity-id: string, + boat-rowing-time: option, + } + record s-client-cache-status { + cache-supported: bool, + } + record s-command-request { + command: string, + command-type: string, + command-uuid: uuid, + request-id: string, + player-actor-unique-id: s64, + is-internal-source: bool, + version: string, + } + record s-container-close { + container-id: u8, + container-type: u8, + server-initiated: bool, + } + record s-interaction { + action: string, + target-runtime-id: string, + position: option>, + } + record s-loading-screen { + status: s32, + id: option, + } + record s-login { + protocol-version: s32, + jwt: list, + raw-token: list, + } + record s-modal-form-response { + form-id: s32, + form-data: option, + } + record s-player-action { + runtime-id: s32, + action: string, + block-pos: tuple, + result-pos: tuple, + face: s32, + } + record s-player-auth-input { + pitch: f32, + yaw: f32, + position: tuple, + move-vec: string, + head-yaw: f32, + input-data: string, + input-mode: s32, + play-mode: s32, + interaction-model: s32, + interact-pitch: f32, + interact-yaw: f32, + tick: string, + delta: tuple, + block-actions: option>, + vehicle-rotation: option, + vehicle-unique-id: option, + analog-move: string, + camera-orientation: tuple, + raw-move: string, + } + record s-connected-ping { + time: s64, + } + record s-connection-request { + client-guid: s64, + time: s64, + security: bool, + } + record s-new-incoming-connection { + server-address: string, + internal-address: string, + ping-time: s64, + pong-time: s64, + } + record s-open-connection-request1 { + magic: string, + protocol-version: u8, + mtu: s32, + } + record s-open-connection-request2 { + magic: string, + server-address: string, + mtu: s32, + client-guid: s64, + } + record s-unconnected-ping { + time: s64, + magic: string, + client-guid: s64, + } + record s-request-chunk-radius { + chunk-radius: s32, + max-radius: u8, + } + record s-request-network-settings { + protocol-version: s32, + } + record s-resource-pack-response { + response: u8, + download-size: s32, + } + record s-set-local-player-as-initialized { + runtime-entity-id: string, + } + record s-text { + needs-translation: bool, + r-type: string, + source-name: string, + message: string, + parameters: list, + xuid: string, + platform-chat-id: string, + filtered-message: option, + } + record c-available-commands { + enum-values: list, + chained-subcommand-values: list, + suffixes: list, + enums: list, + chained-subcommands: list, + commands: list, + soft-enums: list, + constraints: list, + } + record c-chunk-radius-update { + chunk-radius: s32, + } + record c-container-open { + container-id: u8, + container-type: u8, + position: tuple, + target-entity-id: string, + } + record c-correct-player-move { + prediction-type: u8, + pos: tuple, + pos-delta: tuple, + on-ground: bool, + tick: string, + } + record creative-content { + groups: list, + entries: list, + } + record c-disconnect-player { + reason: s32, + skip-message: bool, + message: string, + filtered-message: string, + } + record c-gamerules-changed { + rule-data: string, + } + record c-handshake { + jwt-data: string, + } + record c-inventory-content { + inventory-id: s32, + slots: list, + container-name: u8, + dynamic-id: option, + storage-item: string, + } + record c-level-chunk { + dimension: s32, + cache-enabled: bool, + chunk: string, + } + record c-level-event { + event-id: s32, + position: tuple, + data: s32, + } + record c-modal-form-request { + form-id: s32, + form-data: string, + } + record c-move-player { + player-runtime-id: string, + position: tuple, + pitch: f32, + yaw: f32, + head-yaw: f32, + mode: u8, + on-ground: bool, + riding-runtime-id: string, + tick: string, + } + record c-network-chunk-publisher-update { + pos-for-view: tuple, + new-radius: s32, + server-build-chunk-list: list, + } + record c-network-settings { + compression-threshold: s32, + compression-method: s32, + client-throttle-enabled: bool, + client-throttle-threshold: u8, + client-throttle-scalar: f32, + } + record c-player-hotbar { + selected-slot: s32, + container-id: u8, + should-select-block: bool, + } + record c-connected-pong { + ping: s64, + pong: s64, + } + record c-connection-request-accepted { + client-address: string, + system-index: s32, + system-addresses: string, + requested-timestamp: s64, + timestamp: s64, + } + record c-incompatible-protocol-version { + protocol-version: u8, + magic: string, + server-guid: s64, + } + record c-open-connection-reply1 { + magic: string, + server-guid: s64, + has-server-security: bool, + mtu: s32, + } + record c-open-connection-reply2 { + magic: string, + server-guid: s64, + client-address: string, + mtu: s32, + security: bool, + } + record c-unconnected-pong { + time: s64, + server-guid: s64, + magic: string, + server-id: string, + } + record c-resource-pack-stack-packet { + resource-pack-required: bool, + resource-packs: list, + game-version: string, + experiments: string, + include-editor-packs: bool, + } + record c-resource-packs-info { + resource-pack-required: bool, + has-addon-packs: bool, + has-scripts: bool, + is-vibrant-visuals-force-disabled: bool, + world-template-id: uuid, + world-template-version: string, + resource-packs: list, + } + record c-set-actor-data { + actor-runtime-id: string, + metadata: string, + synced-properties: string, + tick: string, + } + record c-set-actor-motion { + target-runtime-id: string, + motion: tuple, + tick: string, + } + record c-set-health { + health: s32, + } + record c-set-player-gamemode { + gamemode: string, + } + record c-set-time { + time: s32, + } + record c-set-title { + action-type: s32, + text: string, + fade-in-duration: s32, + remain-duration: s32, + fade-out-duration: s32, + xuid: string, + platform-online-id: string, + filtered-message: string, + } + record c-start-game { + entity-id: string, + runtime-entity-id: string, + player-gamemode: string, + position: tuple, + pitch: f32, + yaw: f32, + level-settings: string, + level-id: string, + level-name: string, + premium-world-template-id: string, + is-trial: bool, + rewind-history-size: s32, + server-authoritative-block-breaking: bool, + current-level-time: s64, + enchantment-seed: s32, + block-properties-size: s32, + multiplayer-correlation-id: string, + enable-itemstack-net-manager: bool, + server-version: string, + compound-id: u8, + compound-len: s32, + compound-end: u8, + block-registry-checksum: s64, + world-template-id: uuid, + enable-clientside-generation: bool, + blocknetwork-ids-are-hashed: bool, + server-auth-sounds: bool, + server-join-information: option, + telemetry: string, + } + record c-update-abilities { + target-player-raw-id: s64, + player-permission: u8, + command-permission: u8, + layers: list, + } + record c-update-attributes { + runtime-id: string, + attributes: list, + player-tick: string, + } + variant serverbound-packet { + s-animate(s-animate), + s-client-cache-status(s-client-cache-status), + s-command-request(s-command-request), + s-container-close(s-container-close), + s-interaction(s-interaction), + s-loading-screen(s-loading-screen), + s-login(s-login), + s-modal-form-response(s-modal-form-response), + s-player-action(s-player-action), + s-player-auth-input(s-player-auth-input), + s-connected-ping(s-connected-ping), + s-connection-request(s-connection-request), + s-new-incoming-connection(s-new-incoming-connection), + s-disconnect, + s-open-connection-request1(s-open-connection-request1), + s-open-connection-request2(s-open-connection-request2), + s-unconnected-ping(s-unconnected-ping), + s-request-chunk-radius(s-request-chunk-radius), + s-request-network-settings(s-request-network-settings), + s-resource-pack-response(s-resource-pack-response), + s-set-local-player-as-initialized(s-set-local-player-as-initialized), + s-text(s-text), + } + variant clientbound-packet { + c-available-commands(c-available-commands), + c-chunk-radius-update(c-chunk-radius-update), + c-container-open(c-container-open), + c-correct-player-move(c-correct-player-move), + creative-content(creative-content), + c-disconnect-player(c-disconnect-player), + c-gamerules-changed(c-gamerules-changed), + c-handshake(c-handshake), + c-inventory-content(c-inventory-content), + c-level-chunk(c-level-chunk), + c-level-event(c-level-event), + c-modal-form-request(c-modal-form-request), + c-move-player(c-move-player), + c-network-chunk-publisher-update(c-network-chunk-publisher-update), + c-network-settings(c-network-settings), + c-player-hotbar(c-player-hotbar), + c-connected-pong(c-connected-pong), + c-connection-request-accepted(c-connection-request-accepted), + c-incompatible-protocol-version(c-incompatible-protocol-version), + c-open-connection-reply1(c-open-connection-reply1), + c-open-connection-reply2(c-open-connection-reply2), + c-unconnected-pong(c-unconnected-pong), + c-resource-pack-stack-packet(c-resource-pack-stack-packet), + c-resource-packs-info(c-resource-packs-info), + c-set-actor-data(c-set-actor-data), + c-set-actor-motion(c-set-actor-motion), + c-set-health(c-set-health), + c-set-player-gamemode(c-set-player-gamemode), + c-set-time(c-set-time), + c-set-title(c-set-title), + c-start-game(c-start-game), + c-update-abilities(c-update-abilities), + c-update-attributes(c-update-attributes), + } +} diff --git a/v0.1/biomes.wit b/v0.1/biomes.wit new file mode 100644 index 0000000..fb972c9 --- /dev/null +++ b/v0.1/biomes.wit @@ -0,0 +1,71 @@ +package pumpkin:plugin@0.1.0; + +interface biomes { + enum biome { + badlands, + bamboo-jungle, + basalt-deltas, + beach, + birch-forest, + cherry-grove, + cold-ocean, + crimson-forest, + dark-forest, + deep-cold-ocean, + deep-dark, + deep-frozen-ocean, + deep-lukewarm-ocean, + deep-ocean, + desert, + dripstone-caves, + end-barrens, + end-highlands, + end-midlands, + eroded-badlands, + flower-forest, + forest, + frozen-ocean, + frozen-peaks, + frozen-river, + grove, + ice-spikes, + jagged-peaks, + jungle, + lukewarm-ocean, + lush-caves, + mangrove-swamp, + meadow, + mushroom-fields, + nether-wastes, + ocean, + old-growth-birch-forest, + old-growth-pine-taiga, + old-growth-spruce-taiga, + pale-garden, + plains, + river, + savanna, + savanna-plateau, + small-end-islands, + snowy-beach, + snowy-plains, + snowy-slopes, + snowy-taiga, + soul-sand-valley, + sparse-jungle, + stony-peaks, + stony-shore, + sunflower-plains, + swamp, + taiga, + the-end, + the-void, + warm-ocean, + warped-forest, + windswept-forest, + windswept-gravelly-hills, + windswept-hills, + windswept-savanna, + wooded-badlands, + } +} diff --git a/v0.1/block-entity.wit b/v0.1/block-entity.wit new file mode 100644 index 0000000..4a38087 --- /dev/null +++ b/v0.1/block-entity.wit @@ -0,0 +1,84 @@ +interface block-entity { + use common.{block-pos}; + + resource block-entity { + resource-location: func() -> string; + get-position: func() -> block-pos; + get-id: func() -> u32; + is-dirty: func() -> bool; + clear-dirty: func(); + } + + resource command-block-entity { + get-block-entity: func () -> block-entity; + last-output: func() -> string; + track-output: func() -> bool; + success-count: func() -> u32; + command: func() -> string; + auto: func() -> bool; + condition-met: func() -> bool; + powered: func() -> bool; + } + + enum dye-color { + white, + orange, + magenta, + light-blue, + yellow, + lime, + pink, + gray, + light-gray, + cyan, + purple, + blue, + brown, + green, + red, + black, + } + + record sign-text { + messages: list, + color: dye-color, + has-glowing-text: bool, + } + + resource sign-block-entity { + get-block-entity: func() -> block-entity; + get-front-text: func() -> sign-text; + set-front-text: func(text: sign-text); + get-back-text: func() -> sign-text; + set-back-text: func(text: sign-text); + is-waxed: func() -> bool; + set-waxed: func(waxed: bool); + } + + resource jukebox-block-entity { + get-block-entity: func() -> block-entity; + is-playing: func() -> bool; + stop-playing: func(); + start-playing: func(length-in-ticks: u64); + } + + resource chest-block-entity { + get-block-entity: func() -> block-entity; + viewer-count: func() -> u32; + } + + resource mob-spawner-block-entity { + get-block-entity: func() -> block-entity; + get-spawn-count: func() -> s32; + get-spawn-range: func() -> s32; + get-delay: func() -> s32; + } + + variant block-entity-type { + command-block-entity(command-block-entity), + sign-block-entity(sign-block-entity), + jukebox-block-entity(jukebox-block-entity), + chest-block-entity(chest-block-entity), + mob-spawner-block-entity(mob-spawner-block-entity), + } +} diff --git a/v0.1/boss-bar.wit b/v0.1/boss-bar.wit new file mode 100644 index 0000000..ea59509 --- /dev/null +++ b/v0.1/boss-bar.wit @@ -0,0 +1,83 @@ +interface boss-bar { + use text.{text-component}; + use player.{player}; + + + /// Represents the color of a boss bar. + enum boss-bar-color { + pink, + blue, + red, + green, + yellow, + purple, + white, + } + + /// Represents the notches/divisions of a boss bar. + enum boss-bar-division { + no-division, + notches-6, + notches-10, + notches-12, + notches-20, + } + + /// Metadata flags that can be toggled on a boss bar. + record boss-bar-metadata { + /// Darkens the sky for players who see the boss bar. + darken-sky: bool, + /// If true, the bar is considered a "dragon bar" (used for Ender Dragon). + dragon-bar: bool, + /// If true, fog is created around the players who see the boss bar. + create-fog: bool, + } + + /// Represents a boss bar that can be shown to players. + resource boss-bar { + /// Creates a new boss bar. + constructor(title: text-component, color: boss-bar-color, division: boss-bar-division); + + /// Returns the title of this boss bar. + get-title: func() -> text-component; + + /// Sets the title of this boss bar. + set-title: func(title: text-component); + + /// Returns the health (0.0 to 1.0) of this boss bar. + get-health: func() -> f32; + + /// Sets the health (0.0 to 1.0) of this boss bar. + set-health: func(health: f32); + + /// Returns the color of this boss bar. + get-color: func() -> boss-bar-color; + + /// Sets the color of this boss bar. + set-color: func(color: boss-bar-color); + + /// Returns the division of this boss bar. + get-division: func() -> boss-bar-division; + + /// Sets the division of this boss bar. + set-division: func(division: boss-bar-division); + + /// Returns the currently active metadata on this boss bar. + get-metadata: func() -> boss-bar-metadata; + + /// Updates the metadata on this boss bar. + set-metadata: func(metadata: boss-bar-metadata); + + /// Adds a player to this boss bar, making it visible to them. + add-player: func(player: player); + + /// Removes a player from this boss bar, hiding it from them. + remove-player: func(player: player); + + /// Returns a list of all players currently seeing this boss bar. + get-players: func() -> list; + + /// Removes this boss bar from all players and cleans it up. + remove-all: func(); + } +} diff --git a/v0.1/command.wit b/v0.1/command.wit new file mode 100644 index 0000000..7f071c2 --- /dev/null +++ b/v0.1/command.wit @@ -0,0 +1,224 @@ +interface command { + use %world.{%world, entity}; + use player.{player}; + use block-entity.{command-block-entity}; + use common.{position, block-pos, locale, game-mode}; + use item-stack.{item-stack}; + use server.{server, difficulty}; + use text.{text-component}; + + variant command-error { + invalid-consumption(option), + invalid-requirement, + permission-denied, + command-failed(text-component), + } + + resource command-node { + literal: static func(name: string) -> command-node; + argument: static func(name: string, %type: argument-type) -> command-node; + then: func(node: command-node); + execute-with-handler-id: func(handler-id: u32); + require-with-handler-id: func(handler-id: u32); + } + + variant argument-type { + %bool, + float(tuple, option>), + double(tuple, option>), + integer(tuple, option>), + long(tuple, option>), + %string(string-type), + entities, + entity, + players, + game-profile, + block-pos, + column-pos, + position3d, + position2d, + block-state, + block-predicate, + item, + item-predicate, + color, + component, + style, + message, + nbt-compound-tag, + nbt-tag, + nbt-path, + objective, + objective-criteria, + operation, + particle, + angle, + rotation, + scoreboard-slot, + score-holder(bool), + swizzle, + team, + item-slot, + resource-location, + mob-effect, + function, + entity-anchor, + int-range, + float-range, + dimension, + gamemode, + difficulty, + time(option), + %resource(string), + resource-or-tag(string), + resource-or-tag-key(string), + resource-key(string), + template-mirror, + template-rotation, + uuid, + } + + record entity-argument { + single: bool, + players-only: bool, + } + + variant command-sender-type { + rcon, + console, + player(player), + command-block(tuple), + dummy, + } + + enum permission-level { + zero, + one, + two, + three, + four, + } + + resource command-sender { + get-command-sender-type: func() -> command-sender-type; + get-name: func() -> string; + send-message: func(text: text-component); + send-system-message: func(text: text-component); + send-error: func(text: text-component); + set-success-count: func(count: s32); + is-player: func() -> bool; + is-console: func() -> bool; + as-player: func() -> option; + permission-level: func() -> permission-level; + has-permission-level: func(level: permission-level) -> bool; + has-permission: func(server: borrow, node: string) -> bool; + position: func() -> option; + %world: func() -> option<%world>; + get-locale: func() -> locale; + should-receive-feedback: func() -> bool; + should-broadcast-console-to-ops: func() -> bool; + should-track-output: func() -> bool; + } + + enum string-type { + single-word, + quotable, + greedy, + } + + enum suggestion-type { + ask-server, + all-recipes, + available-sounds, + available-biomes, + summonable-entities, + } + + variant arg { + simple(string), + msg(string), + %bool(bool), + item(string), + item-predicate(string), + resource-location(string), + block(string), + block-predicate(string), + time(s32), + num(result), + block-pos(block-pos), + pos3d(tuple), + pos2d(tuple), + rotation(tuple), + gamemode(game-mode), + difficulty(difficulty), + players(list), + particle(string), + text-component(text-component), + bossbar-color(bossbar-color), + bossbar-style(bossbar-style), + sound-category(sound-category), + damage-type(string), + effect(string), + enchantment(string), + entity-anchor(entity-anchor), + } + + enum bossbar-color { + pink, + blue, + red, + green, + yellow, + purple, + white, + } + + enum bossbar-style { + no-division, + notches6, + notches10, + notches12, + notches20, + } + + enum sound-category { + master, + music, + records, + weather, + blocks, + hostile, + neutral, + players, + ambient, + voice, + } + + enum entity-anchor { + eyes, + feet, + } + + variant number { + float64(f64), + float32(f32), + int32(s32), + int64(s64), + } + + variant not-in-bounds { + lower-bound(tuple), + upper-bound(tuple), + } + + resource consumed-args { + get-value: func(key: string) -> arg; + } + + resource command { + /// First name is primary, rest are aliases + constructor(names: list, description: string); + then: func(node: command-node); + execute-with-handler-id: func(handler-id: u32); + } +} diff --git a/v0.1/common.wit b/v0.1/common.wit new file mode 100644 index 0000000..282a219 --- /dev/null +++ b/v0.1/common.wit @@ -0,0 +1,233 @@ +/// Provides common types and utilities used across the entire plugin API. +interface common { + /// Serialized text component as a postcard byte array. + /// @deprecated Use the text-component resource from the text interface instead. + type raw-text-component = list; + + /// A position in the world grid (integers). + record block-pos { + x: s32, + y: s32, + z: s32, + } + + /// A precise coordinate in the world (floats). + type position = tuple; + + /// Represents the hands of a player. + enum hand { + left, + right, + } + + /// Represents the game modes available in Minecraft. + enum game-mode { + survival, + creative, + adventure, + spectator, + } + + /// The 16 base Minecraft colors. + enum named-color { + black, + dark-blue, + dark-green, + dark-aqua, + dark-red, + dark-purple, + gold, + gray, + dark-gray, + blue, + green, + aqua, + red, + light-purple, + yellow, + white, + } + + /// An RGB color represented by its red, green, and blue components. + record rgb-color { + r: u8, + g: u8, + b: u8, + } + + /// An ARGB color with alpha (transparency) channel. + record argb-color { + a: u8, + r: u8, + g: u8, + b: u8, + } + + /// Represents the type of click interaction in a GUI. + enum click-type { + left, + right, + shift-left, + shift-right, + middle, + drop, + control-drop, + double-click, + number-key, + unknown, + } + + /// Represents the various poses an entity can be in. + enum entity-pose { + standing, + fall-flying, + sleeping, + swimming, + spin-attack, + crouching, + long-jumping, + dying, + croaking, + using-tongue, + sitting, + roaring, + sniffing, + emerging, + digging, + sliding, + shooting, + inhaling, + } + + /// All Minecraft-supported locales. + enum locale { + af-za, + ar-sa, + ast-es, + az-az, + ba-ru, + bar, + be-by, + bg-bg, + br-fr, + brb, + bs-ba, + ca-es, + cs-cz, + cy-gb, + da-dk, + de-at, + de-ch, + de-de, + el-gr, + en-au, + en-ca, + en-gb, + en-nz, + en-pt, + en-ud, + en-us, + enp, + enws, + eo-uy, + es-ar, + es-cl, + es-ec, + es-es, + es-mx, + es-uy, + es-ve, + esan, + et-ee, + eu-es, + fa-ir, + fi-fi, + fil-ph, + fo-fo, + fr-ca, + fr-fr, + fra-de, + fur-it, + fy-nl, + ga-ie, + gd-gb, + gl-es, + haw-us, + he-il, + hi-in, + hr-hr, + hu-hu, + hy-am, + id-id, + ig-ng, + io-en, + is-is, + isv, + it-it, + ja-jp, + jbo-en, + ka-ge, + kk-kz, + kn-in, + ko-kr, + ksh, + kw-gb, + la-la, + lb-lu, + li-li, + lmo, + lo-la, + lol-us, + lt-lt, + lv-lv, + lzh, + mk-mk, + mn-mn, + ms-my, + mt-mt, + nah, + nds-de, + nl-be, + nl-nl, + nn-no, + no-no, + oc-fr, + ovd, + pl-pl, + pt-br, + pt-pt, + qya-aa, + ro-ro, + rpr, + ru-ru, + ry-ua, + sah-sah, + se-no, + sk-sk, + sl-si, + so-so, + sq-al, + sr-cs, + sr-sp, + sv-se, + sxu, + szl, + ta-in, + th-th, + tl-ph, + tlh-aa, + tok, + tr-tr, + tt-ru, + uk-ua, + val-es, + vec-it, + vi-vn, + yi-de, + yo-ng, + zh-cn, + zh-hk, + zh-tw, + zlm-arab, + } +} diff --git a/v0.1/context.wit b/v0.1/context.wit new file mode 100644 index 0000000..d702de6 --- /dev/null +++ b/v0.1/context.wit @@ -0,0 +1,33 @@ +/// The core context provided to a plugin during initialization and event handling. +interface context { + use server.{server}; + use event.{event-type, event-priority}; + use command.{command}; + use permission.{permission}; + + /// A contextual handle for plugin-related operations. + resource context { + /// Registers a handler for a specific event. + /// + /// * `handler-id`: Unique ID for the event handler. + /// * `event-type`: The type of event to listen for. + /// * `event-priority`: When this handler should be called relative to others. + /// * `blocking`: Whether the event should wait for this handler to finish. + register-event: func(handler-id: u32, event-type: event-type, event-priority: event-priority, blocking: bool); + + /// Registers a new command. + /// + /// * `command`: The command definition. + /// * `permission`: The required permission node to execute this command. + register-command: func(command: command, permission: string); + + /// Registers a permission node with the server. + register-permission: func(permission: permission) -> result<_, string>; + + /// Returns the path to the plugin's private data folder. + get-data-folder: func() -> string; + + /// Returns the global server instance. + get-server: func() -> server; + } +} diff --git a/v0.1/data-components.wit b/v0.1/data-components.wit new file mode 100644 index 0000000..cae754a --- /dev/null +++ b/v0.1/data-components.wit @@ -0,0 +1,116 @@ +package pumpkin:plugin@0.1.0; + +interface data-components { + enum data-component { + custom-data, + max-stack-size, + max-damage, + damage, + unbreakable, + use-effects, + custom-name, + minimum-attack-charge, + damage-type, + item-name, + item-model, + lore, + rarity, + enchantments, + can-place-on, + can-break, + attribute-modifiers, + custom-model-data, + tooltip-display, + repair-cost, + creative-slot-lock, + enchantment-glint-override, + intangible-projectile, + food, + consumable, + use-remainder, + use-cooldown, + damage-resistant, + tool, + weapon, + attack-range, + enchantable, + equippable, + repairable, + glider, + tooltip-style, + death-protection, + blocks-attacks, + piercing-weapon, + kinetic-weapon, + swing-animation, + additional-trade-cost, + stored-enchantments, + dye, + dyed-color, + map-color, + map-id, + map-decorations, + map-post-processing, + charged-projectiles, + bundle-contents, + potion-contents, + potion-duration-scale, + suspicious-stew-effects, + writable-book-content, + written-book-content, + trim, + debug-stick-state, + entity-data, + bucket-entity-data, + block-entity-data, + instrument, + provides-trim-material, + ominous-bottle-amplifier, + jukebox-playable, + provides-banner-patterns, + recipes, + lodestone-tracker, + firework-explosion, + fireworks, + profile, + note-block-sound, + banner-patterns, + base-color, + pot-decorations, + container, + block-state, + bees, + lock, + container-loot, + break-sound, + villager-variant, + wolf-variant, + wolf-sound-variant, + wolf-collar, + fox-variant, + salmon-size, + parrot-variant, + tropical-fish-pattern, + tropical-fish-base-color, + tropical-fish-pattern-color, + mooshroom-variant, + rabbit-variant, + pig-variant, + pig-sound-variant, + cow-variant, + cow-sound-variant, + chicken-variant, + chicken-sound-variant, + zombie-nautilus-variant, + frog-variant, + horse-variant, + painting-variant, + llama-variant, + axolotl-variant, + cat-variant, + cat-sound-variant, + cat-collar, + sheep-color, + shulker-color, + } +} diff --git a/v0.1/enchantments.wit b/v0.1/enchantments.wit new file mode 100644 index 0000000..21ab4c9 --- /dev/null +++ b/v0.1/enchantments.wit @@ -0,0 +1,49 @@ +package pumpkin:plugin@0.1.0; + +interface enchantments { + enum enchantment { + aqua-affinity, + bane-of-arthropods, + binding-curse, + blast-protection, + breach, + channeling, + density, + depth-strider, + efficiency, + feather-falling, + fire-aspect, + fire-protection, + flame, + fortune, + frost-walker, + impaling, + infinity, + knockback, + looting, + loyalty, + luck-of-the-sea, + lunge, + lure, + mending, + multishot, + piercing, + power, + projectile-protection, + protection, + punch, + quick-charge, + respiration, + riptide, + sharpness, + silk-touch, + smite, + soul-speed, + sweeping-edge, + swift-sneak, + thorns, + unbreaking, + vanishing-curse, + wind-burst, + } +} diff --git a/v0.1/entity-types.wit b/v0.1/entity-types.wit new file mode 100644 index 0000000..baf2e86 --- /dev/null +++ b/v0.1/entity-types.wit @@ -0,0 +1,163 @@ +package pumpkin:plugin@0.1.0; + +interface entity-types { + enum entity-type { + acacia-boat, + acacia-chest-boat, + allay, + area-effect-cloud, + armadillo, + armor-stand, + arrow, + axolotl, + bamboo-chest-raft, + bamboo-raft, + bat, + bee, + birch-boat, + birch-chest-boat, + blaze, + block-display, + bogged, + breeze, + breeze-wind-charge, + camel, + camel-husk, + cat, + cave-spider, + cherry-boat, + cherry-chest-boat, + chest-minecart, + chicken, + cod, + command-block-minecart, + copper-golem, + cow, + creaking, + creeper, + dark-oak-boat, + dark-oak-chest-boat, + dolphin, + donkey, + dragon-fireball, + drowned, + egg, + elder-guardian, + end-crystal, + ender-dragon, + ender-pearl, + enderman, + endermite, + evoker, + evoker-fangs, + experience-bottle, + experience-orb, + eye-of-ender, + falling-block, + fireball, + firework-rocket, + fishing-bobber, + fox, + frog, + furnace-minecart, + ghast, + giant, + glow-item-frame, + glow-squid, + goat, + guardian, + happy-ghast, + hoglin, + hopper-minecart, + horse, + husk, + illusioner, + interaction, + iron-golem, + item, + item-display, + item-frame, + jungle-boat, + jungle-chest-boat, + leash-knot, + lightning-bolt, + lingering-potion, + llama, + llama-spit, + magma-cube, + mangrove-boat, + mangrove-chest-boat, + mannequin, + marker, + minecart, + mooshroom, + mule, + nautilus, + oak-boat, + oak-chest-boat, + ocelot, + ominous-item-spawner, + painting, + pale-oak-boat, + pale-oak-chest-boat, + panda, + parched, + parrot, + phantom, + pig, + piglin, + piglin-brute, + pillager, + player, + polar-bear, + pufferfish, + rabbit, + ravager, + salmon, + sheep, + shulker, + shulker-bullet, + silverfish, + skeleton, + skeleton-horse, + slime, + small-fireball, + sniffer, + snow-golem, + snowball, + spawner-minecart, + spectral-arrow, + spider, + splash-potion, + spruce-boat, + spruce-chest-boat, + squid, + stray, + strider, + tadpole, + text-display, + tnt, + tnt-minecart, + trader-llama, + trident, + tropical-fish, + turtle, + vex, + villager, + vindicator, + wandering-trader, + warden, + wind-charge, + witch, + wither, + wither-skeleton, + wither-skull, + wolf, + zoglin, + zombie, + zombie-horse, + zombie-nautilus, + zombie-villager, + zombified-piglin, + } +} diff --git a/v0.1/entity.wit b/v0.1/entity.wit new file mode 100644 index 0000000..7cc21c5 --- /dev/null +++ b/v0.1/entity.wit @@ -0,0 +1 @@ +interface entity { use %world.{entity, raycast-result, block-direction}; } diff --git a/v0.1/event.wit b/v0.1/event.wit new file mode 100644 index 0000000..841d310 --- /dev/null +++ b/v0.1/event.wit @@ -0,0 +1,392 @@ +interface event { + use common.{block-pos, game-mode, hand, position, click-type}; + use item-stack.{item-stack}; + use player.{player}; + use text.{text-component}; + use %world.{%world}; + use java-packets.{serverbound-packet as java-serverbound-packet, clientbound-packet as java-clientbound-packet}; + use bedrock-packets.{serverbound-packet as bedrock-serverbound-packet, clientbound-packet as bedrock-clientbound-packet}; + use uuid.{uuid}; + + variant serverbound-packet { + java(java-serverbound-packet), + bedrock(bedrock-serverbound-packet), + } + + variant clientbound-packet { + java(java-clientbound-packet), + bedrock(bedrock-clientbound-packet), + } + + enum event-priority { + highest, + high, + normal, + low, + lowest, + } + + record player-join-event-data { + player: player, + join-message: text-component, + cancelled: bool + } + + record player-leave-event-data { + player: player, + leave-message: text-component, + cancelled: bool + } + + record player-login-event-data { + player: player, + kick-message: text-component, + cancelled: bool + } + + record player-chat-event-data { + player: player, + message: string, + recipients: list, + cancelled: bool + } + + record player-command-send-event-data { + player: player, + command: string, + cancelled: bool + } + + record player-permission-check-event-data { + player: player, + permission: string, + permission-result: bool + } + + record player-move-event-data { + player: player, + from-position: position, + to-position: position, + cancelled: bool + } + + record player-teleport-event-data { + player: player, + from-position: position, + to-position: position, + cancelled: bool + } + + record player-change-world-event-data { + player: player, + previous-world: %world, + new-world: %world, + position: position, + yaw: f32, + pitch: f32, + cancelled: bool + } + + record player-exp-change-event-data { + player: player, + amount: s32 + } + + record player-item-held-event-data { + player: player, + previous-slot: u8, + new-slot: u8, + cancelled: bool + } + + record player-changed-main-hand-event-data { + player: player, + main-hand: hand + } + + record player-gamemode-change-event-data { + player: player, + previous-gamemode: game-mode, + new-gamemode: game-mode, + cancelled: bool + } + + record player-custom-payload-event-data { + player: player, + channel: string, + data: list + } + + enum player-fish-state { + fishing, + caught-fish, + caught-entity, + in-ground, + failed-attempt, + reel-in, + bite, + } + + record player-fish-event-data { + player: player, + caught-uuid: option, + caught-type: string, + hook-uuid: uuid, + state: player-fish-state, + hand: hand, + exp-to-drop: s32, + cancelled: bool + } + + record player-egg-throw-event-data { + player: player, + egg-uuid: uuid, + hatching: bool, + num-hatches: u8, + hatching-type: string, + cancelled: bool + } + + enum entity-interaction-action { + interact, + attack, + interact-at, + } + + enum interact-action { + left-click-block, + left-click-air, + right-click-air, + right-click-block, + } + + record player-interact-event-data { + player: player, + action: interact-action, + clicked-pos: option, + block: string, + cancelled: bool + } + + record player-toggle-sneak-event-data { + player: player, + is-sneaking: bool, + cancelled: bool + } + + record player-toggle-flight-event-data { + player: player, + is-flying: bool, + cancelled: bool + } + + record player-toggle-sprint-event-data { + player: player, + is-sprinting: bool, + cancelled: bool + } + + record player-interact-unknown-entity-event-data { + player: player, + entity-id: s32, + action: entity-interaction-action, + cancelled: bool + } + + record inventory-click-event-data { + player: player, + window-type: option, + click-type: click-type, + slot: s16, + raw-slot: s16, + clicked-item: option, + cursor: option, + hotbar-button: s32, + cancelled: bool + } + + record inventory-close-event-data { + player: player, + window-type: option + } + + record block-redstone-event-data { + target-world: %world, + state-id: u16, + block-pos: block-pos, + old-current: s32, + new-current: s32, + cancelled: bool + } + + record block-break-event-data { + player: option, + block: string, + block-pos: block-pos, + exp: u32, + should-drop: bool, + cancelled: bool + } + + record block-burn-event-data { + igniting-block: string, + block: string, + cancelled: bool + } + + record block-can-build-event-data { + block-to-build: string, + buildable: bool, + player: player, + block: string, + cancelled: bool + } + + record block-grow-event-data { + target-world: %world, + old-block: string, + old-state-id: u16, + new-block: string, + new-state-id: u16, + block-pos: block-pos, + cancelled: bool + } + + record block-place-event-data { + player: player, + block-placed: string, + block-placed-against: string, + block-pos: block-pos, + can-build: bool, + cancelled: bool + } + + record bedrock-form-response-event-data { + player: player, + form-id: u32, + response-data: option, + } + + record custom-click-action-event-data { + player: player, + id: string, + payload: option>, + } + + record server-command-event-data { + command: string, + cancelled: bool + } + + record spawn-change-event-data { + target-world: %world, + previous-position: block-pos, + previous-yaw: f32, + previous-pitch: f32, + new-position: block-pos, + new-yaw: f32, + new-pitch: f32 + } + + record server-broadcast-event-data { + message: text-component, + sender: text-component, + cancelled: bool + } + + record server-tick-start-event-data { + tick: s32 + } + + record packet-received-event-data { + player: player, + packet: serverbound-packet, + cancelled: bool + } + + record packet-sent-event-data { + player: player, + packet: clientbound-packet, + cancelled: bool + } + + enum event-type { + player-join-event, + player-leave-event, + player-login-event, + player-chat-event, + player-command-send-event, + player-permission-check-event, + player-move-event, + player-teleport-event, + player-change-world-event, + player-exp-change-event, + player-item-held-event, + player-changed-main-hand-event, + player-gamemode-change-event, + player-custom-payload-event, + player-fish-event, + player-egg-throw-event, + player-interact-unknown-entity-event, + player-interact-event, + player-toggle-sneak-event, + player-toggle-flight-event, + player-toggle-sprint-event, + inventory-click-event, + inventory-close-event, + block-redstone-event, + block-break-event, + block-burn-event, + block-can-build-event, + block-grow-event, + block-place-event, + bedrock-form-response-event, + custom-click-action-event, + server-command-event, + spawn-change-event, + server-broadcast-event, + server-tick-start-event, + packet-received-event, + packet-sent-event, + } + + variant event { + player-join-event(player-join-event-data), + player-leave-event(player-leave-event-data), + player-login-event(player-login-event-data), + player-chat-event(player-chat-event-data), + player-command-send-event(player-command-send-event-data), + player-permission-check-event(player-permission-check-event-data), + player-move-event(player-move-event-data), + player-teleport-event(player-teleport-event-data), + player-change-world-event(player-change-world-event-data), + player-exp-change-event(player-exp-change-event-data), + player-item-held-event(player-item-held-event-data), + player-changed-main-hand-event(player-changed-main-hand-event-data), + player-gamemode-change-event(player-gamemode-change-event-data), + player-custom-payload-event(player-custom-payload-event-data), + player-fish-event(player-fish-event-data), + player-egg-throw-event(player-egg-throw-event-data), + player-interact-unknown-entity-event(player-interact-unknown-entity-event-data), + player-interact-event(player-interact-event-data), + player-toggle-sneak-event(player-toggle-sneak-event-data), + player-toggle-flight-event(player-toggle-flight-event-data), + player-toggle-sprint-event(player-toggle-sprint-event-data), + inventory-click-event(inventory-click-event-data), + inventory-close-event(inventory-close-event-data), + block-redstone-event(block-redstone-event-data), + block-break-event(block-break-event-data), + block-burn-event(block-burn-event-data), + block-can-build-event(block-can-build-event-data), + block-grow-event(block-grow-event-data), + block-place-event(block-place-event-data), + bedrock-form-response-event(bedrock-form-response-event-data), + custom-click-action-event(custom-click-action-event-data), + server-command-event(server-command-event-data), + spawn-change-event(spawn-change-event-data), + server-broadcast-event(server-broadcast-event-data), + server-tick-start-event(server-tick-start-event-data), + packet-received-event(packet-received-event-data), + packet-sent-event(packet-sent-event-data), + } +} diff --git a/v0.1/forms.wit b/v0.1/forms.wit new file mode 100644 index 0000000..c428155 --- /dev/null +++ b/v0.1/forms.wit @@ -0,0 +1,51 @@ +interface forms { + use text.{text-component}; + + enum image-type { + url, + path, + } + + record form-image { + %type: image-type, + data: string, + } + + record simple-form-button { + text: text-component, + image: option, + } + + record simple-form { + title: text-component, + content: text-component, + buttons: list, + } + + record modal-form { + title: text-component, + content: text-component, + button1: text-component, + button2: text-component, + } + + variant custom-form-element { + label(text-component), + toggle(tuple), + slider(tuple), // text, min, max, step, default + step-slider(tuple, u32>), // text, steps, default + dropdown(tuple, u32>), // text, options, default + input(tuple), // text, placeholder, default + } + + record custom-form { + title: text-component, + elements: list, + } + + variant form { + simple(simple-form), + modal(modal-form), + custom(custom-form), + } +} diff --git a/v0.1/gui.wit b/v0.1/gui.wit new file mode 100644 index 0000000..7e3cc4d --- /dev/null +++ b/v0.1/gui.wit @@ -0,0 +1,63 @@ +interface gui { + use text.{text-component}; + use common.{click-type}; + use item-stack.{item-stack}; + + enum gui-type { + generic-9x1, + generic-9x2, + generic-9x3, + generic-9x4, + generic-9x5, + generic-9x6, + generic-3x3, + crafter-3x3, + anvil, + beacon, + blast-furnace, + brewing-stand, + crafting, + enchantment, + furnace, + grindstone, + hopper, + lectern, + loom, + merchant, + shulker-box, + smithing, + smoker, + cartography-table, + stonecutter, + } + + resource gui { + constructor(%type: gui-type, title: text-component); + set-item: func(slot: u32, item: item-stack); + get-item: func(slot: u32) -> option; + + /// Returns the type of this GUI. + get-type: func() -> gui-type; + + /// Returns the title of this GUI. + get-title: func() -> text-component; + + /// Returns the number of slots in this GUI. + get-size: func() -> u32; + + /// Clears all items from the GUI. + clear-items: func(); + + /// Sets whether players can grab items out of the inventory. + set-allow-grab-items: func(allow: bool); + + /// Returns whether players can grab items out of the inventory. + get-allow-grab-items: func() -> bool; + + /// Sets whether players can put items into the inventory from their own. + set-allow-put-items: func(allow: bool); + + /// Returns whether players can put items into the inventory from their own. + get-allow-put-items: func() -> bool; + } +} diff --git a/v0.1/i18n.wit b/v0.1/i18n.wit new file mode 100644 index 0000000..2d75074 --- /dev/null +++ b/v0.1/i18n.wit @@ -0,0 +1,21 @@ +interface i18n { + use common.{locale}; + + /// Retrieves a translated string from the host. + /// + /// # Arguments + /// * `key`: The namespaced translation key (e.g. `pumpkin:my_key`). + /// * `locale`: The target locale. + /// + /// # Returns + /// The localized string, falling back to English or the key itself. + translate: func(key: string, locale: locale) -> string; + + /// Loads custom translations from a JSON string. + /// + /// # Arguments + /// * `namespace`: The namespace to associate these keys with. + /// * `json`: A JSON string containing a flat map of translations. + /// * `locale`: The target locale for these translations. + load-translations: func(namespace: string, json: string, locale: locale); +} diff --git a/v0.1/item-stack.wit b/v0.1/item-stack.wit new file mode 100644 index 0000000..eccadff --- /dev/null +++ b/v0.1/item-stack.wit @@ -0,0 +1,59 @@ +interface item-stack { + use data-components.{data-component}; + use enchantments.{enchantment}; + use text.{text-component}; + + /// Represents an enchantment and its level. + record enchantment-value { + enchantment: enchantment, + level: u32, + } + + /// Represents a data component and its serialized value. + record data-component-value { + component: data-component, + /// The serialized value of the component. + value: list, + } + + resource item-stack { + constructor(registry-key: string, count: u8); + + /// Returns the unique registry key of the item (e.g., "minecraft:diamond"). + get-registry-key: func() -> string; + + /// Returns the number of items in the stack. + get-count: func() -> u8; + /// Sets the number of items in the stack. + set-count: func(count: u8); + + /// Returns the maximum number of items that can be in this stack. + get-max-count: func() -> u8; + + /// Returns all enchantments on this item stack. + get-enchantments: func() -> list; + /// Adds an enchantment to this item stack. + add-enchantment: func(enchantment: enchantment, level: u32); + /// Removes an enchantment from this item stack. + remove-enchantment: func(enchantment: enchantment); + + /// Returns the lore of this item stack. + get-lore: func() -> list; + /// Sets the lore of this item stack. + set-lore: func(lore: list); + /// Adds a line to the lore of this item stack. + add-lore: func(line: text-component); + + /// Returns the custom name of this item stack, if set. + get-custom-name: func() -> option; + /// Sets the custom name of this item stack. + set-custom-name: func(name: option); + + /// Returns all data components on this item stack. + get-components: func() -> list; + /// Sets a data component on this item stack. + set-component: func(component: data-component, value: list); + /// Removes a data component from this item stack. + remove-component: func(component: data-component); + } +} diff --git a/v0.1/java-dialogs.wit b/v0.1/java-dialogs.wit new file mode 100644 index 0000000..2c93e75 --- /dev/null +++ b/v0.1/java-dialogs.wit @@ -0,0 +1,155 @@ +/// Provides types and utilities for displaying rich dialogs to Java Edition players. +/// These dialogs support various layouts, body elements (text and items), +/// and interactive inputs (checkboxes, text fields, sliders). +interface java-dialogs { + use text.{text-component}; + use item-stack.{item-stack}; + + /// Represents the layout and button configuration of a dialog. + enum dialog-type { + /// A simple dialog with a single "OK" button. + notice, + /// A dialog with "Yes" and "No" buttons. + confirmation, + /// A scrollable list of custom buttons. + multi-action, + /// A list of buttons that open other registered dialogs. + dialog-list, + /// A dedicated menu for displaying server-related links. + server-links, + } + + /// Represents an element in the main content area of a dialog. + variant dialog-body { + /// A simple text message. + plain-message(text-component), + /// A visual item display. + item(item-stack), + } + + /// Represents an interactive input control in a dialog. + variant dialog-input { + /// A checkbox for true/false states. + %bool(dialog-input-bool), + /// A simple string input field. + %text(dialog-input-text), + /// A slider for numerical input within a range. + number-range(dialog-input-number-range), + /// A multiple-choice selection button. + single-option(dialog-input-single-option), + } + + /// A checkbox input control. + record dialog-input-bool { + label: text-component, + default-value: bool, + } + + /// A text field input control. + record dialog-input-text { + label: text-component, + placeholder: text-component, + default-value: string, + } + + /// A numerical range slider input control. + record dialog-input-number-range { + label: text-component, + min-value: f32, + max-value: f32, + initial-value: f32, + step: f32, + label-format: option, + } + + /// A multiple-choice selection input control. + record dialog-input-single-option { + label: text-component, + options: list, + initial-index: u32, + } + + /// Defines what happens after a dialog is closed. + enum after-action { + /// Returns the player to the previous screen (e.g., keeping an inventory open). + peek, + /// Closes all open screens. + pop, + } + + /// Represents a clickable button in a dialog. + record action-button { + text: text-component, + tooltip: option, + width: option, + action: action, + } + + /// Represents an action triggered by a button click. + variant action { + /// Opens an external URL. + open-url(string), + /// Triggers a custom server-side callback with an ID and optional payload. + custom-click(custom-click-action), + } + + /// Represents a custom server-side action. + record custom-click-action { + /// A unique identifier for the action (sent back to the server). + id: string, + /// Optional binary data to send with the action. + payload: option>, + } + + /// Represents a link displayed in a Java Edition dialog. + record link { + /// The label to display for the link. + label: link-label, + /// The URL the link points to. + url: string, + } + + /// The label for a link, which can be a built-in type or custom text. + variant link-label { + /// A built-in link type with a predefined icon/label. + built-in(link-type), + /// A custom text component label. + custom(text-component), + } + + /// Built-in link types recognized by the Java Edition client. + enum link-type { + bug-report, + community-guidelines, + support, + status, + feedback, + community, + website, + forums, + news, + announcements, + } + + /// Represents a dialog shown to a Java Edition player. + record dialog { + /// The main title of the dialog. + title: text-component, + /// The layout type of the dialog. + %type: dialog-type, + /// A list of body elements to display in the main area. + body: list, + /// A list of interactive input controls. + inputs: list, + /// A list of clickable buttons (for multi-action and other types). + buttons: list, + /// A list of links (primarily for server-links type). + links: list, + /// What to do after the dialog is closed. + after-action: option, + /// Whether the player can exit the dialog using the Esc key. + can-close-with-escape: bool, + /// The text shown on buttons that link to/open this dialog. + external-title: option, + } +} diff --git a/v0.1/java-packets.wit b/v0.1/java-packets.wit new file mode 100644 index 0000000..b5ff497 --- /dev/null +++ b/v0.1/java-packets.wit @@ -0,0 +1,864 @@ +package pumpkin:plugin@0.1.0; + +interface java-packets { + use uuid.{ uuid }; + record s-attack { + entity-id: s32, + } + record s-change-game-mode { + game-mode: string, + } + record s-chat-command { + command: string, + } + record s-chat-message { + message: string, + timestamp: s64, + salt: s64, + signature: option>>, + message-count: s32, + acknowledged: list>, + checksum: u8, + } + record s-chunk-batch { + chunks-per-tick: f32, + } + record s-click-slot { + sync-id: s32, + revision: s32, + slot: s32, + button: u8, + mode: string, + length-of-array: s32, + array-of-changed-slots: list, + carried-item: string, + } + record s-client-command { + action-id: s32, + } + record s-client-information-play { + locale: string, + view-distance: u8, + chat-mode: s32, + chat-colors: bool, + skin-parts: u8, + main-hand: s32, + text-filtering: bool, + server-listing: bool, + } + record s-close-container { + window-id: s32, + } + record s-command-suggestion { + id: s32, + command: string, + } + record s-confirm-teleport { + teleport-id: s32, + } + record s-container-button-click { + window-id: s32, + button-id: s32, + } + record s-cookie-response { + key: string, + payload: option>>, + } + record s-custom-click-action { + action-id: string, + payload: option>>, + } + record s-custom-payload { + channel: string, + data: list>, + } + record s-interact { + entity-id: s32, + r-type: s32, + target-position: option>, + hand: option, + sneaking: bool, + } + record s-keep-alive { + keep-alive-id: s64, + } + record s-move-vehicle { + x: f64, + y: f64, + z: f64, + yaw: f32, + pitch: f32, + } + record s-paddle-boat { + left-paddle: bool, + right-paddle: bool, + } + record s-pick-item-from-block { + pos: tuple, + include-data: bool, + } + record s-pick-item-from-entity { + id: s32, + include-data: bool, + } + record s-play-ping-request { + payload: s64, + } + record s-place-recipe { + container-id: u8, + recipe-display-id: s32, + use-max-items: bool, + } + record s-player-abilities { + %flags: u8, + } + record s-player-action { + status: s32, + position: tuple, + face: u8, + sequence: s32, + } + record s-player-command { + entity-id: s32, + action: string, + jump-boost: s32, + } + record s-set-player-ground { + on-ground: bool, + } + record s-player-input { + input: u8, + } + record s-player-position { + position: tuple, + collision: u8, + } + record s-player-position-rotation { + position: tuple, + yaw: f32, + pitch: f32, + collision: u8, + } + record s-player-rotation { + yaw: f32, + pitch: f32, + ground: bool, + } + record s-player-session { + session-id: uuid, + expires-at: s64, + public-key: list>, + key-signature: list>, + } + record s-recipe-book-change-settings { + book-type: s32, + is-open: bool, + is-filtering: bool, + } + record s-recipe-book-seen-recipe { + recipe-display-id: s32, + } + record s-rename-item { + item-name: string, + } + record s-select-trade { + selected-slot: s32, + } + record s-set-beacon { + primary-effect: option, + secondary-effect: option, + } + record s-set-command-block { + pos: tuple, + command: string, + mode: s32, + %flags: u8, + } + record s-set-creative-slot { + slot: s32, + clicked-item: string, + } + record s-set-held-item { + slot: s32, + } + record s-swing-arm { + hand: s32, + } + record s-update-sign { + location: tuple, + is-front-text: bool, + line-1: string, + line-2: string, + line-3: string, + line-4: string, + } + record s-use-item { + hand: s32, + sequence: s32, + yaw: f32, + pitch: f32, + } + record s-use-item-on { + hand: s32, + position: tuple, + face: s32, + cursor-pos: tuple, + inside-block: bool, + is-against-world-border: bool, + sequence: s32, + } + record c-acknowledge-block-change { + sequence-id: s32, + } + record c-action-bar { + action-bar: string, + } + record c-set-block-destroy-stage { + entity-id: s32, + location: tuple, + destroy-stage: u8, + } + record c-block-entity-data { + location: tuple, + r-type: s32, + nbt-data: list>, + } + record c-block-event { + location: tuple, + action-id: u8, + action-parameter: u8, + block-type: s32, + } + record c-block-update { + location: tuple, + state-id: s32, + } + record c-boss-event { + uuid: uuid, + action: string, + } + record c-center-chunk { + chunk-x: s32, + chunk-z: s32, + } + record c-change-difficulty { + difficulty: u8, + locked: bool, + } + record c-chunk-batch-end { + batch-size: s32, + } + record c-clear-title { + reset: bool, + } + record c-close-container { + sync-id: s32, + } + record c-combat-death { + player-id: s32, + message: string, + } + record c-command-suggestions { + id: s32, + start: s32, + length: s32, + matches: list>, + } + record c-commands { + nodes: list>, + root-node-index: s32, + } + record c-play-cookie-request { + key: string, + } + record c-custom-payload { + channel: string, + data: list, + } + record c-damage-event { + entity-id: s32, + source-type-id: s32, + source-cause-id: s32, + source-direct-id: s32, + source-position: option>, + } + record c-play-disconnect { + reason: string, + } + record c-disguised-chat-message { + message: string, + chat-type: s32, + sender-name: string, + target-name: option, + } + record c-display-objective { + position: s32, + score-name: string, + } + record c-entity-animation { + entity-id: s32, + animation: u8, + } + record c-set-entity-metadata { + entity-id: s32, + metadata: list>, + } + record c-entity-position-sync { + entity-id: s32, + position: tuple, + delta: tuple, + yaw: f32, + pitch: f32, + on-ground: bool, + } + record c-entity-sound-effect { + sound-event: string, + sound-category: s32, + entity-id: s32, + volume: f32, + pitch: f32, + seed: s64, + } + record c-entity-status { + entity-id: s32, + entity-status: u8, + } + record c-entity-velocity { + entity-id: s32, + velocity: string, + } + record c-explosion { + center: tuple, + radius: f32, + block-count: s32, + knockback: option>, + particle: s32, + sound: string, + block-particles-pool-size: s32, + } + record c-game-event { + event: u8, + value: f32, + } + record c-head-rot { + entity-id: s32, + head-yaw: u8, + } + record c-hurt-animation { + entity-id: s32, + yaw: f32, + } + record c-initialize-world-border { + x: f64, + z: f64, + old-diameter: f64, + new-diameter: f64, + speed: string, + portal-teleport-boundary: s32, + warning-blocks: s32, + warning-time: s32, + } + record c-item-cooldown { + group: string, + cooldown: s32, + } + record c-keep-alive { + keep-alive-id: s64, + } + record c-level-event { + event: s32, + location: tuple, + data: s32, + disable-relative-volume: bool, + } + record c-login { + entity-id: s32, + is-hardcore: bool, + dimension-names: list, + max-players: s32, + view-distance: s32, + simulated-distance: s32, + reduced-debug-info: bool, + enabled-respawn-screen: bool, + limited-crafting: bool, + dimension: string, + hashed-seed: s64, + game-mode: u8, + previous-gamemode: u8, + debug: bool, + is-flat: bool, + death-dimension-name: option, + portal-cooldown: s32, + sealevel: s32, + enforce-secure-chat: bool, + } + record c-map-item-data { + map-id: s32, + scale: u8, + locked: bool, + icons: option>, + data: option, + } + record c-merchant-offers { + window-id: s32, + offers: list, + villager-level: s32, + experience: s32, + is-regular-villager: bool, + can-restock: bool, + } + record c-multi-block-update { + chunk-section: s64, + updates: list, + } + record c-open-screen { + sync-id: s32, + window-type: s32, + window-title: string, + } + record c-open-sign-editor { + location: tuple, + is-front-text: bool, + } + record c-particle { + force-spawn: bool, + important: bool, + position: tuple, + offset: tuple, + max-speed: f32, + particle-count: s32, + particle-id: s32, + data: list, + } + record c-ping-response { + payload: s64, + } + record c-player-abilities { + %flags: u8, + flying-speed: f32, + field-of-view: f32, + } + record c-player-chat-message { + global-index: s32, + sender: uuid, + index: s32, + message-signature: option>>, + message: string, + timestamp: s64, + salt: s64, + previous-messages: list>, + unsigned-content: option, + filter-type: string, + chat-type: s32, + sender-name: string, + target-name: option, + } + record c-player-info-update { + actions: u8, + players: list, + } + record c-player-position { + teleport-id: s32, + position: tuple, + delta: tuple, + yaw: f32, + pitch: f32, + relatives: list, + } + record c-remove-player-info { + players: list, + } + record c-player-spawn-position { + dimension-name: string, + location: tuple, + yaw: f32, + pitch: f32, + } + record c-recipe-book-add { + replace: bool, + } + record c-recipe-book-settings { + crafting-open: bool, + crafting-filtering: bool, + furnace-open: bool, + furnace-filtering: bool, + blast-furnace-open: bool, + blast-furnace-filtering: bool, + smoker-open: bool, + smoker-filtering: bool, + } + record c-remove-entities { + entity-ids: list, + } + record c-remove-mob-effect { + entity-id: s32, + effect-id: s32, + } + record c-reset-score { + entity-name: string, + objective-name: option, + } + record c-respawn { + dimension-type: s32, + dimension-name: string, + hashed-seed: s64, + game-mode: u8, + previous-gamemode: u8, + debug: bool, + is-flat: bool, + death-dimension-name: option, + portal-cooldown: s32, + sealevel: s32, + data-kept: u8, + } + record c-play-server-links { + links: list, + } + record c-set-border-center { + x: f64, + z: f64, + } + record c-set-border-lerp-size { + old-diameter: f64, + new-diameter: f64, + speed: string, + } + record c-set-border-size { + diameter: f64, + } + record c-set-border-warning-delay { + warning-time: s32, + } + record c-set-border-warning-distance { + warning-blocks: s32, + } + record c-set-container-content { + window-id: s32, + state-id: s32, + slot-data: list, + carried-item: string, + } + record c-set-container-property { + window-id: s32, + property: s32, + value: s32, + } + record c-set-container-slot { + window-id: u8, + state-id: s32, + slot: s32, + slot-data: string, + } + record c-set-cursor-item { + stack: string, + } + record c-set-equipment { + entity-id: s32, + equipment: list, + } + record c-set-experience { + progress: f32, + level: s32, + total-experience: s32, + } + record c-set-health { + health: f32, + food: s32, + food-saturation: f32, + } + record c-set-passengers { + entity-id: s32, + passengers: list, + } + record c-set-player-inventory { + slot: s32, + item: string, + } + record c-set-player-team { + team-name: string, + method: string, + parameters: option, + players: list, + } + record c-update-time { + game-time: s64, + clock-updates: list, + } + record c-title-text { + title: string, + } + record c-title-animation { + fade-in-ticks: s32, + stay-ticks: s32, + fade-out-ticks: s32, + } + record c-play-show-dialog { + dialog: string, + } + record c-sound-effect { + sound-event: string, + sound-category: s32, + position: tuple, + volume: f32, + pitch: f32, + seed: f64, + } + record c-spawn-entity { + entity-id: s32, + entity-uuid: uuid, + r-type: s32, + position: tuple, + velocity: string, + pitch: u8, + yaw: u8, + head-yaw: u8, + data: s32, + } + record c-stop-sound { + sound-id: option, + category: option, + } + record c-store-cookie { + key: string, + payload: list, + } + record c-subtitle { + subtitle: string, + } + record c-system-chat-message { + content: string, + overlay: bool, + } + record c-tab-list { + header: string, + footer: string, + } + record c-take-item-entity { + entity-id: s32, + collector-entity-id: s32, + stack-amount: s32, + } + record c-teleport-entity { + entity-id: s32, + position: tuple, + delta: tuple, + yaw: f32, + pitch: f32, + relatives: list, + on-ground: bool, + } + record c-ticking-state { + tick-rate: f32, + is-frozen: bool, + } + record c-ticking-step { + tick-steps: s32, + } + record c-transfer { + host: string, + port: s32, + } + record c-unload-chunk { + z: s32, + x: s32, + } + record c-update-attributes { + entity-id: s32, + properties: list, + } + record c-update-entity-pos { + entity-id: s32, + delta: tuple, + on-ground: bool, + } + record c-update-entity-pos-rot { + entity-id: s32, + delta: tuple, + yaw: u8, + pitch: u8, + on-ground: bool, + } + record c-update-entity-rot { + entity-id: s32, + yaw: u8, + pitch: u8, + on-ground: bool, + } + record c-update-mob-effect { + entity-id: s32, + effect-id: s32, + amplifier: s32, + duration: s32, + %flags: u8, + } + record c-update-objectives { + objective-name: string, + mode: u8, + display-name: string, + render-type: s32, + number-format: option, + } + record c-update-score { + entity-name: string, + objective-name: string, + value: s32, + display-name: option, + number-format: option, + } + record c-world-event { + event: s32, + location: tuple, + data: s32, + disable-relative-volume: bool, + } + variant serverbound-packet { + s-attack(s-attack), + s-change-game-mode(s-change-game-mode), + s-chat-command(s-chat-command), + s-chat-message(s-chat-message), + s-chunk-batch(s-chunk-batch), + s-click-slot(s-click-slot), + s-client-command(s-client-command), + s-client-information-play(s-client-information-play), + s-client-tick-end, + s-close-container(s-close-container), + s-command-suggestion(s-command-suggestion), + s-confirm-teleport(s-confirm-teleport), + s-container-button-click(s-container-button-click), + s-cookie-response(s-cookie-response), + s-custom-click-action(s-custom-click-action), + s-custom-payload(s-custom-payload), + s-interact(s-interact), + s-keep-alive(s-keep-alive), + s-move-vehicle(s-move-vehicle), + s-paddle-boat(s-paddle-boat), + s-pick-item-from-block(s-pick-item-from-block), + s-pick-item-from-entity(s-pick-item-from-entity), + s-play-ping-request(s-play-ping-request), + s-place-recipe(s-place-recipe), + s-player-abilities(s-player-abilities), + s-player-action(s-player-action), + s-player-command(s-player-command), + s-set-player-ground(s-set-player-ground), + s-player-input(s-player-input), + s-player-loaded, + s-player-position(s-player-position), + s-player-position-rotation(s-player-position-rotation), + s-player-rotation(s-player-rotation), + s-player-session(s-player-session), + s-recipe-book-change-settings(s-recipe-book-change-settings), + s-recipe-book-seen-recipe(s-recipe-book-seen-recipe), + s-rename-item(s-rename-item), + s-select-trade(s-select-trade), + s-set-beacon(s-set-beacon), + s-set-command-block(s-set-command-block), + s-set-creative-slot(s-set-creative-slot), + s-set-held-item(s-set-held-item), + s-swing-arm(s-swing-arm), + s-update-sign(s-update-sign), + s-use-item(s-use-item), + s-use-item-on(s-use-item-on), + } + variant clientbound-packet { + c-acknowledge-block-change(c-acknowledge-block-change), + c-action-bar(c-action-bar), + c-set-block-destroy-stage(c-set-block-destroy-stage), + c-block-entity-data(c-block-entity-data), + c-block-event(c-block-event), + c-block-update(c-block-update), + c-boss-event(c-boss-event), + c-center-chunk(c-center-chunk), + c-change-difficulty(c-change-difficulty), + c-chunk-batch-end(c-chunk-batch-end), + c-chunk-batch-start, + c-chunk-data, + c-play-clear-dialog, + c-clear-title(c-clear-title), + c-close-container(c-close-container), + c-combat-death(c-combat-death), + c-command-suggestions(c-command-suggestions), + c-commands(c-commands), + c-play-cookie-request(c-play-cookie-request), + c-custom-payload(c-custom-payload), + c-damage-event(c-damage-event), + c-play-disconnect(c-play-disconnect), + c-disguised-chat-message(c-disguised-chat-message), + c-display-objective(c-display-objective), + c-entity-animation(c-entity-animation), + c-set-entity-metadata(c-set-entity-metadata), + c-entity-position-sync(c-entity-position-sync), + c-entity-sound-effect(c-entity-sound-effect), + c-entity-status(c-entity-status), + c-entity-velocity(c-entity-velocity), + c-explosion(c-explosion), + c-game-event(c-game-event), + c-head-rot(c-head-rot), + c-hurt-animation(c-hurt-animation), + c-initialize-world-border(c-initialize-world-border), + c-item-cooldown(c-item-cooldown), + c-keep-alive(c-keep-alive), + c-level-event(c-level-event), + c-light-update, + c-login(c-login), + c-map-item-data(c-map-item-data), + c-merchant-offers(c-merchant-offers), + c-multi-block-update(c-multi-block-update), + c-open-screen(c-open-screen), + c-open-sign-editor(c-open-sign-editor), + c-particle(c-particle), + c-ping-response(c-ping-response), + c-player-abilities(c-player-abilities), + c-player-chat-message(c-player-chat-message), + c-player-info-update(c-player-info-update), + c-player-position(c-player-position), + c-remove-player-info(c-remove-player-info), + c-player-spawn-position(c-player-spawn-position), + c-recipe-book-add(c-recipe-book-add), + c-recipe-book-settings(c-recipe-book-settings), + c-remove-entities(c-remove-entities), + c-remove-mob-effect(c-remove-mob-effect), + c-reset-score(c-reset-score), + c-respawn(c-respawn), + c-play-server-links(c-play-server-links), + c-set-border-center(c-set-border-center), + c-set-border-lerp-size(c-set-border-lerp-size), + c-set-border-size(c-set-border-size), + c-set-border-warning-delay(c-set-border-warning-delay), + c-set-border-warning-distance(c-set-border-warning-distance), + c-set-container-content(c-set-container-content), + c-set-container-property(c-set-container-property), + c-set-container-slot(c-set-container-slot), + c-set-cursor-item(c-set-cursor-item), + c-set-equipment(c-set-equipment), + c-set-experience(c-set-experience), + c-set-health(c-set-health), + c-set-passengers(c-set-passengers), + c-set-player-inventory(c-set-player-inventory), + c-set-player-team(c-set-player-team), + c-update-time(c-update-time), + c-title-text(c-title-text), + c-title-animation(c-title-animation), + c-play-show-dialog(c-play-show-dialog), + c-sound-effect(c-sound-effect), + c-spawn-entity(c-spawn-entity), + c-stop-sound(c-stop-sound), + c-store-cookie(c-store-cookie), + c-subtitle(c-subtitle), + c-system-chat-message(c-system-chat-message), + c-tab-list(c-tab-list), + c-take-item-entity(c-take-item-entity), + c-teleport-entity(c-teleport-entity), + c-ticking-state(c-ticking-state), + c-ticking-step(c-ticking-step), + c-transfer(c-transfer), + c-unload-chunk(c-unload-chunk), + c-update-attributes(c-update-attributes), + c-update-entity-pos(c-update-entity-pos), + c-update-entity-pos-rot(c-update-entity-pos-rot), + c-update-entity-rot(c-update-entity-rot), + c-update-mob-effect(c-update-mob-effect), + c-update-objectives(c-update-objectives), + c-update-score(c-update-score), + c-world-event(c-world-event), + } +} diff --git a/v0.1/log.wit b/v0.1/log.wit new file mode 100644 index 0000000..aafd268 --- /dev/null +++ b/v0.1/log.wit @@ -0,0 +1,14 @@ +interface logging { + enum level { + trace, + debug, + info, + warn, + error, + } + + /// log any general purpose message + log: func(level: level, message: string); + /// This function is meant to be used by the tracing crate. + log-tracing: func(event: list); +} diff --git a/v0.1/metadata.wit b/v0.1/metadata.wit new file mode 100644 index 0000000..b488637 --- /dev/null +++ b/v0.1/metadata.wit @@ -0,0 +1,19 @@ +/// Plugin metadata describing the plugin and its compatibility. +interface metadata { + record plugin-metadata { + /// Name of the plugin. + name: string, + /// Plugin version (semver). + version: string, + /// Plugin authors. + authors: list, + /// Short description of the plugin. + description: string, + /// Plugin dependencies. + dependencies: list, + /// Permissions requested by the plugin. + permissions: list, + } + + get-metadata: func() -> plugin-metadata; +} diff --git a/v0.1/particles.wit b/v0.1/particles.wit new file mode 100644 index 0000000..17ccf50 --- /dev/null +++ b/v0.1/particles.wit @@ -0,0 +1,123 @@ +package pumpkin:plugin@0.1.0; + +interface particles { + enum particle { + angry-villager, + block, + block-marker, + bubble, + cloud, + copper-fire-flame, + crit, + damage-indicator, + dragon-breath, + dripping-lava, + falling-lava, + landing-lava, + dripping-water, + falling-water, + dust, + dust-color-transition, + effect, + elder-guardian, + enchanted-hit, + enchant, + end-rod, + entity-effect, + explosion-emitter, + explosion, + gust, + small-gust, + gust-emitter-large, + gust-emitter-small, + sonic-boom, + falling-dust, + firework, + fishing, + flame, + infested, + cherry-leaves, + pale-oak-leaves, + tinted-leaves, + sculk-soul, + sculk-charge, + sculk-charge-pop, + soul-fire-flame, + soul, + flash, + happy-villager, + composter, + heart, + instant-effect, + item, + vibration, + trail, + pause-mob-growth, + reset-mob-growth, + item-slime, + item-cobweb, + item-snowball, + large-smoke, + lava, + mycelium, + note, + poof, + portal, + rain, + smoke, + white-smoke, + sneeze, + spit, + squid-ink, + sweep-attack, + totem-of-undying, + underwater, + splash, + witch, + bubble-pop, + current-down, + bubble-column-up, + nautilus, + dolphin, + campfire-cosy-smoke, + campfire-signal-smoke, + dripping-honey, + falling-honey, + landing-honey, + falling-nectar, + falling-spore-blossom, + ash, + crimson-spore, + warped-spore, + spore-blossom-air, + dripping-obsidian-tear, + falling-obsidian-tear, + landing-obsidian-tear, + reverse-portal, + white-ash, + small-flame, + snowflake, + dripping-dripstone-lava, + falling-dripstone-lava, + dripping-dripstone-water, + falling-dripstone-water, + glow-squid-ink, + glow, + wax-on, + wax-off, + electric-spark, + scrape, + shriek, + egg-crack, + dust-plume, + trial-spawner-detection, + trial-spawner-detection-ominous, + vault-connection, + dust-pillar, + ominous-spawning, + raid-omen, + trial-omen, + block-crumble, + firefly, + } +} diff --git a/v0.1/permission.wit b/v0.1/permission.wit new file mode 100644 index 0000000..3ad4415 --- /dev/null +++ b/v0.1/permission.wit @@ -0,0 +1,46 @@ +interface permission { + /// Represents the player's permission level + /// + /// Permission levels determine the player's access to commands and server operations. + /// Each numeric level corresponds to a specific role: + /// - `Zero`: `normal`: Player can use basic commands. + /// - `One`: `moderator`: Player can bypass spawn protection. + /// - `Two`: `gamemaster`: Player or executor can use more commands and player can use command blocks. + /// - `Three`: `admin`: Player or executor can use commands related to multiplayer management. + /// - `Four`: `owner`: Player or executor can use all of the commands, including commands related to server management. + enum permission-level { + zero, + one, + two, + three, + four, + } + + /// Describes the default behavior for permissions + variant permission-default { + /// Permission is not granted by default + deny, + /// Permission is granted by default + allow, + /// Permission is granted by default to operators + op(permission-level), + } + + /// A child permission entry + record permission-child { + node: string, + value: bool, + } + + /// Defines a permission node in the system + record permission { + /// The full node name (e.g., "minecraft:command.gamemode") + node: string, + /// Description of what this permission does + description: string, + /// The default value of this permission + default: permission-default, + /// Children nodes that are affected by this permission + children: list, + } +} diff --git a/v0.1/player.wit b/v0.1/player.wit new file mode 100644 index 0000000..67a34e3 --- /dev/null +++ b/v0.1/player.wit @@ -0,0 +1,796 @@ +/// Represents a player connected to the Minecraft server. +interface player { + use common.{hand, position, game-mode}; + use item-stack.{item-stack}; + use %world.{%world, entity}; + use permission.{permission-level}; + use text.{text-component}; + use gui.{gui}; + use forms.{form}; + use java-dialogs.{dialog}; + use java-packets.{clientbound-packet as java-packet}; + use bedrock-packets.{clientbound-packet as bedrock-packet}; + use uuid.{uuid}; + + /// Various abilities a player can have. + record player-abilities { + /// Whether the player is invulnerable to damage. + invulnerable: bool, + /// Whether the player is currently flying. + flying: bool, + /// Whether the player is allowed to fly. + allow-flying: bool, + /// Whether the player is in creative mode. + creative: bool, + /// Whether the player can modify the world. + allow-modify-world: bool, + /// The speed at which the player flies. + fly-speed: f32, + /// The speed at which the player walks. + walk-speed: f32, + } + + /// Represents a player's skin textures and metadata. + record player-skin { + /// The base64-encoded texture data (usually JSON containing skin/cape URLs). + value: string, + /// The optional signature for the texture data. + signature: option, + } + + /// Represents which skin parts are visible. + flags skin-parts { + cape, + jacket, + left-sleeve, + right-sleeve, + left-pants-leg, + right-pants-leg, + hat, + } + + /// Represents the various abilities a Bedrock Edition player can have. + enum bedrock-ability { + /// Whether the player can build. + build, + /// Whether the player can mine blocks. + mine, + /// Whether the player can use doors and switches. + doors-and-switches, + /// Whether the player can open containers. + open-containers, + /// Whether the player can attack other players. + attack-players, + /// Whether the player can attack mobs. + attack-mobs, + /// Whether the player can use operator commands. + operator-commands, + /// Whether the player can teleport. + teleport, + /// Whether the player is invulnerable. + invulnerable, + /// Whether the player is currently flying. + flying, + /// Whether the player is allowed to fly. + may-fly, + /// Whether the player has instant build (creative). + instabuild, + /// Whether the player can use lightning-related abilities. + lightning, + /// The speed at which the player flies. + fly-speed, + /// The speed at which the player walks. + walk-speed, + /// Whether the player is muted. + muted, + /// Whether the player is a world builder. + world-builder, + /// Whether the player has no-clip enabled. + no-clip, + /// Whether the player is a privileged builder. + privileged-builder, + /// The speed at which the player flies vertically. + vertical-fly-speed, + } + + /// Represents the various status flags a Bedrock Edition entity can have. + /// These flags control client-side rendering and behavior. + enum bedrock-status-flag { + /// Whether the entity is currently on fire. + on-fire, + /// Whether the entity is sneaking. + sneaking, + /// Whether the entity is riding another entity. + riding, + /// Whether the entity is sprinting. + sprinting, + /// Whether the entity is using an item (e.g., eating, blocking). + using-item, + /// Whether the entity is invisible. + invisible, + /// Whether the entity is tempted by an item. + tempted, + /// Whether the entity is in love (breeding). + in-love, + /// Whether the entity is saddled. + saddled, + /// Whether the entity is powered (e.g., charged creeper). + powered, + /// Whether the entity is ignited. + ignited, + /// Whether the entity is a baby. + baby, + /// Whether the entity is currently converting to another type. + converting, + /// Whether the entity is in a critical state. + critical, + /// Whether to show the entity's name tag. + show-name, + /// Whether to always show the entity's name tag. + always-show-name, + /// Whether the entity has no AI. + no-ai, + /// Whether the entity is silent. + silent, + /// Whether the entity is climbing a wall. + wall-climbing, + /// Whether the entity is climbing. + climb, + /// Whether the entity is swimming. + swim, + /// Whether the entity is flying. + fly, + /// Whether the entity is walking. + walk, + /// Whether the entity is resting. + resting, + /// Whether the entity is sitting. + sitting, + /// Whether the entity is angry. + angry, + /// Whether the entity is interested. + interested, + /// Whether the entity is charged. + charged, + /// Whether the entity is tamed. + tamed, + /// Whether the entity is orphaned. + orphaned, + /// Whether the entity is leashed. + leashed, + /// Whether the entity is sheared. + sheared, + /// Whether the entity is gliding (elytra). + gliding, + /// Whether the entity is an elder (e.g., elder guardian). + elder, + /// Whether the entity is moving. + moving, + /// Whether the entity is breathing. + breathing, + /// Whether the entity has a chest (e.g., donkey). + chested, + /// Whether the entity is stackable. + stackable, + /// Whether to show the bottom of the entity. + show-bottom, + /// Whether the entity is standing. + standing, + /// Whether the entity is shaking. + shaking, + /// Whether the entity is idling. + idling, + /// Whether the entity is casting (e.g., evoker). + casting, + /// Whether the entity is charging an attack. + charging, + /// Whether the entity is controlled by a keyboard. + keyboard-controlled, + /// Whether the entity is performing a power jump. + power-jump, + /// Whether the entity is dashing. + dash, + /// Whether the entity is lingering. + lingering, + /// Whether the entity has collision. + has-collision, + /// Whether the entity has gravity. + has-gravity, + /// Whether the entity is immune to fire. + fire-immune, + /// Whether the entity is dancing. + dancing, + /// Whether the entity is enchanted. + enchanted, + /// Whether a trident will return to the entity. + return-trident, + /// Whether the container is private. + container-private, + /// Whether the entity is transforming. + transforming, + /// Whether the entity damages nearby mobs. + damage-nearby-mobs, + /// Whether the entity is swimming. + swimming, + /// Whether the entity has been bribed. + bribed, + /// Whether the entity is pregnant. + pregnant, + /// Whether the entity is laying an egg. + laying-egg, + /// Whether a passenger can pick up the entity. + passenger-can-pick, + /// Whether the entity is transitioning to sitting. + transition-sitting, + /// Whether the entity is eating. + eating, + /// Whether the entity is laying down. + laying-down, + /// Whether the entity is sneezing. + sneezing, + /// Whether the entity is trusting. + trusting, + /// Whether the entity is rolling. + rolling, + /// Whether the entity is scared. + scared, + /// Whether the entity is in scaffolding. + in-scaffolding, + /// Whether the entity is over scaffolding. + over-scaffolding, + /// Whether the entity is descending through a block. + descend-through-block, + /// Whether the entity is blocking. + blocking, + /// Whether the entity is transitioning to blocking. + transition-blocking, + /// Whether the entity is blocked using a shield. + blocked-using-shield, + /// Whether the entity is blocked using a damaged shield. + blocked-using-damaged-shield, + /// Whether the entity is sleeping. + sleeping, + /// Whether the entity wants to wake up. + wants-to-wake, + /// Whether the entity shows interest in trading. + trade-interest, + /// Whether the entity can break doors. + door-breaker, + /// Whether the entity is breaking an obstruction. + breaking-obstruction, + /// Whether the entity can open doors. + door-opener, + /// Whether the entity is a captain (raid). + captain, + /// Whether the entity is stunned. + stunned, + /// Whether the entity is roaring. + roaring, + /// Whether the entity has a delayed attack. + delayed-attack, + /// Whether the entity is avoiding mobs. + avoiding-mobs, + /// Whether the entity is avoiding a block. + avoiding-block, + /// Whether the entity is facing a target for a ranged attack. + facing-target-to-range-attack, + /// Whether the entity is hidden when invisible. + hidden-when-invisible, + /// Whether the entity is in a UI. + in-ui, + /// Whether the entity is stalking. + stalking, + /// Whether the entity is emoting. + emoting, + /// Whether the entity is celebrating. + celebrating, + /// Whether the entity is admiring (piglin). + admiring, + /// Whether the entity is celebrating a special event. + celebrating-special, + /// Whether the entity is out of control. + out-of-control, + /// Whether the entity is performing a ram attack. + ram-attack, + /// Whether the entity is playing dead. + playing-dead, + /// Whether the entity is in an ascending block. + in-ascending-block, + /// Whether the entity is over a descending block. + over-descending-block, + /// Whether the entity is croaking (frog). + croaking, + /// Whether the entity is digesting a mob. + digest-mob, + /// Whether the entity has a jump goal. + jump-goal, + /// Whether the entity is emerging. + emerging, + /// Whether the entity is sniffing. + sniffing, + /// Whether the entity is digging. + digging, + /// Whether the entity is performing a sonic boom. + sonic-boom, + /// Whether the entity has a dash timeout. + has-dash-timeout, + /// Whether the entity is pushed towards the closest space. + push-towards-closest-space, + /// Whether the entity is scenting. + scenting, + /// Whether the entity is rising. + rising, + /// Whether the entity is feeling happy. + feeling-happy, + /// Whether the entity is searching. + searching, + /// Whether the entity is crawling. + crawling, + /// Whether the entity's body rotation is blocked. + body-rotation-blocked, + /// Whether the entity is rendered when invisible. + render-when-invisible, + /// Whether the entity's body rotation is axis-aligned. + body-rotation-axis-aligned, + /// Whether the entity is collidable. + collidable, + /// Whether the entity is air-controlled via WASD. + wasd-air-controlled, + /// Whether only the server can authorize a dismount. + does-server-auth-only-dismount, + /// Whether the body rotation always follows the head. + body-rotation-always-follows-head, + /// Whether the entity can use vertical movement actions. + can-use-vertical-movement-action, + /// Whether rotation is locked to the vehicle. + rotation-locked-to-vehicle, + } + + /// Represents a specific version of the Minecraft Java Edition protocol. + enum java-minecraft-version { + v-1-7-2, + v-1-7-6, + v-1-8, + v-1-9, + v-1-9-1, + v-1-9-2, + v-1-9-3, + v-1-10, + v-1-11, + v-1-11-1, + v-1-12, + v-1-12-1, + v-1-12-2, + v-1-13, + v-1-13-1, + v-1-13-2, + v-1-14, + v-1-14-1, + v-1-14-2, + v-1-14-3, + v-1-14-4, + v-1-15, + v-1-15-1, + v-1-15-2, + v-1-16, + v-1-16-1, + v-1-16-2, + v-1-16-3, + v-1-16-4, + v-1-17, + v-1-17-1, + v-1-18, + v-1-18-2, + v-1-19, + v-1-19-1, + v-1-19-3, + v-1-19-4, + v-1-20, + v-1-20-2, + v-1-20-3, + v-1-20-5, + v-1-21, + v-1-21-2, + v-1-21-4, + v-1-21-5, + v-1-21-6, + v-1-21-7, + v-1-21-9, + v-1-21-11, + v-26-1, + unknown, + } + + /// Represents a specific version of the Minecraft Bedrock Edition protocol. + enum bedrock-minecraft-version { + v-1-21, + v-1-26-20, + unknown, + } + + /// Represents settings for a Java Edition player. + record java-player-settings { + /// The player's preferred language (e.g., \"en_us\"). + locale: string, + /// The maximum distance at which chunks are rendered. + view-distance: u8, + /// The player's chat visibility settings. + chat-mode: chat-mode, + /// Whether chat colors are enabled. + chat-colors: bool, + /// The player's skin configuration options. + skin-parts: skin-parts, + /// The player's dominant hand (left or right). + main-hand: hand, + /// Whether text filtering is enabled. + text-filtering: bool, + /// Whether the player wants to appear in the server list. + server-listing: bool, + } + + /// The chat visibility settings for a player. + enum chat-mode { + /// Chat is fully enabled. + enabled, + /// Only system messages and commands are shown. + commands-only, + /// Chat is completely hidden. + hidden, + } + + /// Represents the operating system of a Bedrock Edition client. + enum bedrock-device-os { + android, + ios, + osx, + amazon, + gear-vr, + holo-lens, + windows-10, + win-32, + dedicated, + tv-os, + playstation, + nintendo, + xbox, + windows-phone, + linux, + /// Fallback for unrecognized operating systems. + unknown, + } + + /// Represents the input mode used by a Bedrock Edition client. + enum bedrock-input-mode { + /// Unknown input mode. + unknown, + /// Mouse and keyboard. + mouse, + /// Touch screen. + touch, + /// Game controller. + game-pad, + /// Motion-based controller. + motion-controller, + } + + /// Represents the UI profile used by a Bedrock Edition client. + enum bedrock-ui-profile { + /// Classic desktop UI. + classic, + /// Pocket/Mobile optimized UI. + pocket, + /// Unknown UI profile. + unknown, + } + + /// Represents the graphics mode used by a Bedrock Edition client. + enum bedrock-graphics-mode { + simple, + fancy, + ray-traced, + unknown, + } + + /// Represents settings and client data for a Bedrock Edition player. + record bedrock-player-settings { + /// The client's specific game version string. + game-version: string, + /// The operating system of the client device. + device-os: bedrock-device-os, + /// A unique identifier for the client device. + device-id: string, + /// The model name of the client device. + device-model: string, + /// The player's preferred language code (e.g., \"en_US\"). + language-code: string, + /// The input mode currently used by the player. + current-input-mode: bedrock-input-mode, + /// The default input mode for the client device. + default-input-mode: bedrock-input-mode, + /// The UI layout profile used by the client. + ui-profile: bedrock-ui-profile, + /// The current GUI scale setting. + gui-scale: s32, + /// Whether the player is in Editor mode. + is-editor-mode: bool, + /// The maximum view distance the client supports. + max-view-distance: s32, + /// The memory tier of the client device (indicates performance level). + memory-tier: s32, + /// The graphics mode used by the client. + graphics-mode: bedrock-graphics-mode, + /// The player's unique PlayFab identifier. + playfab-id: string, + /// A random 64-bit ID generated by the client. + client-random-id: s64, + /// Platform-specific offline identifier. + platform-offline-id: string, + /// Platform-specific online identifier. + platform-online-id: string, + /// The unique ID of the player's current skin. + skin-id: string, + /// The model arm size (e.g., \"wide\" or \"slim\"). + arm-size: string, + /// Whether the player is using a Character Creator (Persona) skin. + is-persona-skin: bool, + /// Whether the skin is a premium (paid) skin. + is-premium-skin: bool, + /// Whether the skin is from a trusted source. + is-trusted-skin: bool, + } + + /// A handle to a player on the server. + resource player { + /// Returns the player as an entity. + as-entity: func () -> entity; + /// Returns the player's unique UUID as a string. + get-id: func () -> uuid; + /// Returns the player's username. + get-name: func () -> string; + + // Basic state + + /// Returns the player's current position in the world. + get-position: func () -> position; + /// Returns the player's current yaw (horizontal rotation). + get-yaw: func () -> f32; + /// Returns the player's current pitch (vertical rotation). + get-pitch: func () -> f32; + /// Returns the world the player is currently in. + get-world: func () -> %world; + /// Returns the player's current game mode. + get-gamemode: func () -> game-mode; + /// Changes the player's game mode. Returns true if successful. + set-gamemode: func (mode: game-mode) -> bool; + /// Returns the player's locale (e.g., \"en_us\"). + get-locale: func () -> string; + /// Returns the player's current ping in milliseconds. + get-ping: func () -> u32; + + // Permissions & metadata + + /// Returns the player's permission level (0-4). + get-permission-level: func () -> permission-level; + /// Sets the player's permission level. + set-permission-level: func (level: permission-level); + /// Grants or denies a specific permission node for the player. + set-permission: func(node: string, value: bool); + /// Removes an explicitly set permission node from the player. + unset-permission: func(node: string); + /// Returns `Some(true)` if granted, `Some(false)` if denied, or `None` if not set. + has-permission-set: func (node: string) -> option; + /// Checks if the player has a specific permission node. + has-permission: func (node: string) -> bool; + /// Returns the player's display name, which may include formatting. + get-display-name: func () -> text-component; + /// Sets the player's display name. + set-display-name: func (display-name: text-component); + /// Gets the player's custom tab list name. + get-tab-list-name: func () -> option; + /// Sets the player's custom tab list name. + set-tab-list-name: func (name: option); + + // Messaging & titles + + /// Sends a system message to the player's chat. + send-system-message: func (text: text-component, overlay: bool); + /// Sets the header and footer of the player's Tab list. + set-tab-list-header-footer: func (header: text-component, footer: text-component); + + /// Sets the sorting order of the player in the Tab list. + set-tab-list-order: func (order: s32); + /// Sets the latency (ping) shown for the player in the Tab list. + set-tab-list-latency: func (latency: s32); + /// Sets whether the player is visible in the Tab list. + set-tab-list-listed: func (listed: bool); + + /// Shows a large title on the player's screen. + + show-title: func (text: text-component); + /// Shows a smaller subtitle on the player's screen. + show-subtitle: func (text: text-component); + /// Shows a message in the action bar area. + show-actionbar: func (text: text-component); + /// Sets the fade-in, stay, and fade-out times for titles. + send-title-animation: func (fade-in: s32, stay: s32, fade-out: s32); + + // Teleport & kick + + /// Teleports the player to a position in a world. + teleport: func (position: position, yaw: option, pitch: option, %world: %world); + /// Teleports the player to another world at a specific position. + teleport-world: func (world-ref: %world, position: position, yaw: option, pitch: option); + /// Kicks the player from the server with the specified reason. + kick: func (message: text-component); + /// Forces the player to respawn. + respawn: func (); + + /// Opens a GUI for the player. + open-gui: func (gui-ref: gui); + + /// Bans the player with an optional reason. + ban: func (reason: option); + /// Bans the player's IP address with an optional reason. + ban-ip: func (reason: option); + + /// Transfers the player to another server. + transfer: func (host: string, port: u16); + + // Inventory + + /// Returns the index of the currently selected hotbar slot (0-8). + get-selected-slot: func () -> u8; + /// Returns the item currently in the specified hand. + get-item-in-hand: func (hand: hand) -> option; + /// Returns the item in the specified inventory slot. + get-inventory-item: func (slot: u8) -> option; + + /// Sets the item in the specified hand. + set-item-in-hand: func (hand: hand, stack: option); + /// Sets the item in the specified inventory slot. + set-inventory-item: func (slot: u8, stack: option); + + // Status + + /// Returns the player's current health. + get-health: func () -> f32; + /// Sets the player's current health. + set-health: func (health: f32); + /// Returns the player's maximum health. + get-max-health: func () -> f32; + /// Sets the player's maximum health. + set-max-health: func (max-health: f32); + /// Returns the player's food level (0-20). + get-food-level: func () -> u8; + /// Sets the player's food level. + set-food-level: func (food-level: u8); + /// Returns the player's food saturation level. + get-saturation: func () -> f32; + /// Sets the player's food saturation level. + set-saturation: func (saturation: f32); + /// Returns the player's food exhaustion level. + get-exhaustion: func () -> f32; + /// Sets the player's food exhaustion level. + set-exhaustion: func (exhaustion: f32); + /// Returns the player's current absorption amount. + get-absorption: func () -> f32; + /// Sets the player's current absorption amount. + set-absorption: func (absorption: f32); + + /// Returns the player's total experience level. + get-experience-level: func() -> s32; + /// Returns the player's progress toward the next level (0.0 to 1.0). + get-experience-progress: func() -> f32; + /// Returns the total experience points the player has. + get-experience-points: func() -> s32; + /// Sets the player's total experience level. + set-experience-level: func(level: s32); + /// Sets the player's progress toward the next level. + set-experience-progress: func(progress: f32); + /// Sets the player's total experience points. + set-experience-points: func(points: s32); + /// Adds experience levels to the player. + add-experience-levels: func(levels: s32); + /// Adds experience points to the player. + add-experience-points: func(points: s32); + + /// Returns whether the player is currently flying. + is-flying: func() -> bool; + /// Sets whether the player should be flying. + set-flying: func(flying: bool); + + /// Returns the player's current abilities. + get-abilities: func() -> player-abilities; + /// Updates the player's abilities. + set-abilities: func(abilities: player-abilities); + + /// Returns the player's IP address. + get-ip: func() -> string; + + /// Returns the player's current skin textures. + get-skin: func() -> option; + + /// Updates the player's skin textures. + /// Note: this only updates the fields, it doesn't reload the skin. + set-skin: func(skin: player-skin); + + /// Returns which skin parts are visible. + get-skin-parts: func() -> skin-parts; + /// Sets which skin parts are visible. + set-skin-parts: func(parts: skin-parts); + + /// Returns a Java-specific player handle, if the player is connected via Java Edition. + /// + /// This allows access to Java-exclusive features like sending specific packets + /// or retrieving the client brand. + as-java: func() -> option; + + /// Returns a Bedrock-specific player handle, if the player is connected via Bedrock Edition. + /// + /// This allows access to Bedrock-exclusive features like custom forms + /// or detailed device information. + as-bedrock: func() -> option; + } + + /// A handle to a player connected via the Java Edition. + resource java-player { + /// Returns the Minecraft Java Edition version of the player. + get-version: func() -> java-minecraft-version; + + /// Returns the brand of the player's client (e.g., \"vanilla\", \"fabric\"). + get-brand: func() -> string; + + /// Returns the server address the player used to connect. + get-server-address: func() -> string; + + /// Returns the player's configuration settings. + get-settings: func() -> java-player-settings; + + /// Sends a Java-specific clientbound packet to the player. + send-packet: func(packet: java-packet); + + /// Sends a custom payload packet (plugin message) to the player. + send-custom-payload: func(channel: string, data: list); + + /// Shows a dialog to the player. + show-dialog: func(dialog: dialog); + + /// Clears any currently shown dialog for the player. + clear-dialog: func(); + } + + /// A handle to a player connected via the Bedrock Edition. + resource bedrock-player { + /// Returns the Minecraft Bedrock Edition version of the player. + get-version: func() -> bedrock-minecraft-version; + + /// Returns the player's configuration settings. + get-settings: func() -> bedrock-player-settings; + + /// Returns whether a specific Bedrock-only ability is enabled for the player. + get-ability: func(ability: bedrock-ability) -> bool; + + /// Sets whether a specific Bedrock-only ability is enabled for the player. + set-ability: func(ability: bedrock-ability, value: bool); + + /// Returns whether a specific Bedrock-only status flag is enabled for the player. + /// + /// Status flags control things like whether the player is on fire, sneaking, + /// sprinting, or has specific visual effects. + get-status-flag: func(flag: bedrock-status-flag) -> bool; + + /// Sets whether a specific Bedrock-only status flag is enabled for the player. + /// + /// This can be used to manually trigger client-side visual states. + set-status-flag: func(flag: bedrock-status-flag, value: bool); + + /// Sends a Bedrock-specific clientbound packet to the player. + send-packet: func(packet: bedrock-packet); + + /// Opens a Bedrock custom form for the player. + open-form: func(form: form) -> u32; + } + + /// Returns a list of all players in a specific world. + get-world-players: func(world-ref: %world) -> list; +} diff --git a/v0.1/plugin.wit b/v0.1/plugin.wit new file mode 100644 index 0000000..f6f3749 --- /dev/null +++ b/v0.1/plugin.wit @@ -0,0 +1,68 @@ +/// The main entry point for a Pumpkin plugin. +/// This world defines the exports that the plugin must provide to the host +/// and the imports that the host provides to the plugin. +package pumpkin:plugin@0.1.0; + +world plugin { + use context.{context}; + use event.{event}; + use server.{server as server-instance}; + use command.{command-sender, consumed-args, command-error}; + + // --- Host-provided imports --- + + /// Provides logging capabilities to the plugin. + import logging; + /// Provides GUI creation and management. + import gui; + /// Provides scoreboard management. + import scoreboard; + /// Provides global server information and player lookup. + import server; + /// Provides text component building and formatting. + import text; + /// Provides command registration and argument parsing. + import command; + /// Provides the plugin execution context. + import context; + /// Provides internationalization and translation support. + import i18n; + /// Provides task scheduling for delayed or repeating logic. + import scheduler; + /// Provides world information and block manipulation. + import %world; + /// Provides entity types and manipulation. + import entity; + /// Provides boss bar creation and management. + import boss-bar; + /// Provides Bedrock custom forms. + import forms; + /// Provides Java Edition dialogs. + import java-dialogs; + + // --- Plugin-provided exports --- + + /// Called by the host once to initialize the plugin. + /// Internal use only; plugins should use the `register_plugin!` macro. + export init-plugin: func(); + + /// Called when the plugin is being loaded. + /// Use this to register commands, events, and perform initial setup. + export on-load: func(context: context) -> result<_, string>; + + /// Called when the plugin is being unloaded. + /// Use this to save data and clean up resources. + export on-unload: func(context: context) -> result<_, string>; + + /// Provides plugin metadata (name, version, etc.) to the host. + export metadata; + + /// Dispatches an event to the plugin for handling. + export handle-event: func(event-id: u32, server: server-instance, event: event) -> event; + + /// Dispatches a command execution to the plugin. + export handle-command: func(command-id: u32, sender: command-sender, server: server-instance, args: consumed-args) -> result; + + /// Dispatches a scheduled task execution to the plugin. + export handle-task: func(handler-id: u32, server: server-instance); +} diff --git a/v0.1/recipe.wit b/v0.1/recipe.wit new file mode 100644 index 0000000..8cbe61e --- /dev/null +++ b/v0.1/recipe.wit @@ -0,0 +1,67 @@ +interface recipe { + use item-stack.{item-stack}; + + /// Represents an ingredient in a recipe. + variant ingredient { + /// A specific item. + item(string), + /// A tag group of items (e.g., "minecraft:logs"). + tag(string), + } + + /// Represents a shaped crafting recipe. + record shaped-recipe { + /// The pattern of the recipe (e.g., ["# #", " s ", "# #"]). + pattern: list, + /// Mapping of characters in the pattern to ingredients. + key: list>, + /// The resulting item stack. + output: item-stack, + /// The recipe group (optional). + group: option, + } + + /// Represents a shapeless crafting recipe. + record shapeless-recipe { + /// The list of ingredients required. + ingredients: list, + /// The resulting item stack. + output: item-stack, + /// The recipe group (optional). + group: option, + } + + /// Represents a cooking recipe (Smelting, Blasting, Smoking, Campfire). + record cooking-recipe { + /// The ingredient to cook. + ingredient: ingredient, + /// The resulting item stack. + output: item-stack, + /// Experience points awarded. + experience: f32, + /// Cooking time in ticks. + cooking-time: u32, + /// The recipe group (optional). + group: option, + } + + /// Types of cooking stations. + enum cooking-type { + smelting, + blasting, + smoking, + campfire, + } + + /// Common interface for registering recipes. + resource recipe-manager { + /// Registers a shaped crafting recipe. + register-shaped: func(id: string, recipe: shaped-recipe); + + /// Registers a shapeless crafting recipe. + register-shapeless: func(id: string, recipe: shapeless-recipe); + + /// Registers a cooking recipe. + register-cooking: func(id: string, station-type: cooking-type, recipe: cooking-recipe); + } +} diff --git a/v0.1/scheduler.wit b/v0.1/scheduler.wit new file mode 100644 index 0000000..cd06e37 --- /dev/null +++ b/v0.1/scheduler.wit @@ -0,0 +1,24 @@ +/// Provides functionality to schedule tasks to be executed later on the server. +interface scheduler { + /// Schedules a task to be executed once after the specified number of ticks. + /// + /// * `handler-id`: The unique ID of the handler to call when the task executes. + /// * `delay-ticks`: The number of game ticks to wait before execution (20 ticks = 1 second). + /// + /// Returns a unique task ID that can be used to cancel the task. + schedule-delayed-task: func(handler-id: u32, delay-ticks: u64) -> u32; + + /// Schedules a task to be executed repeatedly. + /// + /// * `handler-id`: The unique ID of the handler to call when the task executes. + /// * `delay-ticks`: The number of game ticks to wait before the first execution. + /// * `period-ticks`: The number of game ticks between subsequent executions. + /// + /// Returns a unique task ID that can be used to cancel the task. + schedule-repeating-task: func(handler-id: u32, delay-ticks: u64, period-ticks: u64) -> u32; + + /// Cancels a scheduled task if it hasn't finished yet. + /// + /// * `task-id`: The ID of the task to cancel. + cancel-task: func(task-id: u32); +} diff --git a/v0.1/scoreboard.wit b/v0.1/scoreboard.wit new file mode 100644 index 0000000..a77f207 --- /dev/null +++ b/v0.1/scoreboard.wit @@ -0,0 +1,72 @@ +interface scoreboard { + use text.{text-component}; + use common.{named-color}; + + enum render-type { + integer, + hearts + } + + enum display-slot { + player-list, + sidebar, + below-name, + sidebar-team-black, + sidebar-team-dark-blue, + sidebar-team-dark-green, + sidebar-team-dark-aqua, + sidebar-team-dark-red, + sidebar-team-dark-purple, + sidebar-team-gold, + sidebar-team-gray, + sidebar-team-dark-gray, + sidebar-team-blue, + sidebar-team-green, + sidebar-team-aqua, + sidebar-team-red, + sidebar-team-light-purple, + sidebar-team-yellow, + sidebar-team-white, + } + + enum nametag-visibility { + always, + never, + hide-for-other-teams, + hide-for-own-team + } + + enum collision-rule { + always, + never, + push-other-teams, + push-own-team + } + + record team-settings { + display-name: text-component, + friendly-fire: bool, + see-friendly-invisibles: bool, + nametag-visibility: nametag-visibility, + collision-rule: collision-rule, + color: named-color, + prefix: text-component, + suffix: text-component + } + + resource scoreboard { + add-objective: func(name: string, display-name: text-component, render-type: render-type); + remove-objective: func(name: string); + set-display-slot: func(slot: display-slot, objective-name: string); + + update-score: func(entity-name: string, objective-name: string, value: s32); + remove-score: func(entity-name: string, objective-name: string); + + create-team: func(name: string, settings: team-settings); + remove-team: func(name: string); + update-team: func(name: string, settings: team-settings); + + add-player-to-team: func(team-name: string, player-name: string); + remove-player-from-team: func(team-name: string, player-name: string); + } +} diff --git a/v0.1/server.wit b/v0.1/server.wit new file mode 100644 index 0000000..80d6efd --- /dev/null +++ b/v0.1/server.wit @@ -0,0 +1,122 @@ +interface server { + use player.{player}; + use common.{game-mode}; + use %world.{%world}; + use text.{text-component}; + use uuid.{uuid}; + use recipe.{recipe-manager}; + + /// Represents the difficulty setting of a Minecraft server. + enum difficulty { + /// Hostile mobs do not spawn. Players regain health automatically. + peaceful, + /// Hostile mobs deal less damage. + easy, + /// Standard Minecraft difficulty. + normal, + /// Hostile mobs deal more damage. + hard, + } + + /// Represents the three main Minecraft dimensions. + enum dimension { + overworld, + nether, + end, + } + + record sys-info { + cpu-count: option, + total-memory: option, + used-memory: option, + os-name: option, + os-version: option, + pumpkin-version: string, + } + + variant command-sender { + console, + player(player), + } + + /// Represents the global server instance. + resource server { + /// Returns system information (CPU, Memory, OS). + /// Fields are returned only if the plugin has the corresponding permissions. + get-sys-info: func() -> sys-info; + + /// Returns the current difficulty level of the server. + get-difficulty: func() -> difficulty; + + /// Returns the total number of players currently connected to the server. + get-player-count: func() -> u32; + + /// Returns the rolling average Milliseconds Per Tick (MSPT). + /// A value below 50.0 is required for a stable 20 TPS. + get-mspt: func() -> f64; + + /// Returns the effective Ticks Per Second (TPS). + /// Ideal value is 20.0. + get-tps: func() -> f64; + + /// Returns a list of all online players across all worlds. + get-all-players: func() -> list; + + /// Searches for a player by their exact name. + get-player-by-name: func(name: string) -> option; + + /// Searches for a player by their UUID string. + get-player-by-uuid: func(id: uuid) -> option; + + /// Returns a list of all worlds on this server. + get-all-worlds: func() -> list<%world>; + + /// Gets a world by its dimension name (e.g., "minecraft:overworld"). + get-world-by-name: func(name: string) -> option<%world>; + + execute-command: func(command: string, sender: command-sender); + + /// Creates or loads a world by its name and dimension. + /// If a world with the given name already exists, it will be returned. + create-world: func(name: string, dimension: dimension) -> %world; + + /// Broadcasts a system chat message to all players. + broadcast: func(message: string); + + /// Broadcasts a tab list header and footer to all players. + broadcast-tab-list-header-footer: func(header: text-component, footer: text-component); + + /// Returns the maximum number of players allowed on the server. + get-max-players: func() -> u32; + + /// Returns whether the server is in hardcore mode. + is-hardcore: func() -> bool; + + /// Returns whether the server is in online mode (authenticates with Mojang). + is-online-mode: func() -> bool; + + /// Returns the server's Message of the Day (MOTD). + get-motd: func() -> string; + + /// Returns whether the server has a whitelist enabled. + has-whitelist: func() -> bool; + + /// Returns whether the server allows the Nether dimension. + get-allow-nether: func() -> bool; + + /// Returns whether the server allows the End dimension. + get-allow-end: func() -> bool; + + /// Returns the server's maximum view distance. + get-view-distance: func() -> u8; + + /// Returns the server's maximum simulation distance. + get-simulation-distance: func() -> u8; + + /// Returns the server's default gamemode. + get-default-gamemode: func() -> game-mode; + + /// Returns the recipe manager to register custom recipes. + get-recipe-manager: func() -> recipe-manager; + } +} diff --git a/v0.1/sounds.wit b/v0.1/sounds.wit new file mode 100644 index 0000000..684d194 --- /dev/null +++ b/v0.1/sounds.wit @@ -0,0 +1,1908 @@ +package pumpkin:plugin@0.1.0; + +interface sounds { + enum sound { + entity-allay-ambient-with-item, + entity-allay-ambient-without-item, + entity-allay-death, + entity-allay-hurt, + entity-allay-item-given, + entity-allay-item-taken, + entity-allay-item-thrown, + ambient-cave, + ambient-basalt-deltas-additions, + ambient-basalt-deltas-loop, + ambient-basalt-deltas-mood, + ambient-crimson-forest-additions, + ambient-crimson-forest-loop, + ambient-crimson-forest-mood, + ambient-nether-wastes-additions, + ambient-nether-wastes-loop, + ambient-nether-wastes-mood, + ambient-soul-sand-valley-additions, + ambient-soul-sand-valley-loop, + ambient-soul-sand-valley-mood, + ambient-warped-forest-additions, + ambient-warped-forest-loop, + ambient-warped-forest-mood, + ambient-underwater-enter, + ambient-underwater-exit, + ambient-underwater-loop, + ambient-underwater-loop-additions, + ambient-underwater-loop-additions-rare, + ambient-underwater-loop-additions-ultra-rare, + block-amethyst-block-break, + block-amethyst-block-chime, + block-amethyst-block-fall, + block-amethyst-block-hit, + block-amethyst-block-place, + block-amethyst-block-resonate, + block-amethyst-block-step, + block-amethyst-cluster-break, + block-amethyst-cluster-fall, + block-amethyst-cluster-hit, + block-amethyst-cluster-place, + block-amethyst-cluster-step, + block-ancient-debris-break, + block-ancient-debris-step, + block-ancient-debris-place, + block-ancient-debris-hit, + block-ancient-debris-fall, + block-anvil-break, + block-anvil-destroy, + block-anvil-fall, + block-anvil-hit, + block-anvil-land, + block-anvil-place, + block-anvil-step, + block-anvil-use, + entity-armadillo-eat, + entity-armadillo-hurt, + entity-armadillo-hurt-reduced, + entity-armadillo-ambient, + entity-armadillo-step, + entity-armadillo-death, + entity-armadillo-roll, + entity-armadillo-land, + entity-armadillo-scute-drop, + entity-armadillo-unroll-finish, + entity-armadillo-peek, + entity-armadillo-unroll-start, + entity-armadillo-brush, + item-armor-equip-chain, + item-armor-equip-diamond, + item-armor-equip-elytra, + item-armor-equip-generic, + item-armor-equip-gold, + item-armor-equip-iron, + item-armor-equip-leather, + item-armor-equip-copper, + item-armor-equip-netherite, + item-armor-equip-turtle, + item-armor-equip-wolf, + item-armor-unequip-wolf, + item-armor-equip-nautilus, + item-armor-unequip-nautilus, + entity-armor-stand-break, + entity-armor-stand-fall, + entity-armor-stand-hit, + entity-armor-stand-place, + entity-arrow-hit, + entity-arrow-hit-player, + entity-arrow-shoot, + item-axe-strip, + item-axe-scrape, + item-axe-wax-off, + entity-axolotl-attack, + entity-axolotl-death, + entity-axolotl-hurt, + entity-axolotl-idle-air, + entity-axolotl-idle-water, + entity-axolotl-splash, + entity-axolotl-swim, + block-azalea-break, + block-azalea-fall, + block-azalea-hit, + block-azalea-place, + block-azalea-step, + block-azalea-leaves-break, + block-azalea-leaves-fall, + block-azalea-leaves-hit, + block-azalea-leaves-place, + block-azalea-leaves-step, + entity-baby-nautilus-ambient, + entity-baby-nautilus-ambient-land, + entity-baby-nautilus-death, + entity-baby-nautilus-death-land, + entity-baby-nautilus-eat, + entity-baby-nautilus-hurt, + entity-baby-nautilus-hurt-land, + entity-nautilus-riding, + entity-baby-nautilus-swim, + block-bamboo-break, + block-bamboo-fall, + block-bamboo-hit, + block-bamboo-place, + block-bamboo-step, + block-bamboo-sapling-break, + block-bamboo-sapling-hit, + block-bamboo-sapling-place, + block-bamboo-wood-break, + block-bamboo-wood-fall, + block-bamboo-wood-hit, + block-bamboo-wood-place, + block-bamboo-wood-step, + block-bamboo-wood-door-close, + block-bamboo-wood-door-open, + block-bamboo-wood-trapdoor-close, + block-bamboo-wood-trapdoor-open, + block-bamboo-wood-button-click-off, + block-bamboo-wood-button-click-on, + block-bamboo-wood-pressure-plate-click-off, + block-bamboo-wood-pressure-plate-click-on, + block-bamboo-wood-fence-gate-close, + block-bamboo-wood-fence-gate-open, + block-barrel-close, + block-barrel-open, + block-basalt-break, + block-basalt-step, + block-basalt-place, + block-basalt-hit, + block-basalt-fall, + entity-bat-ambient, + entity-bat-death, + entity-bat-hurt, + entity-bat-loop, + entity-bat-takeoff, + block-beacon-activate, + block-beacon-ambient, + block-beacon-deactivate, + block-beacon-power-select, + entity-bee-death, + entity-bee-hurt, + entity-bee-loop-aggressive, + entity-bee-loop, + entity-bee-sting, + entity-bee-pollinate, + block-beehive-drip, + block-beehive-enter, + block-beehive-exit, + block-beehive-shear, + block-beehive-work, + block-bell-use, + block-bell-resonate, + block-big-dripleaf-break, + block-big-dripleaf-fall, + block-big-dripleaf-hit, + block-big-dripleaf-place, + block-big-dripleaf-step, + entity-blaze-ambient, + entity-blaze-burn, + entity-blaze-death, + entity-blaze-hurt, + entity-blaze-shoot, + entity-boat-paddle-land, + entity-boat-paddle-water, + entity-bogged-ambient, + entity-bogged-death, + entity-bogged-hurt, + entity-bogged-shear, + entity-bogged-step, + block-bone-block-break, + block-bone-block-fall, + block-bone-block-hit, + block-bone-block-place, + block-bone-block-step, + item-bone-meal-use, + item-book-page-turn, + item-book-put, + block-blastfurnace-fire-crackle, + item-bottle-empty, + item-bottle-fill, + item-bottle-fill-dragonbreath, + entity-breeze-charge, + entity-breeze-deflect, + entity-breeze-inhale, + entity-breeze-idle-ground, + entity-breeze-idle-air, + entity-breeze-shoot, + entity-breeze-jump, + entity-breeze-land, + entity-breeze-slide, + entity-breeze-death, + entity-breeze-hurt, + entity-breeze-whirl, + entity-breeze-wind-burst, + block-brewing-stand-brew, + item-brush-brushing-generic, + item-brush-brushing-sand, + item-brush-brushing-gravel, + item-brush-brushing-sand-complete, + item-brush-brushing-gravel-complete, + block-bubble-column-bubble-pop, + block-bubble-column-upwards-ambient, + block-bubble-column-upwards-inside, + block-bubble-column-whirlpool-ambient, + block-bubble-column-whirlpool-inside, + ui-hud-bubble-pop, + item-bucket-empty, + item-bucket-empty-axolotl, + item-bucket-empty-fish, + item-bucket-empty-lava, + item-bucket-empty-powder-snow, + item-bucket-empty-tadpole, + item-bucket-fill, + item-bucket-fill-axolotl, + item-bucket-fill-fish, + item-bucket-fill-lava, + item-bucket-fill-powder-snow, + item-bucket-fill-tadpole, + item-bundle-drop-contents, + item-bundle-insert, + item-bundle-insert-fail, + item-bundle-remove-one, + block-cactus-flower-break, + block-cactus-flower-place, + block-cake-add-candle, + block-calcite-break, + block-calcite-step, + block-calcite-place, + block-calcite-hit, + block-calcite-fall, + entity-camel-husk-ambient, + entity-camel-husk-dash, + entity-camel-husk-dash-ready, + entity-camel-husk-death, + entity-camel-husk-eat, + entity-camel-husk-hurt, + entity-camel-husk-saddle, + entity-camel-husk-sit, + entity-camel-husk-stand, + entity-camel-husk-step, + entity-camel-husk-step-sand, + entity-camel-ambient, + entity-camel-dash, + entity-camel-dash-ready, + entity-camel-death, + entity-camel-eat, + entity-camel-hurt, + entity-camel-saddle, + entity-camel-sit, + entity-camel-stand, + entity-camel-step, + entity-camel-step-sand, + block-campfire-crackle, + block-candle-ambient, + block-candle-break, + block-candle-extinguish, + block-candle-fall, + block-candle-hit, + block-candle-place, + block-candle-step, + entity-baby-cat-ambient, + entity-baby-cat-stray-ambient, + entity-baby-cat-death, + entity-baby-cat-eat, + entity-baby-cat-hiss, + entity-baby-cat-beg-for-food, + entity-baby-cat-hurt, + entity-baby-cat-purr, + entity-baby-cat-purreow, + entity-cat-ambient, + entity-cat-stray-ambient, + entity-cat-hiss, + entity-cat-hurt, + entity-cat-death, + entity-cat-eat, + entity-cat-beg-for-food, + entity-cat-purr, + entity-cat-purreow, + entity-cat-royal-ambient, + entity-cat-royal-stray-ambient, + entity-cat-royal-hiss, + entity-cat-royal-hurt, + entity-cat-royal-death, + entity-cat-royal-eat, + entity-cat-royal-beg-for-food, + entity-cat-royal-purr, + entity-cat-royal-purreow, + block-cave-vines-break, + block-cave-vines-fall, + block-cave-vines-hit, + block-cave-vines-place, + block-cave-vines-step, + block-cave-vines-pick-berries, + block-chain-break, + block-chain-fall, + block-chain-hit, + block-chain-place, + block-chain-step, + block-cherry-wood-break, + block-cherry-wood-fall, + block-cherry-wood-hit, + block-cherry-wood-place, + block-cherry-wood-step, + block-cherry-sapling-break, + block-cherry-sapling-fall, + block-cherry-sapling-hit, + block-cherry-sapling-place, + block-cherry-sapling-step, + block-cherry-leaves-break, + block-cherry-leaves-fall, + block-cherry-leaves-hit, + block-cherry-leaves-place, + block-cherry-leaves-step, + block-cherry-wood-hanging-sign-step, + block-cherry-wood-hanging-sign-break, + block-cherry-wood-hanging-sign-fall, + block-cherry-wood-hanging-sign-hit, + block-cherry-wood-hanging-sign-place, + block-cherry-wood-door-close, + block-cherry-wood-door-open, + block-cherry-wood-trapdoor-close, + block-cherry-wood-trapdoor-open, + block-cherry-wood-button-click-off, + block-cherry-wood-button-click-on, + block-cherry-wood-pressure-plate-click-off, + block-cherry-wood-pressure-plate-click-on, + block-cherry-wood-fence-gate-close, + block-cherry-wood-fence-gate-open, + block-chest-close, + block-chest-locked, + block-chest-open, + entity-baby-chicken-ambient, + entity-baby-chicken-death, + entity-chicken-egg, + entity-baby-chicken-hurt, + entity-chicken-step, + entity-baby-chicken-step, + entity-chicken-ambient, + entity-chicken-hurt, + entity-chicken-death, + entity-chicken-picky-ambient, + entity-chicken-picky-hurt, + entity-chicken-picky-death, + block-chiseled-bookshelf-break, + block-chiseled-bookshelf-fall, + block-chiseled-bookshelf-hit, + block-chiseled-bookshelf-insert, + block-chiseled-bookshelf-insert-enchanted, + block-chiseled-bookshelf-step, + block-chiseled-bookshelf-pickup, + block-chiseled-bookshelf-pickup-enchanted, + block-chiseled-bookshelf-place, + block-chorus-flower-death, + block-chorus-flower-grow, + item-chorus-fruit-teleport, + block-cobweb-break, + block-cobweb-step, + block-cobweb-place, + block-cobweb-hit, + block-cobweb-fall, + entity-cod-ambient, + entity-cod-death, + entity-cod-flop, + entity-cod-hurt, + block-comparator-click, + block-composter-empty, + block-composter-fill, + block-composter-fill-success, + block-composter-ready, + block-conduit-activate, + block-conduit-ambient, + block-conduit-ambient-short, + block-conduit-attack-target, + block-conduit-deactivate, + block-copper-bulb-break, + block-copper-bulb-step, + block-copper-bulb-place, + block-copper-bulb-hit, + block-copper-bulb-fall, + block-copper-bulb-turn-on, + block-copper-bulb-turn-off, + block-copper-break, + block-copper-step, + block-copper-place, + block-copper-hit, + block-copper-fall, + block-copper-chest-close, + block-copper-chest-open, + block-copper-chest-weathered-close, + block-copper-chest-weathered-open, + block-copper-chest-oxidized-close, + block-copper-chest-oxidized-open, + block-copper-door-close, + block-copper-door-open, + entity-copper-golem-step, + entity-copper-golem-hurt, + entity-copper-golem-death, + entity-copper-golem-weathered-step, + entity-copper-golem-weathered-hurt, + entity-copper-golem-weathered-death, + entity-copper-golem-oxidized-step, + entity-copper-golem-oxidized-hurt, + entity-copper-golem-oxidized-death, + entity-copper-golem-spin, + entity-copper-golem-weathered-spin, + entity-copper-golem-oxidized-spin, + entity-copper-golem-no-item-get, + entity-copper-golem-no-item-no-get, + entity-copper-golem-item-drop, + entity-copper-golem-item-no-drop, + entity-copper-golem-become-statue, + block-copper-golem-statue-break, + block-copper-golem-statue-place, + block-copper-golem-statue-hit, + block-copper-golem-statue-step, + block-copper-golem-statue-fall, + entity-copper-golem-spawn, + entity-copper-golem-shear, + block-copper-grate-break, + block-copper-grate-step, + block-copper-grate-place, + block-copper-grate-hit, + block-copper-grate-fall, + block-copper-trapdoor-close, + block-copper-trapdoor-open, + block-coral-block-break, + block-coral-block-fall, + block-coral-block-hit, + block-coral-block-place, + block-coral-block-step, + entity-cow-milk, + entity-cow-ambient, + entity-cow-hurt, + entity-cow-death, + entity-cow-step, + entity-cow-moody-ambient, + entity-cow-moody-hurt, + entity-cow-moody-death, + entity-cow-moody-step, + block-crafter-craft, + block-crafter-fail, + entity-creaking-ambient, + entity-creaking-activate, + entity-creaking-deactivate, + entity-creaking-attack, + entity-creaking-death, + entity-creaking-step, + entity-creaking-freeze, + entity-creaking-unfreeze, + entity-creaking-spawn, + entity-creaking-sway, + entity-creaking-twitch, + block-creaking-heart-break, + block-creaking-heart-fall, + block-creaking-heart-hit, + block-creaking-heart-hurt, + block-creaking-heart-place, + block-creaking-heart-step, + block-creaking-heart-idle, + block-creaking-heart-spawn, + entity-creeper-death, + entity-creeper-hurt, + entity-creeper-primed, + block-crop-break, + item-crop-plant, + item-crossbow-hit, + item-crossbow-loading-end, + item-crossbow-loading-middle, + item-crossbow-loading-start, + item-crossbow-quick-charge-1, + item-crossbow-quick-charge-2, + item-crossbow-quick-charge-3, + item-crossbow-shoot, + block-deadbush-idle, + block-decorated-pot-break, + block-decorated-pot-fall, + block-decorated-pot-hit, + block-decorated-pot-insert, + block-decorated-pot-insert-fail, + block-decorated-pot-step, + block-decorated-pot-place, + block-decorated-pot-shatter, + block-deepslate-bricks-break, + block-deepslate-bricks-fall, + block-deepslate-bricks-hit, + block-deepslate-bricks-place, + block-deepslate-bricks-step, + block-deepslate-break, + block-deepslate-fall, + block-deepslate-hit, + block-deepslate-place, + block-deepslate-step, + block-deepslate-tiles-break, + block-deepslate-tiles-fall, + block-deepslate-tiles-hit, + block-deepslate-tiles-place, + block-deepslate-tiles-step, + block-dispenser-dispense, + block-dispenser-fail, + block-dispenser-launch, + entity-dolphin-ambient, + entity-dolphin-ambient-water, + entity-dolphin-attack, + entity-dolphin-death, + entity-dolphin-eat, + entity-dolphin-hurt, + entity-dolphin-jump, + entity-dolphin-play, + entity-dolphin-splash, + entity-dolphin-swim, + entity-donkey-ambient, + entity-donkey-angry, + entity-donkey-chest, + entity-donkey-death, + entity-donkey-eat, + entity-donkey-hurt, + entity-donkey-jump, + block-dried-ghast-break, + block-dried-ghast-step, + block-dried-ghast-fall, + block-dried-ghast-ambient, + block-dried-ghast-ambient-water, + block-dried-ghast-place, + block-dried-ghast-place-in-water, + block-dried-ghast-transition, + block-dripstone-block-break, + block-dripstone-block-step, + block-dripstone-block-place, + block-dripstone-block-hit, + block-dripstone-block-fall, + block-dry-grass-ambient, + block-pointed-dripstone-break, + block-pointed-dripstone-step, + block-pointed-dripstone-place, + block-pointed-dripstone-hit, + block-pointed-dripstone-fall, + block-pointed-dripstone-land, + block-pointed-dripstone-drip-lava, + block-pointed-dripstone-drip-water, + block-pointed-dripstone-drip-lava-into-cauldron, + block-pointed-dripstone-drip-water-into-cauldron, + block-big-dripleaf-tilt-down, + block-big-dripleaf-tilt-up, + entity-drowned-ambient, + entity-drowned-ambient-water, + entity-drowned-death, + entity-drowned-death-water, + entity-drowned-hurt, + entity-drowned-hurt-water, + entity-drowned-shoot, + entity-drowned-step, + entity-drowned-swim, + item-dye-use, + entity-egg-throw, + entity-elder-guardian-ambient, + entity-elder-guardian-ambient-land, + entity-elder-guardian-curse, + entity-elder-guardian-death, + entity-elder-guardian-death-land, + entity-elder-guardian-flop, + entity-elder-guardian-hurt, + entity-elder-guardian-hurt-land, + item-elytra-flying, + block-enchantment-table-use, + block-ender-chest-close, + block-ender-chest-open, + entity-ender-dragon-ambient, + entity-ender-dragon-death, + entity-dragon-fireball-explode, + entity-ender-dragon-flap, + entity-ender-dragon-growl, + entity-ender-dragon-hurt, + entity-ender-dragon-shoot, + entity-ender-eye-death, + entity-ender-eye-launch, + entity-enderman-ambient, + entity-enderman-death, + entity-enderman-hurt, + entity-enderman-scream, + entity-enderman-stare, + entity-enderman-teleport, + entity-endermite-ambient, + entity-endermite-death, + entity-endermite-hurt, + entity-endermite-step, + entity-ender-pearl-throw, + block-end-gateway-spawn, + block-end-portal-frame-fill, + block-end-portal-spawn, + entity-evoker-ambient, + entity-evoker-cast-spell, + entity-evoker-celebrate, + entity-evoker-death, + entity-evoker-fangs-attack, + entity-evoker-hurt, + entity-evoker-prepare-attack, + entity-evoker-prepare-summon, + entity-evoker-prepare-wololo, + entity-experience-bottle-throw, + entity-experience-orb-pickup, + block-eyeblossom-open-long, + block-eyeblossom-open, + block-eyeblossom-close-long, + block-eyeblossom-close, + block-eyeblossom-idle, + block-fence-gate-close, + block-fence-gate-open, + item-firecharge-use, + block-firefly-bush-idle, + entity-firework-rocket-blast, + entity-firework-rocket-blast-far, + entity-firework-rocket-large-blast, + entity-firework-rocket-large-blast-far, + entity-firework-rocket-launch, + entity-firework-rocket-shoot, + entity-firework-rocket-twinkle, + entity-firework-rocket-twinkle-far, + block-fire-ambient, + block-fire-extinguish, + entity-fish-swim, + entity-fishing-bobber-retrieve, + entity-fishing-bobber-splash, + entity-fishing-bobber-throw, + item-flintandsteel-use, + block-flowering-azalea-break, + block-flowering-azalea-fall, + block-flowering-azalea-hit, + block-flowering-azalea-place, + block-flowering-azalea-step, + entity-fox-aggro, + entity-fox-ambient, + entity-fox-bite, + entity-fox-death, + entity-fox-eat, + entity-fox-hurt, + entity-fox-screech, + entity-fox-sleep, + entity-fox-sniff, + entity-fox-spit, + entity-fox-teleport, + block-suspicious-sand-break, + block-suspicious-sand-step, + block-suspicious-sand-place, + block-suspicious-sand-hit, + block-suspicious-sand-fall, + block-suspicious-gravel-break, + block-suspicious-gravel-step, + block-suspicious-gravel-place, + block-suspicious-gravel-hit, + block-suspicious-gravel-fall, + block-froglight-break, + block-froglight-fall, + block-froglight-hit, + block-froglight-place, + block-froglight-step, + block-frogspawn-step, + block-frogspawn-break, + block-frogspawn-fall, + block-frogspawn-hatch, + block-frogspawn-hit, + block-frogspawn-place, + entity-frog-ambient, + entity-frog-death, + entity-frog-eat, + entity-frog-hurt, + entity-frog-lay-spawn, + entity-frog-long-jump, + entity-frog-step, + entity-frog-tongue, + block-roots-break, + block-roots-step, + block-roots-place, + block-roots-hit, + block-roots-fall, + block-furnace-fire-crackle, + entity-generic-big-fall, + entity-generic-burn, + entity-generic-death, + entity-generic-drink, + entity-generic-eat, + entity-generic-explode, + entity-generic-extinguish-fire, + entity-generic-hurt, + entity-generic-small-fall, + entity-generic-splash, + entity-generic-swim, + entity-ghast-ambient, + entity-ghast-death, + entity-ghast-hurt, + entity-ghast-scream, + entity-ghast-shoot, + entity-ghast-warn, + entity-ghastling-ambient, + entity-ghastling-death, + entity-ghastling-hurt, + entity-ghastling-spawn, + block-gilded-blackstone-break, + block-gilded-blackstone-fall, + block-gilded-blackstone-hit, + block-gilded-blackstone-place, + block-gilded-blackstone-step, + block-glass-break, + block-glass-fall, + block-glass-hit, + block-glass-place, + block-glass-step, + item-glow-ink-sac-use, + entity-glow-item-frame-add-item, + entity-glow-item-frame-break, + entity-glow-item-frame-place, + entity-glow-item-frame-remove-item, + entity-glow-item-frame-rotate-item, + entity-glow-squid-ambient, + entity-glow-squid-death, + entity-glow-squid-hurt, + entity-glow-squid-squirt, + entity-goat-ambient, + entity-goat-death, + entity-goat-eat, + entity-goat-hurt, + entity-goat-long-jump, + entity-goat-milk, + entity-goat-prepare-ram, + entity-goat-ram-impact, + entity-goat-horn-break, + entity-goat-screaming-ambient, + entity-goat-screaming-death, + entity-goat-screaming-eat, + entity-goat-screaming-hurt, + entity-goat-screaming-long-jump, + entity-goat-screaming-milk, + entity-goat-screaming-prepare-ram, + entity-goat-screaming-ram-impact, + entity-goat-step, + item-golden-dandelion-use, + item-golden-dandelion-unuse, + block-grass-break, + block-grass-fall, + block-grass-hit, + block-grass-place, + block-grass-step, + block-gravel-break, + block-gravel-fall, + block-gravel-hit, + block-gravel-place, + block-gravel-step, + block-grindstone-use, + block-growing-plant-crop, + entity-guardian-ambient, + entity-guardian-ambient-land, + entity-guardian-attack, + entity-guardian-death, + entity-guardian-death-land, + entity-guardian-flop, + entity-guardian-hurt, + entity-guardian-hurt-land, + block-hanging-roots-break, + block-hanging-roots-fall, + block-hanging-roots-hit, + block-hanging-roots-place, + block-hanging-roots-step, + block-hanging-sign-step, + block-hanging-sign-break, + block-hanging-sign-fall, + block-hanging-sign-hit, + block-hanging-sign-place, + entity-happy-ghast-ambient, + entity-happy-ghast-death, + entity-happy-ghast-hurt, + entity-happy-ghast-riding, + block-heavy-core-break, + block-heavy-core-fall, + block-heavy-core-hit, + block-heavy-core-place, + block-heavy-core-step, + block-nether-wood-hanging-sign-step, + block-nether-wood-hanging-sign-break, + block-nether-wood-hanging-sign-fall, + block-nether-wood-hanging-sign-hit, + block-nether-wood-hanging-sign-place, + block-bamboo-wood-hanging-sign-step, + block-bamboo-wood-hanging-sign-break, + block-bamboo-wood-hanging-sign-fall, + block-bamboo-wood-hanging-sign-hit, + block-bamboo-wood-hanging-sign-place, + block-trial-spawner-break, + block-trial-spawner-step, + block-trial-spawner-place, + block-trial-spawner-hit, + block-trial-spawner-fall, + block-trial-spawner-spawn-mob, + block-trial-spawner-about-to-spawn-item, + block-trial-spawner-spawn-item, + block-trial-spawner-spawn-item-begin, + block-trial-spawner-detect-player, + block-trial-spawner-ominous-activate, + block-trial-spawner-ambient, + block-trial-spawner-ambient-ominous, + block-trial-spawner-open-shutter, + block-trial-spawner-close-shutter, + block-trial-spawner-eject-item, + entity-happy-ghast-equip, + entity-happy-ghast-unequip, + entity-happy-ghast-harness-goggles-up, + entity-happy-ghast-harness-goggles-down, + item-hoe-till, + entity-hoglin-ambient, + entity-hoglin-angry, + entity-hoglin-attack, + entity-hoglin-converted-to-zombified, + entity-hoglin-death, + entity-hoglin-hurt, + entity-hoglin-retreat, + entity-hoglin-step, + block-honey-block-break, + block-honey-block-fall, + block-honey-block-hit, + block-honey-block-place, + block-honey-block-slide, + block-honey-block-step, + item-honeycomb-wax-on, + item-honey-bottle-drink, + item-goat-horn-sound-0, + item-goat-horn-sound-1, + item-goat-horn-sound-2, + item-goat-horn-sound-3, + item-goat-horn-sound-4, + item-goat-horn-sound-5, + item-goat-horn-sound-6, + item-goat-horn-sound-7, + entity-horse-ambient, + entity-baby-horse-ambient, + entity-horse-angry, + entity-baby-horse-angry, + entity-horse-armor, + item-horse-armor-unequip, + entity-horse-breathe, + entity-baby-horse-breathe, + entity-horse-death, + entity-baby-horse-death, + entity-horse-eat, + entity-baby-horse-eat, + entity-horse-gallop, + entity-horse-hurt, + entity-baby-horse-hurt, + entity-horse-jump, + entity-horse-land, + entity-baby-horse-land, + entity-horse-saddle, + entity-horse-step, + entity-baby-horse-step, + entity-horse-step-wood, + entity-hostile-big-fall, + entity-hostile-death, + entity-hostile-hurt, + entity-hostile-small-fall, + entity-hostile-splash, + entity-hostile-swim, + entity-husk-ambient, + entity-husk-converted-to-zombie, + entity-husk-death, + entity-husk-hurt, + entity-husk-step, + entity-illusioner-ambient, + entity-illusioner-cast-spell, + entity-illusioner-death, + entity-illusioner-hurt, + entity-illusioner-mirror-move, + entity-illusioner-prepare-blindness, + entity-illusioner-prepare-mirror, + item-ink-sac-use, + block-iron-break, + block-iron-step, + block-iron-place, + block-iron-hit, + block-iron-fall, + block-iron-door-close, + block-iron-door-open, + entity-iron-golem-attack, + entity-iron-golem-damage, + entity-iron-golem-death, + entity-iron-golem-hurt, + entity-iron-golem-repair, + entity-iron-golem-step, + block-iron-trapdoor-close, + block-iron-trapdoor-open, + entity-item-frame-add-item, + entity-item-frame-break, + entity-item-frame-place, + entity-item-frame-remove-item, + entity-item-frame-rotate-item, + entity-item-break, + entity-item-pickup, + block-ladder-break, + block-ladder-fall, + block-ladder-hit, + block-ladder-place, + block-ladder-step, + block-lantern-break, + block-lantern-fall, + block-lantern-hit, + block-lantern-place, + block-lantern-step, + block-large-amethyst-bud-break, + block-large-amethyst-bud-place, + block-lava-ambient, + block-lava-extinguish, + block-lava-pop, + block-leaf-litter-break, + block-leaf-litter-step, + block-leaf-litter-place, + block-leaf-litter-hit, + block-leaf-litter-fall, + item-lead-untied, + item-lead-tied, + item-lead-break, + block-lever-click, + entity-lightning-bolt-impact, + entity-lightning-bolt-thunder, + entity-lingering-potion-throw, + entity-llama-ambient, + entity-llama-angry, + entity-llama-chest, + entity-llama-death, + entity-llama-eat, + entity-llama-hurt, + entity-llama-spit, + entity-llama-step, + entity-llama-swag, + item-llama-carpet-unequip, + entity-magma-cube-death-small, + block-lodestone-break, + block-lodestone-step, + block-lodestone-place, + block-lodestone-hit, + block-lodestone-fall, + item-lodestone-compass-lock, + item-spear-lunge-1, + item-spear-lunge-2, + item-spear-lunge-3, + item-mace-smash-air, + item-mace-smash-ground, + item-mace-smash-ground-heavy, + entity-magma-cube-death, + entity-magma-cube-hurt, + entity-magma-cube-hurt-small, + entity-magma-cube-jump, + entity-magma-cube-squish, + entity-magma-cube-squish-small, + block-mangrove-roots-break, + block-mangrove-roots-fall, + block-mangrove-roots-hit, + block-mangrove-roots-place, + block-mangrove-roots-step, + block-medium-amethyst-bud-break, + block-medium-amethyst-bud-place, + block-metal-break, + block-metal-fall, + block-metal-hit, + block-metal-place, + block-metal-pressure-plate-click-off, + block-metal-pressure-plate-click-on, + block-metal-step, + entity-minecart-inside-underwater, + entity-minecart-inside, + entity-minecart-riding, + entity-mooshroom-convert, + entity-mooshroom-eat, + entity-mooshroom-milk, + entity-mooshroom-suspicious-milk, + entity-mooshroom-shear, + block-moss-carpet-break, + block-moss-carpet-fall, + block-moss-carpet-hit, + block-moss-carpet-place, + block-moss-carpet-step, + block-pink-petals-break, + block-pink-petals-fall, + block-pink-petals-hit, + block-pink-petals-place, + block-pink-petals-step, + block-moss-break, + block-moss-fall, + block-moss-hit, + block-moss-place, + block-moss-step, + block-mud-break, + block-mud-fall, + block-mud-hit, + block-mud-place, + block-mud-step, + block-mud-bricks-break, + block-mud-bricks-fall, + block-mud-bricks-hit, + block-mud-bricks-place, + block-mud-bricks-step, + block-muddy-mangrove-roots-break, + block-muddy-mangrove-roots-fall, + block-muddy-mangrove-roots-hit, + block-muddy-mangrove-roots-place, + block-muddy-mangrove-roots-step, + entity-mule-ambient, + entity-mule-angry, + entity-mule-chest, + entity-mule-death, + entity-mule-eat, + entity-mule-hurt, + entity-mule-jump, + music-creative, + music-credits, + music-disc-5, + music-disc-11, + music-disc-13, + music-disc-blocks, + music-disc-cat, + music-disc-chirp, + music-disc-far, + music-disc-lava-chicken, + music-disc-mall, + music-disc-mellohi, + music-disc-pigstep, + music-disc-stal, + music-disc-strad, + music-disc-wait, + music-disc-ward, + music-disc-otherside, + music-disc-relic, + music-disc-creator, + music-disc-creator-music-box, + music-disc-precipice, + music-disc-tears, + music-dragon, + music-end, + music-game, + music-menu, + music-nether-basalt-deltas, + music-nether-crimson-forest, + music-overworld-deep-dark, + music-overworld-dripstone-caves, + music-overworld-grove, + music-overworld-jagged-peaks, + music-overworld-lush-caves, + music-overworld-swamp, + music-overworld-forest, + music-overworld-old-growth-taiga, + music-overworld-meadow, + music-overworld-cherry-grove, + music-nether-nether-wastes, + music-overworld-frozen-peaks, + music-overworld-snowy-slopes, + music-nether-soul-sand-valley, + music-overworld-stony-peaks, + music-nether-warped-forest, + music-overworld-flower-forest, + music-overworld-desert, + music-overworld-badlands, + music-overworld-jungle, + music-overworld-sparse-jungle, + music-overworld-bamboo-jungle, + music-under-water, + entity-nautilus-ambient, + entity-nautilus-ambient-land, + entity-nautilus-dash, + entity-nautilus-dash-land, + entity-nautilus-dash-ready, + entity-nautilus-dash-ready-land, + entity-nautilus-death, + entity-nautilus-death-land, + entity-nautilus-eat, + entity-nautilus-hurt, + entity-nautilus-hurt-land, + entity-nautilus-swim, + block-nether-bricks-break, + block-nether-bricks-step, + block-nether-bricks-place, + block-nether-bricks-hit, + block-nether-bricks-fall, + block-nether-wart-break, + item-nether-wart-plant, + block-nether-wood-break, + block-nether-wood-fall, + block-nether-wood-hit, + block-nether-wood-place, + block-nether-wood-step, + block-nether-wood-door-close, + block-nether-wood-door-open, + block-nether-wood-trapdoor-close, + block-nether-wood-trapdoor-open, + block-nether-wood-button-click-off, + block-nether-wood-button-click-on, + block-nether-wood-pressure-plate-click-off, + block-nether-wood-pressure-plate-click-on, + block-nether-wood-fence-gate-close, + block-nether-wood-fence-gate-open, + intentionally-empty, + block-packed-mud-break, + block-packed-mud-fall, + block-packed-mud-hit, + block-packed-mud-place, + block-packed-mud-step, + block-stem-break, + block-stem-step, + block-stem-place, + block-stem-hit, + block-stem-fall, + block-nylium-break, + block-nylium-step, + block-nylium-place, + block-nylium-hit, + block-nylium-fall, + block-nether-sprouts-break, + block-nether-sprouts-step, + block-nether-sprouts-place, + block-nether-sprouts-hit, + block-nether-sprouts-fall, + block-fungus-break, + block-fungus-step, + block-fungus-place, + block-fungus-hit, + block-fungus-fall, + block-weeping-vines-break, + block-weeping-vines-step, + block-weeping-vines-place, + block-weeping-vines-hit, + block-weeping-vines-fall, + block-wart-block-break, + block-wart-block-step, + block-wart-block-place, + block-wart-block-hit, + block-wart-block-fall, + block-netherite-block-break, + block-netherite-block-step, + block-netherite-block-place, + block-netherite-block-hit, + block-netherite-block-fall, + block-netherrack-break, + block-netherrack-step, + block-netherrack-place, + block-netherrack-hit, + block-netherrack-fall, + block-note-block-basedrum, + block-note-block-bass, + block-note-block-bell, + block-note-block-chime, + block-note-block-flute, + block-note-block-guitar, + block-note-block-harp, + block-note-block-hat, + block-note-block-pling, + block-note-block-snare, + block-note-block-trumpet, + block-note-block-trumpet-exposed, + block-note-block-trumpet-oxidized, + block-note-block-trumpet-weathered, + block-note-block-xylophone, + block-note-block-iron-xylophone, + block-note-block-cow-bell, + block-note-block-didgeridoo, + block-note-block-bit, + block-note-block-banjo, + block-note-block-imitate-zombie, + block-note-block-imitate-skeleton, + block-note-block-imitate-creeper, + block-note-block-imitate-ender-dragon, + block-note-block-imitate-wither-skeleton, + block-note-block-imitate-piglin, + entity-ocelot-hurt, + entity-ocelot-ambient, + entity-ocelot-death, + item-ominous-bottle-dispose, + entity-painting-break, + entity-painting-place, + block-pale-hanging-moss-idle, + entity-panda-pre-sneeze, + entity-panda-sneeze, + entity-panda-ambient, + entity-panda-death, + entity-panda-eat, + entity-panda-step, + entity-panda-cant-breed, + entity-panda-aggressive-ambient, + entity-panda-worried-ambient, + entity-panda-hurt, + entity-panda-bite, + entity-parched-ambient, + entity-parched-death, + entity-parched-hurt, + entity-parched-step, + entity-parrot-ambient, + entity-parrot-death, + entity-parrot-eat, + entity-parrot-fly, + entity-parrot-hurt, + entity-parrot-imitate-blaze, + entity-parrot-imitate-bogged, + entity-parrot-imitate-breeze, + entity-parrot-imitate-camel-husk, + entity-parrot-imitate-creaking, + entity-parrot-imitate-creeper, + entity-parrot-imitate-drowned, + entity-parrot-imitate-elder-guardian, + entity-parrot-imitate-ender-dragon, + entity-parrot-imitate-endermite, + entity-parrot-imitate-evoker, + entity-parrot-imitate-ghast, + entity-parrot-imitate-guardian, + entity-parrot-imitate-hoglin, + entity-parrot-imitate-husk, + entity-parrot-imitate-illusioner, + entity-parrot-imitate-magma-cube, + entity-parrot-imitate-phantom, + entity-parrot-imitate-parched, + entity-parrot-imitate-piglin, + entity-parrot-imitate-piglin-brute, + entity-parrot-imitate-pillager, + entity-parrot-imitate-ravager, + entity-parrot-imitate-shulker, + entity-parrot-imitate-silverfish, + entity-parrot-imitate-skeleton, + entity-parrot-imitate-slime, + entity-parrot-imitate-spider, + entity-parrot-imitate-stray, + entity-parrot-imitate-vex, + entity-parrot-imitate-vindicator, + entity-parrot-imitate-warden, + entity-parrot-imitate-witch, + entity-parrot-imitate-wither, + entity-parrot-imitate-wither-skeleton, + entity-parrot-imitate-zoglin, + entity-parrot-imitate-zombie, + entity-parrot-imitate-zombie-horse, + entity-parrot-imitate-zombie-nautilus, + entity-parrot-imitate-zombie-villager, + entity-parrot-step, + entity-phantom-ambient, + entity-phantom-bite, + entity-phantom-death, + entity-phantom-flap, + entity-phantom-hurt, + entity-phantom-swoop, + entity-pig-saddle, + entity-pig-step, + entity-baby-pig-step, + entity-baby-pig-ambient, + entity-baby-pig-eat, + entity-baby-pig-hurt, + entity-baby-pig-death, + entity-pig-ambient, + entity-pig-hurt, + entity-pig-death, + entity-pig-eat, + entity-pig-mini-ambient, + entity-pig-mini-hurt, + entity-pig-mini-death, + entity-pig-mini-eat, + entity-pig-big-ambient, + entity-pig-big-hurt, + entity-pig-big-death, + entity-pig-big-eat, + entity-piglin-admiring-item, + entity-piglin-ambient, + entity-piglin-angry, + entity-piglin-celebrate, + entity-piglin-death, + entity-piglin-jealous, + entity-piglin-hurt, + entity-piglin-retreat, + entity-piglin-step, + entity-piglin-converted-to-zombified, + entity-piglin-brute-ambient, + entity-piglin-brute-angry, + entity-piglin-brute-death, + entity-piglin-brute-hurt, + entity-piglin-brute-step, + entity-piglin-brute-converted-to-zombified, + entity-pillager-ambient, + entity-pillager-celebrate, + entity-pillager-death, + entity-pillager-hurt, + block-piston-contract, + block-piston-extend, + entity-player-attack-crit, + entity-player-attack-knockback, + entity-player-attack-nodamage, + entity-player-attack-strong, + entity-player-attack-sweep, + entity-player-attack-weak, + entity-player-big-fall, + entity-player-breath, + entity-player-burp, + entity-player-death, + entity-player-hurt, + entity-player-hurt-drown, + entity-player-hurt-freeze, + entity-player-hurt-on-fire, + entity-player-hurt-sweet-berry-bush, + entity-player-levelup, + entity-player-small-fall, + entity-player-splash, + entity-player-splash-high-speed, + entity-player-swim, + entity-player-teleport, + entity-polar-bear-ambient, + entity-polar-bear-ambient-baby, + entity-polar-bear-death, + entity-polar-bear-hurt, + entity-polar-bear-step, + entity-polar-bear-warning, + block-polished-deepslate-break, + block-polished-deepslate-fall, + block-polished-deepslate-hit, + block-polished-deepslate-place, + block-polished-deepslate-step, + block-portal-ambient, + block-portal-travel, + block-portal-trigger, + block-powder-snow-break, + block-powder-snow-fall, + block-powder-snow-hit, + block-powder-snow-place, + block-powder-snow-step, + entity-puffer-fish-blow-out, + entity-puffer-fish-blow-up, + entity-puffer-fish-death, + entity-puffer-fish-flop, + entity-puffer-fish-hurt, + entity-puffer-fish-sting, + block-pumpkin-carve, + entity-rabbit-ambient, + entity-rabbit-attack, + entity-rabbit-death, + entity-rabbit-hurt, + entity-rabbit-jump, + event-raid-horn, + entity-ravager-ambient, + entity-ravager-attack, + entity-ravager-celebrate, + entity-ravager-death, + entity-ravager-hurt, + entity-ravager-step, + entity-ravager-stunned, + entity-ravager-roar, + block-nether-gold-ore-break, + block-nether-gold-ore-fall, + block-nether-gold-ore-hit, + block-nether-gold-ore-place, + block-nether-gold-ore-step, + block-nether-ore-break, + block-nether-ore-fall, + block-nether-ore-hit, + block-nether-ore-place, + block-nether-ore-step, + block-redstone-torch-burnout, + block-resin-break, + block-resin-fall, + block-resin-place, + block-resin-step, + block-resin-bricks-break, + block-resin-bricks-fall, + block-resin-bricks-hit, + block-resin-bricks-place, + block-resin-bricks-step, + block-respawn-anchor-ambient, + block-respawn-anchor-charge, + block-respawn-anchor-deplete, + block-respawn-anchor-set-spawn, + block-rooted-dirt-break, + block-rooted-dirt-fall, + block-rooted-dirt-hit, + block-rooted-dirt-place, + block-rooted-dirt-step, + entity-salmon-ambient, + entity-salmon-death, + entity-salmon-flop, + entity-salmon-hurt, + block-sand-break, + block-sand-fall, + block-sand-hit, + block-sand-place, + block-sand-step, + block-sand-idle, + block-scaffolding-break, + block-scaffolding-fall, + block-scaffolding-hit, + block-scaffolding-place, + block-scaffolding-step, + block-sculk-spread, + block-sculk-charge, + block-sculk-break, + block-sculk-fall, + block-sculk-hit, + block-sculk-place, + block-sculk-step, + block-sculk-catalyst-bloom, + block-sculk-catalyst-break, + block-sculk-catalyst-fall, + block-sculk-catalyst-hit, + block-sculk-catalyst-place, + block-sculk-catalyst-step, + block-sculk-sensor-clicking, + block-sculk-sensor-clicking-stop, + block-sculk-sensor-break, + block-sculk-sensor-fall, + block-sculk-sensor-hit, + block-sculk-sensor-place, + block-sculk-sensor-step, + block-sculk-shrieker-break, + block-sculk-shrieker-fall, + block-sculk-shrieker-hit, + block-sculk-shrieker-place, + block-sculk-shrieker-shriek, + block-sculk-shrieker-step, + block-sculk-vein-break, + block-sculk-vein-fall, + block-sculk-vein-hit, + block-sculk-vein-place, + block-sculk-vein-step, + entity-sheep-ambient, + entity-sheep-death, + entity-sheep-hurt, + entity-sheep-shear, + entity-sheep-step, + item-shears-snip, + block-shelf-activate, + block-shelf-break, + block-shelf-deactivate, + block-shelf-fall, + block-shelf-hit, + block-shelf-multi-swap, + block-shelf-place, + block-shelf-place-item, + block-shelf-single-swap, + block-shelf-step, + block-shelf-take-item, + item-shield-block, + item-shield-break, + block-shroomlight-break, + block-shroomlight-step, + block-shroomlight-place, + block-shroomlight-hit, + block-shroomlight-fall, + item-shovel-flatten, + entity-shulker-ambient, + block-shulker-box-close, + block-shulker-box-open, + entity-shulker-bullet-hit, + entity-shulker-bullet-hurt, + entity-shulker-close, + entity-shulker-death, + entity-shulker-hurt, + entity-shulker-hurt-closed, + entity-shulker-open, + entity-shulker-shoot, + entity-shulker-teleport, + entity-silverfish-ambient, + entity-silverfish-death, + entity-silverfish-hurt, + entity-silverfish-step, + entity-skeleton-ambient, + entity-skeleton-converted-to-stray, + entity-skeleton-death, + entity-skeleton-horse-ambient, + entity-skeleton-horse-death, + entity-skeleton-horse-hurt, + entity-skeleton-horse-swim, + entity-skeleton-horse-ambient-water, + entity-skeleton-horse-gallop-water, + entity-skeleton-horse-jump-water, + entity-skeleton-horse-step-water, + entity-skeleton-hurt, + entity-skeleton-shoot, + entity-skeleton-step, + entity-slime-attack, + entity-slime-death, + entity-slime-hurt, + entity-slime-jump, + entity-slime-squish, + block-slime-block-break, + block-slime-block-fall, + block-slime-block-hit, + block-slime-block-place, + block-slime-block-step, + block-small-amethyst-bud-break, + block-small-amethyst-bud-place, + block-small-dripleaf-break, + block-small-dripleaf-fall, + block-small-dripleaf-hit, + block-small-dripleaf-place, + block-small-dripleaf-step, + block-soul-sand-break, + block-soul-sand-step, + block-soul-sand-place, + block-soul-sand-hit, + block-soul-sand-fall, + block-soul-soil-break, + block-soul-soil-step, + block-soul-soil-place, + block-soul-soil-hit, + block-soul-soil-fall, + particle-soul-escape, + block-spawner-break, + block-spawner-fall, + block-spawner-hit, + block-spawner-place, + block-spawner-step, + item-spear-use, + item-spear-hit, + item-spear-attack, + item-spear-wood-use, + item-spear-wood-hit, + item-spear-wood-attack, + block-spore-blossom-break, + block-spore-blossom-fall, + block-spore-blossom-hit, + block-spore-blossom-place, + block-spore-blossom-step, + entity-strider-ambient, + entity-strider-happy, + entity-strider-retreat, + entity-strider-death, + entity-strider-hurt, + entity-strider-step, + entity-strider-step-lava, + entity-strider-eat, + entity-strider-saddle, + entity-slime-death-small, + entity-slime-hurt-small, + entity-slime-jump-small, + entity-slime-squish-small, + block-smithing-table-use, + block-smoker-smoke, + entity-sniffer-step, + entity-sniffer-eat, + entity-sniffer-idle, + entity-sniffer-hurt, + entity-sniffer-death, + entity-sniffer-drop-seed, + entity-sniffer-scenting, + entity-sniffer-sniffing, + entity-sniffer-searching, + entity-sniffer-digging, + entity-sniffer-digging-stop, + entity-sniffer-happy, + block-sniffer-egg-plop, + block-sniffer-egg-crack, + block-sniffer-egg-hatch, + entity-snowball-throw, + block-snow-break, + block-snow-fall, + entity-snow-golem-ambient, + entity-snow-golem-death, + entity-snow-golem-hurt, + entity-snow-golem-shoot, + entity-snow-golem-shear, + block-snow-hit, + block-snow-place, + block-snow-step, + entity-spider-ambient, + entity-spider-death, + entity-spider-hurt, + entity-spider-step, + entity-splash-potion-break, + entity-splash-potion-throw, + block-sponge-break, + block-sponge-fall, + block-sponge-hit, + block-sponge-place, + block-sponge-step, + block-sponge-absorb, + item-spyglass-use, + item-spyglass-stop-using, + entity-squid-ambient, + entity-squid-death, + entity-squid-hurt, + entity-squid-squirt, + block-stone-break, + block-stone-button-click-off, + block-stone-button-click-on, + block-stone-fall, + block-stone-hit, + block-stone-place, + block-stone-pressure-plate-click-off, + block-stone-pressure-plate-click-on, + block-stone-step, + entity-stray-ambient, + entity-stray-death, + entity-stray-hurt, + entity-stray-step, + block-sweet-berry-bush-break, + block-sweet-berry-bush-place, + block-sweet-berry-bush-pick-berries, + entity-tadpole-death, + entity-tadpole-flop, + entity-tadpole-grow-up, + entity-tadpole-hurt, + enchant-thorns-hit, + entity-tnt-primed, + item-totem-use, + item-trident-hit, + item-trident-hit-ground, + item-trident-return, + item-trident-riptide-1, + item-trident-riptide-2, + item-trident-riptide-3, + item-trident-throw, + item-trident-thunder, + block-tripwire-attach, + block-tripwire-click-off, + block-tripwire-click-on, + block-tripwire-detach, + entity-tropical-fish-ambient, + entity-tropical-fish-death, + entity-tropical-fish-flop, + entity-tropical-fish-hurt, + block-tuff-break, + block-tuff-step, + block-tuff-place, + block-tuff-hit, + block-tuff-fall, + block-tuff-bricks-break, + block-tuff-bricks-fall, + block-tuff-bricks-hit, + block-tuff-bricks-place, + block-tuff-bricks-step, + block-polished-tuff-break, + block-polished-tuff-fall, + block-polished-tuff-hit, + block-polished-tuff-place, + block-polished-tuff-step, + entity-turtle-ambient-land, + entity-turtle-death, + entity-turtle-death-baby, + entity-turtle-egg-break, + entity-turtle-egg-crack, + entity-turtle-egg-hatch, + entity-turtle-hurt, + entity-turtle-hurt-baby, + entity-turtle-lay-egg, + entity-turtle-shamble, + entity-turtle-shamble-baby, + entity-turtle-swim, + ui-button-click, + ui-loom-select-pattern, + ui-loom-take-result, + ui-cartography-table-take-result, + ui-stonecutter-take-result, + ui-stonecutter-select-recipe, + ui-toast-challenge-complete, + ui-toast-in, + ui-toast-out, + block-vault-activate, + block-vault-ambient, + block-vault-break, + block-vault-close-shutter, + block-vault-deactivate, + block-vault-eject-item, + block-vault-reject-rewarded-player, + block-vault-fall, + block-vault-hit, + block-vault-insert-item, + block-vault-insert-item-fail, + block-vault-open-shutter, + block-vault-place, + block-vault-step, + entity-vex-ambient, + entity-vex-charge, + entity-vex-death, + entity-vex-hurt, + entity-villager-ambient, + entity-villager-celebrate, + entity-villager-death, + entity-villager-hurt, + entity-villager-no, + entity-villager-trade, + entity-villager-yes, + entity-villager-work-armorer, + entity-villager-work-butcher, + entity-villager-work-cartographer, + entity-villager-work-cleric, + entity-villager-work-farmer, + entity-villager-work-fisherman, + entity-villager-work-fletcher, + entity-villager-work-leatherworker, + entity-villager-work-librarian, + entity-villager-work-mason, + entity-villager-work-shepherd, + entity-villager-work-toolsmith, + entity-villager-work-weaponsmith, + entity-vindicator-ambient, + entity-vindicator-celebrate, + entity-vindicator-death, + entity-vindicator-hurt, + block-vine-break, + block-vine-fall, + block-vine-hit, + block-vine-place, + block-vine-step, + block-lily-pad-place, + entity-wandering-trader-ambient, + entity-wandering-trader-death, + entity-wandering-trader-disappeared, + entity-wandering-trader-drink-milk, + entity-wandering-trader-drink-potion, + entity-wandering-trader-hurt, + entity-wandering-trader-no, + entity-wandering-trader-reappeared, + entity-wandering-trader-trade, + entity-wandering-trader-yes, + entity-warden-agitated, + entity-warden-ambient, + entity-warden-angry, + entity-warden-attack-impact, + entity-warden-death, + entity-warden-dig, + entity-warden-emerge, + entity-warden-heartbeat, + entity-warden-hurt, + entity-warden-listening, + entity-warden-listening-angry, + entity-warden-nearby-close, + entity-warden-nearby-closer, + entity-warden-nearby-closest, + entity-warden-roar, + entity-warden-sniff, + entity-warden-sonic-boom, + entity-warden-sonic-charge, + entity-warden-step, + entity-warden-tendril-clicks, + block-hanging-sign-waxed-interact-fail, + block-sign-waxed-interact-fail, + block-water-ambient, + weather-end-flash, + weather-rain, + weather-rain-above, + block-wet-grass-break, + block-wet-grass-fall, + block-wet-grass-hit, + block-wet-grass-place, + block-wet-grass-step, + block-wet-sponge-break, + block-wet-sponge-dries, + block-wet-sponge-fall, + block-wet-sponge-hit, + block-wet-sponge-place, + block-wet-sponge-step, + entity-wind-charge-wind-burst, + entity-wind-charge-throw, + entity-witch-ambient, + entity-witch-celebrate, + entity-witch-death, + entity-witch-drink, + entity-witch-hurt, + entity-witch-throw, + entity-wither-ambient, + entity-wither-break-block, + entity-wither-death, + entity-wither-hurt, + entity-wither-shoot, + entity-wither-skeleton-ambient, + entity-wither-skeleton-death, + entity-wither-skeleton-hurt, + entity-wither-skeleton-step, + entity-wither-spawn, + item-wolf-armor-break, + entity-baby-wolf-ambient, + item-wolf-armor-crack, + item-wolf-armor-damage, + item-wolf-armor-repair, + entity-baby-wolf-death, + entity-baby-wolf-growl, + entity-baby-wolf-hurt, + entity-baby-wolf-pant, + entity-wolf-shake, + entity-wolf-step, + entity-baby-wolf-step, + entity-baby-wolf-whine, + entity-wolf-ambient, + entity-wolf-death, + entity-wolf-growl, + entity-wolf-hurt, + entity-wolf-pant, + entity-wolf-whine, + entity-wolf-puglin-ambient, + entity-wolf-puglin-death, + entity-wolf-puglin-growl, + entity-wolf-puglin-hurt, + entity-wolf-puglin-pant, + entity-wolf-puglin-whine, + entity-wolf-sad-ambient, + entity-wolf-sad-death, + entity-wolf-sad-growl, + entity-wolf-sad-hurt, + entity-wolf-sad-pant, + entity-wolf-sad-whine, + entity-wolf-angry-ambient, + entity-wolf-angry-death, + entity-wolf-angry-growl, + entity-wolf-angry-hurt, + entity-wolf-angry-pant, + entity-wolf-angry-whine, + entity-wolf-grumpy-ambient, + entity-wolf-grumpy-death, + entity-wolf-grumpy-growl, + entity-wolf-grumpy-hurt, + entity-wolf-grumpy-pant, + entity-wolf-grumpy-whine, + entity-wolf-big-ambient, + entity-wolf-big-death, + entity-wolf-big-growl, + entity-wolf-big-hurt, + entity-wolf-big-pant, + entity-wolf-big-whine, + entity-wolf-cute-ambient, + entity-wolf-cute-death, + entity-wolf-cute-growl, + entity-wolf-cute-hurt, + entity-wolf-cute-pant, + entity-wolf-cute-whine, + block-wooden-door-close, + block-wooden-door-open, + block-wooden-trapdoor-close, + block-wooden-trapdoor-open, + block-wooden-button-click-off, + block-wooden-button-click-on, + block-wooden-pressure-plate-click-off, + block-wooden-pressure-plate-click-on, + block-wood-break, + block-wood-fall, + block-wood-hit, + block-wood-place, + block-wood-step, + block-wool-break, + block-wool-fall, + block-wool-hit, + block-wool-place, + block-wool-step, + entity-zoglin-ambient, + entity-zoglin-angry, + entity-zoglin-attack, + entity-zoglin-death, + entity-zoglin-hurt, + entity-zoglin-step, + entity-zombie-ambient, + entity-zombie-attack-wooden-door, + entity-zombie-attack-iron-door, + entity-zombie-break-wooden-door, + entity-zombie-converted-to-drowned, + entity-zombie-death, + entity-zombie-destroy-egg, + entity-zombie-horse-ambient, + entity-zombie-horse-angry, + entity-zombie-horse-death, + entity-zombie-horse-eat, + entity-zombie-horse-hurt, + entity-zombie-hurt, + entity-zombie-infect, + entity-zombie-nautilus-ambient, + entity-zombie-nautilus-ambient-land, + entity-zombie-nautilus-dash, + entity-zombie-nautilus-dash-land, + entity-zombie-nautilus-dash-ready, + entity-zombie-nautilus-dash-ready-land, + entity-zombie-nautilus-death, + entity-zombie-nautilus-death-land, + entity-zombie-nautilus-eat, + entity-zombie-nautilus-hurt, + entity-zombie-nautilus-hurt-land, + entity-zombie-nautilus-swim, + entity-zombified-piglin-ambient, + entity-zombified-piglin-angry, + entity-zombified-piglin-death, + entity-zombified-piglin-hurt, + entity-zombie-step, + entity-zombie-villager-ambient, + entity-zombie-villager-converted, + entity-zombie-villager-cure, + entity-zombie-villager-death, + entity-zombie-villager-hurt, + entity-zombie-villager-step, + event-mob-effect-bad-omen, + event-mob-effect-trial-omen, + event-mob-effect-raid-omen, + item-saddle-unequip, + item-nautilus-saddle-underwater-equip, + item-nautilus-saddle-equip, + } +} diff --git a/v0.1/text.wit b/v0.1/text.wit new file mode 100644 index 0000000..cad5d6f --- /dev/null +++ b/v0.1/text.wit @@ -0,0 +1,41 @@ +interface text { + use common.{named-color, rgb-color, argb-color}; + + resource text-component { + text: static func(plain: string) -> text-component; + translate: static func(key: string, %with: list) -> text-component; + + add-child: func(child: text-component); + add-text: func(text: string); + get-text: func() -> string; + encode: func() -> list; + + // Style + + color-named: func(color: named-color); + color-rgb: func(color: rgb-color); + bold: func(value: bool); + italic: func(value: bool); + underlined: func(value: bool); + strikethrough: func(value: bool); + obfuscated: func(value: bool); + /// Text inserted into chat when shift-clicked + insertion: func(text: string); + font: func(font: string); + shadow-color: func(color: argb-color); + + // Click events + + click-open-url: func(url: string); + click-run-command: func(command: string); + click-suggest-command: func(command: string); + click-copy-to-clipboard: func(text: string); + + // Hover events + + hover-show-text: func(text: text-component); + /// Item data as SNBT string + hover-show-item: func(item: string); + hover-show-entity: func(entity-type: string, id: string, name: option); + } +} diff --git a/v0.1/uuid.wit b/v0.1/uuid.wit new file mode 100644 index 0000000..2f3ee42 --- /dev/null +++ b/v0.1/uuid.wit @@ -0,0 +1,16 @@ +interface uuid { + /// A 128-bit UUID represented as two 64-bit integers. + record uuid { + high: u64, + low: u64, + } + + /// Generates a new random v4 UUID. + generate: func() -> uuid; + + /// Parses a UUID from a string. Returns none if the string is not a valid UUID. + parse: func(s: string) -> option; + + /// Converts a UUID to its standard string representation. + to-string: func(id: uuid) -> string; +} diff --git a/v0.1/world.wit b/v0.1/world.wit new file mode 100644 index 0000000..2ecbd69 --- /dev/null +++ b/v0.1/world.wit @@ -0,0 +1,387 @@ +interface %world { + use common.{position, entity-pose, block-pos}; + use block-entity.{block-entity, command-block-entity, block-entity-type}; + use text.{text-component}; + use scoreboard.{scoreboard}; + use particles.{particle}; + use sounds.{sound}; + use entity-types.{entity-type}; + use biomes.{biome}; + use uuid.{uuid}; + + /// Defines how a block reacts when pushed by a piston. + enum piston-behavior { + /// Normal behavior; the block can be pushed and pulled. + normal, + /// The block is destroyed when pushed. + destroy, + /// The block cannot be pushed or pulled. + block, + /// The block is ignored by pistons. + ignore, + /// The block can only be pushed, not pulled. + push-only + } + + /// Categories for sounds to control their volume independently. + enum sound-category { + master, + music, + records, + weather, + blocks, + hostile, + neutral, + players, + ambient, + voice, + } + + /// Defines how an explosion interacts with blocks in the world. + enum explosion-interaction { + /// No interaction with blocks. + none, + /// Blocks are destroyed and may drop loot. + block, + /// Interaction typical for mob-caused explosions. + mob, + /// Interaction typical for TNT explosions. + tnt, + /// Triggers specific block behaviors. + trigger, + } + + /// Flags used to control block updates and notifications. + flags block-flags { + /// Notifies neighbor blocks of the change. + notify-neighbors, + /// Notifies client listeners of the change. + notify-listeners, + /// Forces the block state even if it's the same. + force-state, + /// Skips dropping items when the block is removed. + skip-drops, + /// Indicates the block was moved (e.g., by a piston). + moved, + /// Skips state replacement for redstone wires. + skip-redstone-wire-state-replacement, + /// Skips the callback when a block entity is replaced. + skip-block-entity-replaced-callback, + /// Skips the callback when a block is added. + skip-block-added-callback, + } + + /// Detailed information about a block's state. + record block-state { + /// The internal numerical ID of the block state. + id: u16, + /// The light level emitted by this block (0-15). + luminance: u8, + /// How much light this block blocks. + opacity: u8, + /// The hardness of the block, determining mining speed. + hardness: f32, + /// Whether this block is considered air. + is-air: bool, + /// Whether this block is a liquid. + is-liquid: bool, + /// Whether this block is a solid. + is-solid: bool, + /// Whether this block occupies a full cube. + is-full-cube: bool, + /// How this block behaves when pushed by a piston. + piston-behavior: piston-behavior, + /// Whether this block receives random ticks. + has-random-ticks: bool, + + /// Whether this block can catch fire. + burnable: bool, + /// Whether a specific tool is required to mine this block and get drops. + tool-required: bool, + /// Whether this block has transparency on its sides. + sided-transparency: bool, + /// Whether this block can be replaced by another block (e.g., grass). + replaceable: bool, + /// Whether this block is considered a solid block for redstone purposes. + is-solid-block: bool, + /// The numerical ID of the block entity type, if any. + block-entity-type: u16, + /// The instrument used for note blocks when placed on top of this block. + instrument: noteblock-instrument, + /// The collision shapes of this block. + collision-shapes: list, + /// The outline shapes of this block. + outline-shapes: list, + + /// Whether the bottom side of the block is solid. + down-side-solid: bool, + /// Whether the top side of the block is solid. + up-side-solid: bool, + /// Whether the north side of the block is solid. + north-side-solid: bool, + /// Whether the south side of the block is solid. + south-side-solid: bool, + /// Whether the west side of the block is solid. + west-side-solid: bool, + /// Whether the east side of the block is solid. + east-side-solid: bool, + /// Whether the center of the bottom side is solid. + down-center-solid: bool, + /// Whether the center of the top side is solid. + up-center-solid: bool, + /// The color of this block when displayed on a map. + map-color: u8, + } + + /// Musical instruments used by note blocks. + enum noteblock-instrument { + harp, + basedrum, + snare, + hat, + bass, + flute, + bell, + guitar, + chime, + xylophone, + iron-xylophone, + cow-bell, + didgeridoo, + bit, + banjo, + pling, + trumpet, + trumpet-exposed, + trumpet-oxidized, + trumpet-weathered, + zombie, + skeleton, + creeper, + dragon, + wither-skeleton, + piglin, + custom-head, + } + + /// A simple wrapper for a block state ID. + record block-state-id { + id: u16, + } + + resource entity { + get-id: func() -> u32; + get-uuid: func() -> uuid; + get-type: func() -> entity-type; + + get-position: func() -> position; + get-world: func() -> %world; + + get-yaw: func() -> f32; + get-pitch: func() -> f32; + get-head-yaw: func() -> f32; + + teleport: func(pos: position, world-ref: %world); + set-velocity: func(velocity: position); + get-velocity: func() -> position; + + get-pose: func() -> entity-pose; + get-name: func() -> text-component; + set-custom-name: func(name: text-component); + get-custom-name: func() -> option; + set-custom-name-visible: func(visible: bool); + is-custom-name-visible: func() -> bool; + + is-invulnerable: func() -> bool; + set-invulnerable: func(invulnerable: bool); + + get-fire-ticks: func() -> s32; + set-fire-ticks: func(ticks: s32); + + get-health: func() -> f32; + set-health: func(health: f32); + get-max-health: func() -> f32; + damage: func(amount: f32); + is-dead: func() -> bool; + + get-absorption: func() -> f32; + set-absorption: func(amount: f32); + + get-age: func() -> s32; + set-age: func(age: s32); + + get-fall-distance: func() -> f32; + set-fall-distance: func(distance: f32); + + get-ticks-lived: func() -> s32; + set-ticks-lived: func(ticks: s32); + + is-sneaking: func() -> bool; + set-sneaking: func(sneaking: bool); + is-sprinting: func() -> bool; + set-sprinting: func(sprinting: bool); + is-swimming: func() -> bool; + set-swimming: func(swimming: bool); + is-invisible: func() -> bool; + set-invisible: func(invisible: bool); + is-glowing: func() -> bool; + set-glowing: func(glowing: bool); + is-fall-flying: func() -> bool; + set-fall-flying: func(fall-flying: bool); + + get-width: func() -> f32; + get-height: func() -> f32; + + set-rotation: func(yaw: f32, pitch: f32); + + is-on-ground: func() -> bool; + is-on-fire: func() -> bool; + set-on-fire: func(on-fire: bool); + has-visual-fire: func() -> bool; + set-visual-fire: func(visual-fire: bool); + + get-portal-cooldown: func() -> u32; + set-portal-cooldown: func(cooldown: u32); + + get-remaining-air: func() -> s32; + set-remaining-air: func(air: s32); + get-max-air: func() -> s32; + + send-system-message: func(message: text-component); + + get-eye-height: func() -> f32; + get-eye-position: func() -> position; + + get-nearby-entities: func(x: f64, y: f64, z: f64) -> list; + + get-vehicle: func() -> option; + get-passengers: func() -> list; + add-passenger: func(passenger: entity); + remove-passenger: func(passenger: entity); + eject-passengers: func(); + + get-bounding-box: func() -> bounding-box; + + is-in-water: func() -> bool; + is-in-lava: func() -> bool; + + remove: func(); + + /// Performs a raycast from the entity's eye position in its looking direction. + raycast: func(max-distance: f64, fluid-handling: bool) -> option; + } + + /// Result of a raycast operation. + record raycast-result { + /// The block position that was hit. + pos: block-pos, + /// The face of the block that was hit. + face: block-direction, + } + + /// Represents an axis-aligned bounding box. + record bounding-box { + min: position, + max: position, + } + + /// Represents a cardinal direction or block face. + enum block-direction { + down, + up, + north, + south, + west, + east, + } + + /// Represents a Minecraft world (dimension). + resource %world { + /// Returns the unique identifier of this world. + get-id: func() -> string; + + /// Gets the block state ID at the specified position. + get-block-state-id: func(pos: block-pos) -> u16; + + /// Gets detailed block state information at the specified position. + get-block-state: func(pos: block-pos) -> block-state; + + /// Sets the block state at the specified position. + set-block-state: func(pos: block-pos, state: u16, update-flags: block-flags); + + /// Returns the current time of day in ticks. + get-time-of-day: func() -> u64; + + /// Sets the current time of day in ticks. + set-time-of-day: func(time: u64); + + /// Returns the total age of the world in ticks. + get-world-age: func() -> u64; + + /// Returns the dimension type (e.g., \"minecraft:overworld\"). + get-dimension: func() -> string; + + /// Gets the highest non-air block Y coordinate at the specified X and Z. + get-top-block-y: func(x: s32, z: s32) -> s32; + + /// Gets the highest motion-blocking block Y coordinate. + get-motion-blocking-height: func(x: s32, z: s32) -> s32; + + /// Returns whether it is currently raining or snowing. + is-raining: func() -> bool; + + /// Sets whether it should be raining or snowing. + set-raining: func(raining: bool); + + /// Returns whether there is currently a thunderstorm. + is-thundering: func() -> bool; + + /// Sets whether there should be a thunderstorm. + set-thundering: func(thundering: bool); + + /// Broadcasts a system message to all players in this world. + broadcast-system-message: func(message: text-component, overlay: bool); + + /// Returns the scoreboard associated with this world. + get-scoreboard: func() -> scoreboard; + + /// Plays a sound at the specified position for all players in the world. + play-sound: func(sound: sound, category: sound-category, pos: position, volume: f32, pitch: f32); + + /// Spawns particles at the specified position. + spawn-particle: func(particle: particle, pos: position, offset: position, max-speed: f32, count: s32); + + /// Creates an explosion at the specified position. + create-explosion: func(pos: position, power: f32, create-fire: bool, interaction: explosion-interaction); + + /// Returns the sea level of this world. + get-sea-level: func() -> s32; + + /// Returns the minimum Y coordinate (bottom of the world). + get-min-y: func() -> s32; + + /// Returns the sky light level at the specified position. + get-sky-light: func(pos: block-pos) -> u8; + + /// Sets the sky light level at the specified position. + set-sky-light: func(pos: block-pos, level: u8); + + /// Returns the block light level at the specified position. + get-block-light: func(pos: block-pos) -> u8; + + /// Sets the block light level at the specified position. + set-block-light: func(pos: block-pos, level: u8); + + /// Returns the biome at the specified position. + get-biome: func(pos: block-pos) -> biome; + + /// Spawns an entity of the specified type at the given position. + spawn-entity: func(entity-type: entity-type, pos: position) -> entity; + + /// Returns a list of all entities in this world. + get-entities: func() -> list; + + /// Returns the block entity at the specified position, if any. + get-block-entity: func(pos: block-pos) -> option; + } +}