From f481f5677dd0c36788288378b7b1f650ed2266e9 Mon Sep 17 00:00:00 2001 From: Alexander Medvedev Date: Sat, 29 Aug 2026 20:31:24 +0200 Subject: [PATCH] add more stuff --- v0.1/bedrock-packets.wit | 1211 +++++++++++++++++++++++++++++++++++--- v0.1/entity-statuses.wit | 68 +++ v0.1/event.wit | 1 + v0.1/game-events.wit | 67 +++ v0.1/item-stack.wit | 19 +- v0.1/java-packets.wit | 548 +++++++++++++++-- v0.1/player.wit | 129 +++- v0.1/plugin.wit | 6 + v0.1/potions.wit | 52 ++ v0.1/server.wit | 11 +- v0.1/sounds.wit | 13 + v0.1/world.wit | 24 +- 12 files changed, 2020 insertions(+), 129 deletions(-) create mode 100644 v0.1/entity-statuses.wit create mode 100644 v0.1/game-events.wit create mode 100644 v0.1/potions.wit diff --git a/v0.1/bedrock-packets.wit b/v0.1/bedrock-packets.wit index bfac2d6..a3fd4d4 100644 --- a/v0.1/bedrock-packets.wit +++ b/v0.1/bedrock-packets.wit @@ -4,15 +4,96 @@ interface bedrock-packets { use uuid.{ uuid }; record s-actor-event { target-runtime-id: s64, - event-id: string, + event-id: actor-event-id, data: s32, fire-at-position: option>, } + enum actor-event-id { + none, + jump, + hurt, + death, + start-attacking, + stop-attacking, + taming-failed, + taming-succeeded, + shake-wetness, + eat-grass, + fishhook-bubble, + fishhook-fish-pos, + fishhook-hook-time, + fishhook-tease, + squid-fleeing, + zombie-converting, + play-ambient, + spawn-alive, + start-offer-flower, + stop-offer-flower, + love-hearts, + villager-angry, + villager-happy, + witch-hat-magic, + fireworks-explode, + in-love-hearts, + silverfish-merge-animation, + guardian-attack-sound, + drink-potion, + throw-potion, + prime-tnt-cart, + prime-creeper, + air-supply, + deprecated-add-player-levels, + guardian-mining-fatigue, + agent-swing-arm, + dragon-start-death-anim, + ground-dust, + shake, + feed, + baby-age, + instant-death, + notify-trade, + leash-destroyed, + caravan-updated, + talisman-activate, + deprecated-update-structure-feature, + player-spawned-mob, + puke, + update-stack-size, + start-swimming, + balloon-pop, + treasure-hunt, + summon-agent, + finished-charging-item, + actor-grow-up, + vibration-detected, + drink-milk, + shake-wetness-stop, + kinetic-damage-dealt, + hurt-without-receiving-damage, + } + enum animate-action { + no-action, + swing-arm, + wake-up, + critical-hit, + magic-critical-hit, + } + enum actor-swing-source { + none, + build, + mine, + interact, + attack, + use-item, + throw-item, + drop-item, + event, + } record s-animate { - action: string, + action: animate-action, target-actor-runtime-id: s64, data: f32, - swing-source: option, + swing-source: option, } record s-block-pick-request { position: tuple, @@ -28,10 +109,16 @@ interface bedrock-packets { } record s-command-request { command: string, - origin: string, + origin: command-origin-data, is-internal: bool, version: string, } + record command-origin-data { + r-type: string, + uuid: uuid, + request-id: string, + player-id: s64, + } record s-container-close { container-id: u8, container-type: u8, @@ -50,33 +137,271 @@ interface bedrock-packets { emote-piece-ids: list, } record s-interact { - action: string, + action: action, target-runtime-id: s64, position: option>, } + enum action { + invalid, + stop-riding, + interact-update, + npc-open, + open-inventory, + } + variant inventory-action-source { + container, + %world, + creative, + todo, + unknown(s32), + } + variant transaction-data { + normal(string), + mismatch(string), + use-item(use-item-transaction-data), + use-item-on-entity(use-item-on-entity-transaction-data), + release-item(release-item-transaction-data), + } + record legacy-set-item-slot { + container-id: u8, + slots: list, + } + record inventory-action { + source-type: s32, + window-id: option, + source-flags: option, + inventory-slot: s32, + old-item: network-item-descriptor, + new-item: network-item-descriptor, + } + record use-item-transaction-data { + action-type: s32, + trigger-type: u8, + block-position: tuple, + block-face: u8, + hot-bar-slot: s32, + item-in-hand: network-item-descriptor, + player-position: tuple, + click-position: tuple, + block-runtime-id: s32, + client-prediction: u8, + client-cooldown-state: u8, + } + record use-item-on-entity-transaction-data { + target-entity-runtime-id: s64, + action-type: s32, + hot-bar-slot: s32, + item-in-hand: network-item-descriptor, + player-position: tuple, + click-position: tuple, + } + record release-item-transaction-data { + action-type: s32, + hot-bar-slot: s32, + item-in-hand: network-item-descriptor, + head-position: tuple, + } record s-inventory-transaction { legacy-request-id: s32, - legacy-set-item-slots: list, + legacy-set-item-slots: list, has-value: bool, - actions: list, + actions: list, transaction-type: s32, - transaction-data: string, + transaction-data: transaction-data, + } + record item-stack-request-slot-info { + container-name: full-container-name, + slot-id: u8, + stack-id: s32, + } + record stack-request-item { + identifier: option, + metadata-value: s32, + count: s32, + block-runtime-id: s32, + extra-data: list, + } + record item-stack-request-action-take { + count: u8, + source: item-stack-request-slot-info, + destination: item-stack-request-slot-info, + } + record item-stack-request-action-place { + count: u8, + source: item-stack-request-slot-info, + destination: item-stack-request-slot-info, + } + record item-stack-request-action-swap { + slot1: item-stack-request-slot-info, + slot2: item-stack-request-slot-info, + } + record item-stack-request-action-drop { + count: u8, + source: item-stack-request-slot-info, + randomly: bool, + } + record item-stack-request-action-destroy { + count: u8, + source: item-stack-request-slot-info, + } + record item-stack-request-action-consume { + count: u8, + source: item-stack-request-slot-info, + } + record item-stack-request-action-create { + result-index: u8, + } + record item-stack-request-action-beacon-payment { + primary-effect-id: s32, + secondary-effect-id: s32, + } + record item-stack-request-action-mine-block { + hotbar-slot: s32, + predicted-durability: s32, + stack-id: s32, + } + record item-stack-request-action-craft-recipe { + recipe-id: s32, + repetitions: u8, + } + record item-stack-request-action-craft-recipe-auto { + recipe-id: s32, + repetitions: u8, + } + record item-stack-request-action-craft-creative { + creative-item-id: s32, + repetitions: u8, + } + record item-stack-request-action-optional { + recipe-id: s32, + filter-string-index: s32, + } + record item-stack-request-action-grindstone { + recipe-id: s32, + repair-cost: s32, + repetitions: u8, + } + record item-stack-request-action-loom { + pattern-id: string, + repetitions: u8, + } + record item-stack-request-action-craft-results-deprecated { + result-items: list, + times-crafted: u8, + } + variant item-stack-request-action { + take(item-stack-request-action-take), + place(item-stack-request-action-place), + swap(item-stack-request-action-swap), + drop(item-stack-request-action-drop), + destroy(item-stack-request-action-destroy), + consume(item-stack-request-action-consume), + create(item-stack-request-action-create), + lab-table-combine, + beacon-payment(item-stack-request-action-beacon-payment), + mine-block(item-stack-request-action-mine-block), + craft-recipe(item-stack-request-action-craft-recipe), + craft-recipe-auto(item-stack-request-action-craft-recipe-auto), + craft-creative(item-stack-request-action-craft-creative), + optional(item-stack-request-action-optional), + grindstone(item-stack-request-action-grindstone), + loom(item-stack-request-action-loom), + craft-non-implemented, + craft-results-deprecated(item-stack-request-action-craft-results-deprecated), + } + record item-stack-request { + request-id: s32, + actions: list, + filter-strings: list, + filter-cause: s32, } record s-item-stack-request { - requests: list, + requests: list, } record s-loading-screen { - loading-screen-packet-type: string, + loading-screen-packet-type: loading-screen-packet-type, loading-screen-id: option, } + enum loading-screen-packet-type { + start-loading-screen, + end-loading-screen, + } record s-login { protocol-version: s32, jwt: list, raw-token: list, } + record skin-animation { + frames: f64, + image: string, + image-height: s32, + image-width: s32, + animation-type: s32, + animation-expression: s32, + } + record persona-piece { + is-default: bool, + pack-id: string, + piece-id: string, + piece-type: string, + product-id: string, + } + record persona-piece-tint-colour { + colours: list, + piece-type: string, + } + record client-data { + client-random-id: s64, + device-os: s32, + device-id: string, + game-version: string, + language-code: string, + current-input-mode: s32, + default-input-mode: s32, + ui-profile: s32, + server-address: string, + device-model: string, + gui-scale: s32, + client-is-editor-capable: bool, + client-editor-connection-intent: s32, + max-view-distance: s32, + memory-tier: s32, + platform-type: s32, + graphics-mode: s32, + compatible-with-client-side-chunk-gen: bool, + platform-offline-id: string, + platform-online-id: string, + platform-user-id: string, + self-signed-id: string, + play-fab-id: string, + third-party-name: string, + third-party-name-only: bool, + skin-id: string, + skin-data: string, + skin-image-height: s32, + skin-image-width: s32, + skin-colour: string, + arm-size: string, + persona-skin: bool, + premium-skin: bool, + trusted-skin: bool, + override-skin: bool, + cape-data: string, + cape-id: string, + cape-image-height: s32, + cape-image-width: s32, + cape-on-classic-skin: bool, + skin-geometry: string, + skin-geometry-version: string, + skin-resource-patch: string, + animated-image-data: list, + skin-animation-data: string, + persona-pieces: list, + piece-tint-colours: list, + } record s-mob-equipment { entity-runtime-id: s64, - item: string, + item: network-item-stack-descriptor, slot: u8, selected-slot: u8, container-id: u8, @@ -94,18 +419,61 @@ interface bedrock-packets { } record s-player-action { player-runtime-id: s64, - action: string, + action: player-action-type, block-position: tuple, result-pos: tuple, face: s32, } + enum player-action-type { + unknown, + start-destroy-block, + abort-destroy-block, + stop-destroy-block, + get-updated-block, + drop-item, + start-sleeping, + stop-sleeping, + respawn, + start-jump, + start-sprinting, + stop-sprinting, + start-sneaking, + stop-sneaking, + creative-destroy-block, + change-dimension-ack, + start-gliding, + stop-gliding, + deny-destroy-block, + crack-block, + change-skin, + updated-enchanting-seed, + start-swimming, + stop-swimming, + start-spin-attack, + stop-spin-attack, + interact-with-block, + predict-destroy-block, + continue-destroy-block, + start-item-use-on, + stop-item-use-on, + handled-teleport, + missed-swing, + start-crawling, + stop-crawling, + start-flying, + stop-flying, + client-ack-server-data, + start-using-item, + internal-update, + count, + } record s-player-auth-input { pitch: f32, yaw: f32, position: tuple, - move-vec: string, + move-vec: tuple, head-yaw: f32, - input-data: string, + input-data: list, input-mode: s32, play-mode: s32, interaction-model: s32, @@ -113,23 +481,137 @@ interface bedrock-packets { interact-yaw: f32, tick: s64, delta: tuple, - block-actions: option>, - item-interaction: option, - item-stack-request: option, - vehicle-rotation: option, + block-actions: option>, + item-interaction: option, + item-stack-request: option, + vehicle-rotation: option>, vehicle-unique-id: option, - analog-move: string, + analog-move: tuple, camera-orientation: tuple, - raw-move: string, + raw-move: tuple, + } + record player-inventory-action { + legacy-request-id: s32, + legacy-slots: list, + actions: list, + transaction: player-use-item-transaction-data, + } + record player-use-item-transaction-data { + action-type: s32, + trigger-type: u8, + block-position: tuple, + block-face: u8, + hot-bar-slot: s32, + item-in-hand: network-item-descriptor, + player-position: tuple, + click-position: tuple, + block-runtime-id: s32, + client-prediction: u8, + client-cooldown-state: u8, + } + record player-block-action { + action: s32, + block-pos: tuple, + face: s32, + } + enum input-mode { + mouse, + touch, + game-pad, + motion-controller, + } + enum play-mode { + normal, + teaser, + screen, + exit-level, + num-modes, + } + enum interaction-model { + touch, + crosshair, + classic, + } + enum input-data { + ascend, + descend, + north-jump, + jump-down, + sprint-down, + change-height, + jumping, + auto-jumping-in-water, + sneaking, + sneak-down, + up, + down, + left, + right, + up-left, + up-right, + want-up, + want-down, + want-down-slow, + want-up-slow, + sprinting, + ascend-block, + descend-block, + sneak-toggle-down, + persist-sneak, + start-sprinting, + stop-sprinting, + start-sneaking, + stop-sneaking, + start-swimming, + stop-swimming, + start-jumping, + start-gliding, + stop-gliding, + perform-item-interaction, + perform-block-actions, + perform-item-stack-request, + handled-teleport, + emoting, + missed-swing, + start-crawling, + stop-crawling, + start-flying, + stop-flying, + client-ack-server-data, + client-predicted-vehicle, + paddling-left, + paddling-right, + block-breaking-delay-enabled, + horizontal-collision, + vertical-collision, + down-left, + down-right, + start-using-item, + camera-relative-movement-enabled, + rot-controlled-by-move-direction, + start-spin-attack, + stop-spin-attack, + is-hotbar-touch-only, + jump-released-raw, + jump-pressed-raw, + jump-current-raw, + sneak-released-raw, + sneak-pressed-raw, + sneak-current-raw, + internal-update, } record s-player-hotbar { selected-slot: s32, container-id: u8, should-select-slot: bool, } + variant ability-value { + %bool(bool), + float(f32), + } record s-request-ability { ability: s32, - value: string, + value: ability-value, } record s-request-chunk-radius { chunk-radius: s32, @@ -145,9 +627,14 @@ interface bedrock-packets { } record s-respawn { position: tuple, - state: string, + state: respawn-state, player-runtime-id: s64, } + enum respawn-state { + searching-for-spawn, + ready-to-spawn, + client-ready-to-spawn, + } record s-set-local-player-as-initialized { player-id: s64, } @@ -160,7 +647,7 @@ interface bedrock-packets { } record s-text { needs-translation: bool, - r-type: string, + r-type: text-packet-type, source-name: string, message: string, parameters: list, @@ -168,24 +655,44 @@ interface bedrock-packets { platform-chat-id: string, filtered-message: option, } + enum text-packet-type { + raw, + chat, + translation, + popup, + jukebox-popup, + tip, + system, + whisper, + announcement, + json-whisper, + json, + json-announcement, + } record c-add-actor { target-actor-id: s64, target-runtime-id: s64, actor-type: string, position: tuple, velocity: tuple, - rotation: string, + rotation: tuple, y-head-rotation: f32, y-body-rotation: f32, - attributes-list: list, + attributes-list: list, actor-data: string, - synced-properties: string, - actor-links: list, + synced-properties: property-sync-data, + actor-links: list, + } + record synced-attribute { + attribute-name: string, + min-value: f32, + current-value: f32, + max-value: f32, } record c-add-item-actor { target-actor-id: s64, target-runtime-id: s64, - item: string, + item: item-stack-wrapper, position: tuple, velocity: tuple, entity-data: string, @@ -198,26 +705,66 @@ interface bedrock-packets { platform-chat-id: string, position: tuple, velocity: tuple, - rotation: string, + rotation: tuple, y-head-rotation: f32, - carried-item: string, - player-game-type: string, + carried-item: network-item-stack-descriptor, + player-game-type: game-type, entity-data: string, - synced-properties: string, - abilities-data: string, - actor-links: list, + synced-properties: property-sync-data, + abilities-data: serialized-abilities-data, + actor-links: list, device-id: string, - build-platform: string, + build-platform: build-platform, } record c-available-commands { enum-values: list, chained-subcommand-values: list, post-fixes: list, - enum-data: list, - chained-subcommand-data: list, - commands: list, - soft-enums: list, - constraints: list, + enum-data: list, + chained-subcommand-data: list, + commands: list, + soft-enums: list, + constraints: list, + } + record enum-data { + name: string, + values: list, + } + record chained-subcommand-data { + name: string, + subcommand-values: list, + } + record chained-subcommand-relationship { + index: s32, + value: s32, + } + record command-data { + name: string, + description: string, + %flags: s32, + permission-level: command-permission-level, + alias-enum: s32, + command-data-chained-subcommand-indexes: list, + overloads: list, + } + record overload-data { + is-chaining: bool, + parameter-data: list, + } + record param-data { + name: string, + parse-symbol: s32, + is-optional: bool, + options: u8, + } + record soft-enum-data { + enum-name: string, + enum-options: list, + } + record constrained-value-data { + enum-value-symbol: s32, + enum-symbol: s32, + constraint-indices: list, } record c-block-actor-data { block-position: tuple, @@ -247,8 +794,73 @@ interface bedrock-packets { record c-chunk-radius-updated { chunk-radius: s32, } + record missing-blob-data { + blob-id: s64, + blob-data: list, + } record c-client-cache-miss-response { - missing-blobs: list, + missing-blobs: list, + } + enum build-platform { + unknown, + google, + ios, + osx, + amazon, + gear-vr, + uwp, + win32, + dedicated, + tv-os, + sony, + nx, + xbox, + windows-phone, + linux, + } + enum game-type { + unknown, + survival, + creative, + adventure, + default, + spectator, + } + record serialized-abilities-data { + target-player-raw-id: s64, + player-permissions: player-permission-level, + command-permissions: command-permission-level, + layers: list, + } + enum player-permission-level { + visitor, + member, + operator, + custom, + } + enum command-permission-level { + any, + game-directors, + admin, + host, + owner, + internal, + } + record serialized-abilities-data-serialized-layer { + serialized-layer: s32, + abilities-set: s32, + ability-value: s32, + fly-speed: f32, + vertical-fly-speed: f32, + walk-speed: f32, + } + record actor-link { + ridden-unique-id: s64, + rider-unique-id: s64, + link-type: u8, + immediate: bool, + rider-initiated: bool, + vehicle-angular-velocity: f32, } record c-container-open { container-id: u8, @@ -260,18 +872,72 @@ interface bedrock-packets { prediction-type: u8, pos: tuple, pos-delta: tuple, - rotation: string, + rotation: tuple, vehicle-angular-velocity: option, on-ground: bool, tick: s64, } + record item-descriptor-count { + item-identifier: string, + metadata-value: s32, + count: s32, + } + record recipe-unlock-requirement { + context: s32, + } + record bedrock-shapeless-recipe { + recipe-id: string, + input: list, + output: list, + uuid: uuid, + block: string, + priority: s32, + unlock-requirement: recipe-unlock-requirement, + recipe-network-id: s32, + } + record bedrock-shaped-recipe { + recipe-id: string, + width: s32, + height: s32, + input: list, + output: list, + uuid: uuid, + block: string, + priority: s32, + assume-symmetry: bool, + unlock-requirement: recipe-unlock-requirement, + recipe-network-id: s32, + } + variant bedrock-recipe { + shapeless(bedrock-shapeless-recipe), + shaped(bedrock-shaped-recipe), + } record c-crafting-data { - recipes: list, + recipes: list, clean-recipes: bool, } record c-creative-content { - groups: list, - entries: list, + groups: list, + entries: list, + } + enum creative-category { + all, + construction, + nature, + equipment, + items, + item-command-only, + undefined, + } + record creative-group-info-payload { + creative-category: creative-category, + name: string, + group-icon-item: network-item-descriptor, + } + record creative-item-entry-payload { + id: s32, + item: network-item-descriptor, + group-index: s32, } record c-disconnect { reason: s32, @@ -280,31 +946,64 @@ interface bedrock-packets { filtered-message: string, } record c-gamerules-changed { - rule-data: list, + rule-data: list, + } + record game-rule { + rule-name: string, + rule-can-be-modified: bool, + rule-value: rule-value, + } + enum rule-value { + null, } record c-inventory-content { container-id: s32, - slots: list, - full-container-name: string, - storage-item: string, + slots: list, + full-container-name: full-container-name, + storage-item: network-item-stack-descriptor, } record c-inventory-slot { container-id: s32, slot: s32, - full-container-name: option, - storage-item: option, - item: string, + full-container-name: option, + storage-item: option, + item: network-item-stack-descriptor, } record c-item-registry { - items: list, + items: list, + } + record item-data { + item-name: string, + item-id: s32, + is-component-based: bool, + item-version: s32, + component-data: list, + } + record item-stack-response-slot-info { + requested-slot: u8, + slot: u8, + amount: u8, + item-stack-net-id: s32, + custom-name: string, + filtered-custom-name: string, + durability-correction: s32, + } + record item-stack-response-container-info { + full-container-name: full-container-name, + slots: list, + } + record item-stack-response-info { + %result: u8, + client-request-id: s32, + containers: list, } record c-item-stack-response { - responses: list, + responses: list, } record c-level-chunk { dimension: s32, cache-enabled: bool, - chunk: string, + chunk: list, block-actors: list, } record c-level-event { @@ -312,6 +1011,12 @@ interface bedrock-packets { position: tuple, data: s32, } + enum level-event { + particles-destroy-block, + block-start-break, + block-stop-break, + block-update-break, + } record c-level-sound-event { sound-event: string, position: tuple, @@ -334,7 +1039,7 @@ interface bedrock-packets { } record c-mob-equipment { target-runtime-id: s64, - item: string, + item: network-item-stack-descriptor, slot: u8, selected-slot: u8, container-id: u8, @@ -377,7 +1082,7 @@ interface bedrock-packets { record c-network-chunk-publisher-update { pos-for-view: tuple, new-radius: s32, - server-build-chunk-list: list, + server-build-chunk-list: list>, } record c-network-settings { compression-threshold: s32, @@ -405,7 +1110,52 @@ interface bedrock-packets { } record c-player-list { action: u8, - entries: list, + entries: list, + } + record player-list-entry { + uuid: uuid, + entity-unique-id: s64, + username: string, + xuid: string, + platform-chat-id: string, + build-platform: build-platform, + skin: skin, + is-teacher: bool, + is-host: bool, + is-sub-client: bool, + player-color: list, + } + record skin { + skin-id: string, + play-fab-id: string, + resource-patch: list, + image-width: s32, + image-height: s32, + skin-data: list, + animations: list, + cape-width: s32, + cape-height: s32, + cape-data: list, + geometry-data: list, + animation-data: list, + geometry-data-engine-version: list, + cape-id: string, + full-id: string, + arm-size: string, + skin-color: string, + persona-pieces: list, + piece-tint-colors: list, + is-premium: bool, + is-persona: bool, + persona-cape-on-classic: bool, + is-primary-user: bool, + override-appearance: bool, + is-trusted: bool, + profile-hash: string, + } + record piece-tint-color { + piece-type: string, + colors: list, } record c-remove-actor { target-actor-id: s64, @@ -413,29 +1163,64 @@ interface bedrock-packets { record c-remove-objective { objective-name: string, } + record pack-instance-id { + pack-id: string, + version: string, + sub-pack-name: string, + } record c-resource-pack-stack-packet { texture-pack-required: bool, - texture-pack-list: list, + texture-pack-list: list, base-game-version: string, - experiments: string, + experiments: experiments, include-editor-packs: bool, } + record pack-info-data { + pack-id-version: pack-id-version, + pack-size: s64, + content-key: string, + subpack-name: string, + content-identity: string, + has-scripts: bool, + is-addon-pack: bool, + is-ray-tracing-capable: bool, + cdn-url: string, + } record c-resource-packs-info { resource-pack-required: bool, has-addon-packs: bool, has-scripts: bool, force-disable-vibrant-visuals: bool, - world-template-id-and-version: string, - resource-packs: list, + world-template-id-and-version: pack-id-version, + resource-packs: list, + } + record pack-id-version { + pack-uuid: uuid, + pack-version: string, } record c-set-actor-data { target-runtime-id: s64, actor-data: string, - synced-properties: string, + synced-properties: property-sync-data, tick: s64, } + variant metadata-value { + byte(u8), + short(s32), + int(s32), + float(f32), + %string(string), + compound-tag, + item-pos(tuple), + int64(s64), + vec3(tuple), + } + record property-sync-data { + int-entries-list: list>, + float-entries-list: list>, + } record c-set-actor-link { - link: string, + link: actor-link, } record c-set-actor-motion { target-runtime-id: s64, @@ -456,23 +1241,35 @@ interface bedrock-packets { health: s32, } record c-set-player-game-type { - player-game-type: string, + player-game-type: game-type, } record c-set-score { action: s32, - entries: list, + entries: list, + } + record score-entry { + scoreboard-id: s64, + objective-name: string, + score: s32, + entry-type: s32, + entity-unique-id: s64, + custom-name: string, } record c-set-spawn-position { - spawn-position-type: string, + spawn-position-type: spawn-position-type, block-position: tuple, dimension-type: s32, spawn-block-pos: tuple, } + enum spawn-position-type { + player-respawn, + world-respawn, + } record c-set-time { time: s32, } record c-set-title { - title-type: string, + title-type: title-type, title-text: string, fade-in-time: s32, stay-time: s32, @@ -481,6 +1278,17 @@ interface bedrock-packets { platform-online-id: string, filtered-title-message: string, } + enum title-type { + clear, + reset, + title, + subtitle, + actionbar, + times, + title-text-object, + subtitle-text-object, + actionbar-text-object, + } record c-show-credits { player-runtime-id: s64, credits-state: s32, @@ -488,11 +1296,11 @@ interface bedrock-packets { record c-start-game { entity-id: s64, runtime-entity-id: s64, - player-gamemode: string, + player-gamemode: game-type, position: tuple, pitch: f32, yaw: f32, - level-settings: string, + level-settings: level-settings, level-id: string, level-name: string, premium-world-template-id: string, @@ -513,8 +1321,113 @@ interface bedrock-packets { enable-clientside-generation: bool, blocknetwork-ids-are-hashed: bool, server-auth-sounds: bool, - server-join-information: option, - telemetry: string, + server-join-information: option, + telemetry: server-telemetry-data, + } + record server-join-information { + gathering: option, + store-entry-point: option, + presence: option, + } + record gathering-join-info { + experience-id: uuid, + experience-name: string, + experience-world-id: uuid, + experience-world-name: string, + creator-id: string, + unknown-uuid-1: uuid, + unknown-uuid-2: uuid, + server-id: string, + } + record store-entry-point-info { + store-id: string, + store-name: string, + } + record presence-info { + experience-name: string, + world-name: string, + } + record server-telemetry-data { + server-id: string, + scenario-id: string, + world-id: string, + owner-id: string, + } + record level-settings { + seed: s64, + spawn-biome-type: s32, + custom-biome-name: string, + dimension: s32, + generator-type: s32, + world-gamemode: game-type, + hardcore: bool, + difficulty: s32, + spawn-position: tuple, + has-achievements-disabled: bool, + editor-world-type: s32, + is-created-in-editor: bool, + is-exported-from-editor: bool, + day-cycle-stop-time: s32, + education-edition-offer: s32, + has-education-features-enabled: bool, + education-product-id: string, + rain-level: f32, + lightning-level: f32, + has-confirmed-platform-locked-content: bool, + was-multiplayer-intended: bool, + was-lan-broadcasting-intended: bool, + xbox-live-broadcast-setting: game-publish-setting, + platform-broadcast-setting: game-publish-setting, + commands-enabled: bool, + is-texture-packs-required: bool, + rule-data: list, + experiments: experiments, + bonus-chest: bool, + has-start-with-map-enabled: bool, + permission-level: u8, + server-simulation-distance: s32, + has-locked-behavior-pack: bool, + has-locked-resource-pack: bool, + is-from-locked-world-template: bool, + is-using-msa-gamertags-only: bool, + is-from-world-template: bool, + is-world-template-option-locked: bool, + is-only-spawning-v1-villagers: bool, + is-disabling-personas: bool, + is-disabling-custom-skins: bool, + emote-chat-muted: bool, + game-version: string, + limited-world-width: s32, + limited-world-height: s32, + new-nether: bool, + edu-shared-uri-button-name: string, + edu-shared-uri-link-uri: string, + override-force-experimental-gameplay-has-value: bool, + chat-restriction-level: u8, + disable-player-interactions: bool, + server-editor-connection-policy: s32, + allow-anonymous-block-drops-in-editor-worlds: bool, + } + record experiments { + toggles: list, + experiments-ever-toggled: bool, + } + record experiment-toggle { + name: string, + enabled: bool, + } + enum game-publish-setting { + no-multi-play, + invite-only, + friends-only, + friends-of-friends, + public, + } + record gg { + name: string, + id: u8, + len: s32, + end: u8, } record c-take-item-actor { item-runtime-id: s64, @@ -526,13 +1439,54 @@ interface bedrock-packets { reload-world: bool, } record c-update-abilities { - data: string, + data: serialized-abilities-data, + } + enum ability { + build, + mine, + doors-and-switches, + open-containers, + attack-players, + attack-mobs, + operator-commands, + teleport, + invulnerable, + flying, + may-fly, + instabuild, + lightning, + fly-speed, + walk-speed, + muted, + world-builder, + no-clip, + privileged-builder, + vertical-fly-speed, + ability-count, } record c-update-attributes { target-runtime-id: s64, - attribute-list: list, + attribute-list: list, tick: s64, } + record attribute-data { + min-value: f32, + max-value: f32, + current-value: f32, + default-min-value: f32, + default-max-value: f32, + default-value: f32, + name: string, + modifiers: list, + } + record attribute-modifier { + id: string, + name: string, + amount: f32, + operation: s32, + operand: s32, + is-serializable: bool, + } record c-update-block { block-position: tuple, block-runtime-id: s32, @@ -551,6 +1505,115 @@ interface bedrock-packets { using-economy-trade: bool, data: string, } + record network-item-descriptor { + id: s32, + stack-size: s32, + aux-value: s32, + block-runtime-id: s32, + nbt-data: string, + place-on-blocks: list, + destroy-blocks: list, + shield-blocking-tick: s64, + } + record item-stack-wrapper { + id: s32, + stack-size: s32, + aux-value: s32, + block-runtime-id: s32, + nbt-data: string, + place-on-blocks: list, + destroy-blocks: list, + shield-blocking-tick: s64, + net-id: option, + } + record network-item-stack-descriptor { + id: s32, + stack-size: s32, + aux-value: s32, + block-runtime-id: s32, + extra-data: list, + net-id: option, + } + record full-container-name { + container-name: container-name, + dynamic-id: option, + } + enum container-name { + anvil-input, + anvil-material, + anvil-result-preview, + smithing-table-input, + smithing-table-material, + smithing-table-result-preview, + armor, + level-entity, + beacon-payment, + brewing-stand-input, + brewing-stand-result, + brewing-stand-fuel, + combined-hot-bar-and-inventory, + crafting-input, + crafting-output-preview, + recipe-construction, + recipe-nature, + recipe-items, + recipe-search, + recipe-search-bar, + recipe-equipment, + recipe-book, + enchanting-input, + enchanting-material, + furnace-fuel, + furnace-ingredient, + furnace-result, + horse-equip, + hot-bar, + inventory, + shulker-box, + trade-ingredient1, + trade-ingredient2, + trade-result-preview, + offhand, + compound-creator-input, + compound-creator-output-preview, + element-constructor-output-preview, + material-reducer-input, + material-reducer-output, + lab-table-input, + loom-input, + loom-dye, + loom-material, + loom-result-preview, + blast-furnace-ingredient, + smoker-ingredient, + trade2-ingredient1, + trade2-ingredient2, + trade2-result-preview, + grindstone-input, + grindstone-additional, + grindstone-result-preview, + stonecutter-input, + stonecutter-result-preview, + cartography-input, + cartography-additional, + cartography-result-preview, + barrel, + cursor, + created-output, + smithing-table-template, + crafter-level-entity, + dynamic, + recipe-food, + recipe-blocks, + recipe-furnace-items, + } + record network-item-stack { + id: s32, + count: s32, + aux-value: s32, + block-runtime-id: s32, + extra-data: list, + } variant serverbound-packet { s-actor-event(s-actor-event), s-animate(s-animate), diff --git a/v0.1/entity-statuses.wit b/v0.1/entity-statuses.wit new file mode 100644 index 0000000..8cea92e --- /dev/null +++ b/v0.1/entity-statuses.wit @@ -0,0 +1,68 @@ +package pumpkin:plugin@0.1.0; + +interface entity-statuses { + enum entity-status { + armadillo-peek, + armorstand-wobble, + body-break, + cancel-shake-wetness, + chest-break, + death, + dolphin-looking-for-treasure, + drown-particles, + eat-grass, + end-ram, + feet-break, + fireworks-explode, + fishing-rod-reel-in, + fox-eat, + full-debug-info, + guardian-attack-sound, + head-break, + honey-jump, + honey-slide, + in-love-hearts, + jump, + kinetic-hit, + legs-break, + love-hearts, + mainhand-break, + offer-flower, + offhand-break, + permission-level-admins, + permission-level-all, + permission-level-gamemasters, + permission-level-moderators, + permission-level-owners, + poof, + protected-from-death, + ravager-roared, + ravager-stunned, + reduced-debug-info, + saddle-break, + shake, + shake-wetness, + silverfish-merge-anim, + sniffer-digging-sound, + sonic-charge, + squid-anim-synch, + start-attacking, + start-ram, + stop-attacking, + stop-offer-flower, + swap-hands, + taming-failed, + taming-succeeded, + teleport, + tendrils-shiver, + tnt-prime, + trusting-failed, + trusting-succeeded, + use-item-complete, + villager-angry, + villager-happy, + villager-sweat, + witch-hat-magic, + zombie-converting, + } +} diff --git a/v0.1/event.wit b/v0.1/event.wit index c97280e..1d281d0 100644 --- a/v0.1/event.wit +++ b/v0.1/event.wit @@ -54,6 +54,7 @@ interface event { player: player, message: string, recipients: list, + signature: option>, cancelled: bool } diff --git a/v0.1/game-events.wit b/v0.1/game-events.wit new file mode 100644 index 0000000..0700f43 --- /dev/null +++ b/v0.1/game-events.wit @@ -0,0 +1,67 @@ +package pumpkin:plugin@0.1.0; + +interface game-events { + enum game-event { + block-activate, + block-attach, + block-change, + block-close, + block-deactivate, + block-destroy, + block-detach, + block-open, + block-place, + bounce, + container-close, + container-open, + drink, + eat, + elytra-glide, + entity-damage, + entity-die, + entity-dismount, + entity-interact, + entity-mount, + entity-place, + entity-action, + equip, + explode, + flap, + fluid-pickup, + fluid-place, + hit-ground, + instrument-play, + item-interact-finish, + item-interact-start, + jukebox-play, + jukebox-stop-play, + lightning-strike, + note-block-play, + prime-fuse, + projectile-land, + projectile-shoot, + sculk-sensor-tendrils-clicking, + shear, + shriek, + splash, + step, + swim, + teleport, + unequip, + resonate-1, + resonate-2, + resonate-3, + resonate-4, + resonate-5, + resonate-6, + resonate-7, + resonate-8, + resonate-9, + resonate-10, + resonate-11, + resonate-12, + resonate-13, + resonate-14, + resonate-15, + } +} diff --git a/v0.1/item-stack.wit b/v0.1/item-stack.wit index a806cfb..c1ac95f 100644 --- a/v0.1/item-stack.wit +++ b/v0.1/item-stack.wit @@ -1,6 +1,7 @@ interface item-stack { + use attributes.{attribute, attribute-modifier}; use data-components.{data-component}; - use enchantments.{enchantment}; + use enchantments.{attribute-modifier-slot, enchantment}; use text.{text-component}; /// Represents an enchantment and its level. @@ -15,6 +16,13 @@ interface item-stack { level: u32, } + /// Represents an attribute modifier applied to an item stack for a specific slot. + record item-attribute-modifier { + attribute: attribute, + modifier: attribute-modifier, + slot: attribute-modifier-slot, + } + /// Represents a data component and its serialized value. record data-component-value { component: data-component, @@ -56,6 +64,15 @@ interface item-stack { /// Returns whether this item stack has a specific custom enchantment. has-custom-enchantment: func(enchantment-id: string) -> bool; + /// Returns all attribute modifiers on this item stack. + get-attribute-modifiers: func() -> list; + /// Adds an attribute modifier to this item stack. + add-attribute-modifier: func(modifier: item-attribute-modifier); + /// Removes all attribute modifiers for a specific attribute from this item stack. + remove-attribute-modifiers: func(attribute: attribute); + /// Clears all custom attribute modifiers from this item stack. + clear-attribute-modifiers: func(); + /// Returns the lore of this item stack. get-lore: func() -> list; /// Sets the lore of this item stack. diff --git a/v0.1/java-packets.wit b/v0.1/java-packets.wit index fe255ee..4d3a999 100644 --- a/v0.1/java-packets.wit +++ b/v0.1/java-packets.wit @@ -34,6 +34,17 @@ interface java-packets { record config-s-config-pong { id: s32, } + variant resource-pack-response-result { + download-success, + download-fail, + downloaded, + accepted, + declined, + invalid-url, + reload-failed, + discarded, + unknown(s32), + } record config-s-config-resource-pack { uuid: uuid, %result: s32, @@ -42,6 +53,10 @@ interface java-packets { key: string, payload: option>, } + record s-encryption-response { + shared-secret: list, + verify-token: list, + } record login-s-login-start { name: string, uuid: uuid, @@ -73,11 +88,15 @@ interface java-packets { record s-chat-command { command: string, } + record argument-signature { + name: string, + signature: list, + } record s-chat-command-signed { command: string, timestamp: s64, salt: s64, - argument-signatures: list, + argument-signatures: list, message-count: s32, acknowledged: list, checksum: u8, @@ -99,11 +118,20 @@ interface java-packets { revision: s32, slot: s32, button: u8, - mode: string, + mode: slot-action-type, length-of-array: s32, - array-of-changed-slots: list, + array-of-changed-slots: list>, carried-item: string, } + enum slot-action-type { + pickup, + quick-move, + swap, + clone, + throw, + quick-craft, + pickup-all, + } record s-client-command { action-id: s32, } @@ -124,6 +152,9 @@ interface java-packets { id: s32, command: string, } + record s-confirm-teleport { + teleport-id: s32, + } record s-container-button-click { window-id: s32, button-id: s32, @@ -167,6 +198,11 @@ interface java-packets { hand: option, sneaking: bool, } + enum action-type { + interact, + attack, + interact-at, + } record s-jigsaw-generate { pos: tuple, levels: s32, @@ -217,11 +253,32 @@ interface java-packets { face: u8, sequence: s32, } + enum status { + started-digging, + cancelled-digging, + finished-digging, + drop-item-stack, + drop-item, + release-item-in-use, + swap-item, + spear-jab, + } record s-player-command { entity-id: s32, - action: string, + action: action, jump-boost: s32, } + enum action { + start-sneaking, + stop-sneaking, + leave-bed, + start-sprinting, + stop-sprinting, + start-horse-jump, + stop-horse-jump, + open-vehicle-inventory, + start-flying-elytra, + } record s-set-player-ground { on-ground: bool, } @@ -263,6 +320,17 @@ interface java-packets { record s-rename-item { item-name: string, } + variant play-resource-pack-result { + download-success, + declined, + download-fail, + accepted, + downloaded, + invalid-url, + reload-failed, + discarded, + unknown(s32), + } record s-play-resource-pack { uuid: uuid, %result: s32, @@ -284,6 +352,11 @@ interface java-packets { mode: s32, %flags: u8, } + enum command-block-mode { + chain, + repeating, + impulse, + } record s-set-command-minecart { entity-id: s32, command: string, @@ -293,8 +366,12 @@ interface java-packets { slot: s32, clicked-item: string, } + record game-rule-entry { + game-rule-key: string, + value: string, + } record s-set-game-rule { - entries: list, + entries: list, } record s-set-held-item { slot: s32, @@ -329,9 +406,15 @@ interface java-packets { } record s-set-test-block { position: tuple, - mode: string, + mode: test-block-mode, message: string, } + enum test-block-mode { + start, + log, + fail, + accept, + } record s-spectate-entity { target: uuid, } @@ -343,8 +426,36 @@ interface java-packets { } record s-test-instance-block-action { pos: tuple, - action: string, - data: string, + action: test-instance-block-action, + data: test-instance-block-data, + } + enum test-instance-block-action { + init, + query, + set, + reset, + save, + %export, + run, + } + record var-int-vector3 { + x: s32, + y: s32, + z: s32, + } + record test-instance-block-data { + test: option, + size: var-int-vector3, + rotation: string, + ignore-entities: bool, + status: test-instance-block-status, + error-message: option, + } + enum test-instance-block-status { + cleared, + running, + success, + failed, } record s-update-sign { location: tuple, @@ -389,7 +500,7 @@ interface java-packets { key: string, } record config-c-config-custom-report-details { - details: list, + details: list>, } record config-c-feature-flags { features: list, @@ -431,9 +542,22 @@ interface java-packets { record login-c-login-cookie-request { key: string, } + record c-encryption-request { + server-id: string, + public-key: list, + verify-token: list, + should-authenticate: bool, + } record login-c-login-disconnect { json-reason: string, } + record c-login-success { + uuid: uuid, + username: string, + properties: list, + strict-error-handling: bool, + session-id: uuid, + } record login-c-login-plugin-request { message-id: s32, channel: string, @@ -456,7 +580,12 @@ interface java-packets { prompt-message: option, } record c-award-stats { - stats: list, + stats: list, + } + record statistic { + category-id: s32, + statistic-id: s32, + value: s32, } record c-set-block-destroy-stage { entity-id: s32, @@ -480,7 +609,26 @@ interface java-packets { } record c-boss-event { uuid: uuid, - action: string, + action: bossevent-action, + } + record bossevent-action-add { + title: string, + health: f32, + color: s32, + division: s32, + %flags: u8, + } + record bossevent-action-update-style { + color: s32, + dividers: s32, + } + variant bossevent-action { + add(bossevent-action-add), + remove, + update-health(f32), + update-tile(string), + update-style(bossevent-action-update-style), + update-flags(u8), } record c-center-chunk { chunk-x: s32, @@ -493,8 +641,13 @@ interface java-packets { record c-chunk-batch-end { batch-size: s32, } + record chunk-biome-entry { + chunk-x: s32, + chunk-z: s32, + data: list, + } record c-chunks-biomes { - chunks: list, + chunks: list, } record c-clear-title { reset: bool, @@ -513,12 +666,146 @@ interface java-packets { id: s32, start: s32, length: s32, - matches: list, + matches: list, + } + record command-suggestion { + suggestion: string, + tooltip: option, } record c-commands { - nodes: list, + nodes: list, root-node-index: s32, } + record proto-node { + children: list, + node-type: proto-node-type, + } + record proto-node-type-literal { + name: string, + is-executable: bool, + redirect-target: option, + restricted: bool, + } + record proto-node-type-argument { + name: string, + is-executable: bool, + redirect-target: option, + parser: argument-type, + override-suggestion-type: option, + restricted: bool, + } + variant proto-node-type { + root, + literal(proto-node-type-literal), + argument(proto-node-type-argument), + } + record argument-type-float { + min: option, + max: option, + } + record argument-type-double { + min: option, + max: option, + } + record argument-type-integer { + min: option, + max: option, + } + record argument-type-long { + min: option, + max: option, + } + record argument-type-entity { + %flags: u8, + } + record argument-type-score-holder { + %flags: u8, + } + record argument-type-time { + min: s32, + } + record argument-type-resource-or-tag { + identifier: string, + } + record argument-type-resource-or-tag-key { + identifier: string, + } + record argument-type-resource { + identifier: string, + } + record argument-type-resource-key { + identifier: string, + } + variant argument-type { + %bool, + float(argument-type-float), + double(argument-type-double), + integer(argument-type-integer), + long(argument-type-long), + %string(string-proto-arg-behavior), + entity(argument-type-entity), + game-profile, + block-pos, + column-pos, + vec3, + vec2, + block-state, + block-predicate, + item-stack, + item-predicate, + color, + hex-color, + component, + style, + message, + nbt-compound, + nbt-tag, + nbt-path, + objective, + objective-criteria, + operation, + particle, + angle, + rotation, + scoreboard-slot, + score-holder(argument-type-score-holder), + swizzle, + team, + item-slot, + item-slots, + resource-location, + function, + entity-anchor, + int-range, + float-range, + dimension, + gamemode, + time(argument-type-time), + resource-or-tag(argument-type-resource-or-tag), + resource-or-tag-key(argument-type-resource-or-tag-key), + %resource(argument-type-resource), + resource-key(argument-type-resource-key), + resource-selector, + template-mirror, + template-rotation, + heightmap, + loot-table, + loot-predicate, + loot-modifier, + dialog, + uuid, + } + enum string-proto-arg-behavior { + single-word, + quotable-phrase, + greedy-phrase, + } + enum suggestion-providers { + ask-server, + all-recipes, + available-sounds, + summonable-entities, + } record c-play-cookie-request { key: string, } @@ -531,7 +818,7 @@ interface java-packets { data: list, } record c-play-custom-report-details { - details: list, + details: list>, } record c-damage-event { entity-id: s32, @@ -546,7 +833,7 @@ interface java-packets { value: string, } record c-debug-chunk-value { - chunk-pos: string, + chunk-pos: tuple, name: string, value: string, } @@ -584,10 +871,25 @@ interface java-packets { entity-id: s32, animation: u8, } + enum animation { + swing-main-arm, + leave-bed, + swing-offhand, + critical-effect, + magic-criticaleffect, + } 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, @@ -617,8 +919,24 @@ interface java-packets { event: u8, value: f32, } + enum game-event { + no-respawn-block-available, + begin-raining, + end-raining, + change-game-mode, + win-game, + demo-event, + arrow-hit-player, + rain-level-change, + thunder-level-change, + play-pufferfish-string-sound, + play-elder-guardian-mob-appearance, + enabled-respawn-screen, + limited-crafting, + start-waiting-chunks, + } record c-game-rule-values { - rules: list, + rules: list>, } record c-game-test-highlight-pos { pos: tuple, @@ -660,7 +978,16 @@ interface java-packets { record c-light-update { chunk-x: s32, chunk-z: s32, - light-data: string, + light-data: light-data, + } + record light-data { + trust-edges: bool, + sky-light-mask: list, + block-light-mask: list, + empty-sky-light-mask: list, + empty-block-light-mask: list, + sky-light-arrays: list>, + block-light-arrays: list>, } record c-login { entity-id: s32, @@ -672,7 +999,7 @@ interface java-packets { reduced-debug-info: bool, enabled-respawn-screen: bool, limited-crafting: bool, - spawn-data: string, + spawn-data: player-spawn-data, online-mode: bool, enforce-secure-chat: bool, } @@ -681,20 +1008,53 @@ interface java-packets { scale: u8, tracking-position: bool, locked: bool, - icons: option>, - data: option, + icons: option>, + data: option, + } + record map-icon { + icon-type: s32, + x: u8, + z: u8, + direction: u8, + display-name: option, + } + record map-patch { + columns: u8, + rows: u8, + x: u8, + z: u8, + data: list, + } + record merchant-offer { + base-cost-a: string, + output: string, + cost-b: option, + reward-exp: bool, + uses: s32, + max-uses: s32, + xp: s32, + special-price: s32, + price-multiplier: f32, + demand: s32, } record c-merchant-offers { window-id: s32, - offers: list, + offers: list, villager-level: s32, experience: s32, is-regular-villager: bool, can-restock: bool, } + record minecart-step { + position: tuple, + movement: tuple, + yaw: f32, + pitch: f32, + weight: f32, + } record c-move-minecart-along-track { entity-id: s32, - steps: list, + steps: list, } record c-move-vehicle { x: f64, @@ -704,8 +1064,9 @@ interface java-packets { pitch: f32, } record c-multi-block-update { - chunk-section: s64, - updates: list, + chunk-section: tuple, + suppress-light-updates: bool, + updates: list, string>>, } record c-open-book { hand: s32, @@ -749,6 +1110,26 @@ interface java-packets { flying-speed: f32, field-of-view: f32, } + record player-action-add-player { + name: string, + properties: list, + } + variant player-action { + add-player(player-action-add-player), + initialize-chat(option), + update-game-mode(s32), + update-listed(bool), + update-latency(s32), + update-display-name(option), + update-list-order(s32), + update-hat(bool), + } + record init-chat { + session-id: uuid, + expires-at: s64, + public-key: list, + signature: list, + } record c-player-chat-message { global-index: s32, sender: uuid, @@ -757,23 +1138,36 @@ interface java-packets { message: string, timestamp: s64, salt: s64, - previous-messages: list, + previous-messages: list, unsigned-content: option, - filter-type: string, + filter-type: filter-type, chat-type: s32, sender-name: string, target-name: option, } + record previous-message { + id: s32, + signature: option>, + } + variant filter-type { + pass-through, + fully-filtered, + partially-filtered(list), + } record c-player-info-update { actions: u8, - players: list, + players: list, + } + record player { + uuid: uuid, + actions: list, } record c-player-look-at { from-anchor: s32, target-x: f64, target-y: f64, target-z: f64, - entity: option, + entity: option>, } record c-player-position { teleport-id: s32, @@ -790,6 +1184,17 @@ interface java-packets { yaw: f32, pitch: f32, } + record player-spawn-data { + 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, + } record c-player-spawn-position { dimension-name: string, location: tuple, @@ -833,7 +1238,7 @@ interface java-packets { objective-name: option, } record c-respawn { - player-spawn-info: string, + player-spawn-info: player-spawn-data, data-kept: u8, } record c-select-advancements-tab { @@ -897,7 +1302,7 @@ interface java-packets { } record c-set-equipment { entity-id: s32, - equipment: list, + equipment: list>, } record c-set-experience { progress: f32, @@ -909,6 +1314,9 @@ interface java-packets { food: s32, food-saturation: f32, } + record c-set-selected-slot { + slot: u8, + } record c-set-passengers { entity-id: s32, passengers: list, @@ -917,10 +1325,26 @@ interface java-packets { slot: s32, item: string, } + enum team-method { + create, + remove, + update, + add-players, + remove-players, + } + record team-parameters { + display-name: string, + options: u8, + nametag-visibility: string, + collision-rule: string, + color: s32, + player-prefix: string, + player-suffix: string, + } record c-set-player-team { team-name: string, - method: string, - parameters: option, + method: team-method, + parameters: option, players: list, } record c-set-simulation-distance { @@ -928,7 +1352,7 @@ interface java-packets { } record c-update-time { game-time: s64, - clock-updates: list, + clock-updates: list>, } record c-title-text { title: string, @@ -990,6 +1414,10 @@ interface java-packets { record c-subtitle { subtitle: string, } + record c-system-chat-message { + content: string, + overlay: bool, + } record c-tab-list { header: string, footer: string, @@ -1041,7 +1469,17 @@ interface java-packets { } record c-update-attributes { entity-id: s32, - properties: list, + properties: list, + } + record property { + id: s32, + value: f64, + modifiers: list, + } + record attribute-modifier { + id: string, + amount: f64, + operation: u8, } record c-update-entity-pos { entity-id: s32, @@ -1075,6 +1513,15 @@ interface java-packets { render-type: s32, number-format: option, } + enum mode { + add, + remove, + update, + } + enum render-type { + integer, + hearts, + } record c-update-recipes { raw-data: list, } @@ -1085,13 +1532,40 @@ interface java-packets { display-name: option, number-format: option, } + record c-update-tags-play { + tags: list, + } record c-use-bed { entity-id: s32, location: tuple, } + enum waypoint-operation { + track, + untrack, + update, + } + record waypoint-target-chunk { + x: s32, + z: s32, + } + variant waypoint-target { + position(tuple), + chunk(waypoint-target-chunk), + azimuth(f32), + empty, + } + record waypoint-icon { + style: option, + color: s32, + } + record tracked-waypoint { + identifier: uuid, + icon: option, + target: waypoint-target, + } record c-waypoint { - operation: string, - waypoint: string, + operation: waypoint-operation, + waypoint: tracked-waypoint, } record c-world-event { event: s32, diff --git a/v0.1/player.wit b/v0.1/player.wit index 2d46f4b..cdde343 100644 --- a/v0.1/player.wit +++ b/v0.1/player.wit @@ -1,6 +1,6 @@ /// Represents a player connected to the Minecraft server. interface player { - use common.{hand, position, game-mode}; + use common.{hand, position, game-mode, block-pos}; use item-stack.{item-stack}; use %world.{%world, entity, ray-trace-block-result, ray-trace-entity-result}; use permission.{permission-level}; @@ -17,6 +17,9 @@ interface player { use damage-types.{damage-type}; use statistics.{statistic-category, custom-statistic}; use inventory.{inventory, player-inventory}; + use sounds.{sound, sound-category}; + use particles.{particle}; + use entity-statuses.{entity-status}; /// Represents per-player weather condition overrides. enum player-weather { @@ -37,6 +40,50 @@ interface player { wind-charge, } + /// Types of clientbound game events. + enum client-game-event { + no-respawn-block-available, + begin-raining, + end-raining, + change-game-mode, + win-game, + demo-event, + arrow-hit-player, + rain-level-change, + thunder-level-change, + play-pufferfish-string-sound, + play-elder-guardian-mob-appearance, + enabled-respawn-screen, + limited-crafting, + start-waiting-chunks, + } + + /// Built-in known server link types displayed in the client Escape pause menu. + enum known-server-link { + bug-report, + community-guidelines, + support, + status, + feedback, + community, + website, + forums, + news, + announcements, + } + + /// Label for a server link: either a built-in standard link type or a custom text component. + variant server-link-label { + known(known-server-link), + custom(text-component), + } + + /// Represents a server link entry with a label and destination URL. + record server-link { + label: server-link-label, + url: string, + } + /// Various abilities a player can have. record player-abilities { /// Whether the player is invulnerable to damage. @@ -840,6 +887,10 @@ interface player { /// Sends a system message to the player's chat. send-system-message: func (text: text-component, overlay: bool); + /// Deletes a signed chat message from the player's chat window using its 256-byte signature. + delete-message-by-signature: func (signature: list); + /// Deletes a signed chat message from the player's chat window using its signature cache ID. + delete-message-by-id: func (signature-id: s32); /// Sets the header and footer of the player's Tab list. set-tab-list-header-footer: func (header: text-component, footer: text-component); @@ -860,6 +911,76 @@ interface player { /// Sets the fade-in, stay, and fade-out times for titles. send-title-animation: func (fade-in: s32, stay: s32, fade-out: s32); + // Camera & Spectating + + /// Sets the player's camera to view from the perspective of another entity. + /// If `entity` is `none`, the camera is reset back to the player. + set-camera: func (entity: option); + /// Sets the player's camera to view from the perspective of an entity with the given entity ID. + /// If `entity-id` is the player's own entity ID, the camera is reset back to the player. + set-camera-entity-id: func (entity-id: u32); + /// Gets the entity ID of the entity that the player's camera is currently attached to, + /// or the player's own entity ID if the camera has not been overridden. + get-camera-entity-id: func () -> u32; + /// Resets the player's camera back to their own perspective. + reset-camera: func (); + + // Audio & Particles + + /// Plays a sound effect for this player at their current location. + play-sound: func(sound: sound, category: sound-category, volume: f32, pitch: f32); + /// Plays a sound effect for this player at a specific location. + play-sound-at: func(pos: position, sound: sound, category: sound-category, volume: f32, pitch: f32); + /// Stops a sound effect from playing for this player. + stop-sound: func(sound: option, category: option); + + /// Plays a custom resource pack sound identifier for this player at their current location. + play-custom-sound: func(sound-name: string, category: sound-category, volume: f32, pitch: f32); + /// Plays a custom resource pack sound identifier for this player at a specific location. + play-custom-sound-at: func(pos: position, sound-name: string, category: sound-category, volume: f32, pitch: f32); + /// Stops a custom sound identifier from playing for this player. + stop-custom-sound: func(sound-name: option, category: option); + + /// Spawns particles visible only to this player. + spawn-particles: func(particle: particle, pos: position, count: u32, offset: position, max-speed: f32); + + // Visuals & Client Overrides + + /// Sends a temporary fake block change to the player's client without modifying the server world. + send-block-change: func(pos: block-pos, block-id: u16); + /// Resets a temporary fake block change by resending the actual world block at that position. + reset-block-change: func(pos: block-pos); + + /// Sends a hurt / damage-tilt animation to the player's client (causes screen shake in the given yaw direction). + send-hurt-animation: func(yaw: f32); + + /// Opens a written book interface for the player from the specified hand. + open-book: func(hand: hand); + /// Forces the sign text editor to open for the player at the specified sign block position. + open-sign-editor: func(pos: block-pos, is-front-text: bool); + + // Velocity & Physics + + /// Sets the player's velocity / motion vector. + set-velocity: func(velocity: position); + /// Applies directional knockback impulse to the player. + apply-knockback: func(strength: f64, x: f64, z: f64); + + // Movement Lock & Freezing + + /// Sets whether the player's movement is locked (frozen in place) for cutscenes and NPC dialogues. + set-movement-locked: func(locked: bool); + /// Returns whether the player's movement is currently locked. + is-movement-locked: func() -> bool; + + /// Sets the number of freeze ticks on the player (controlling the powdered snow / frostbite screen vignette). + set-freeze-ticks: func(ticks: s32); + /// Returns the current number of freeze ticks on the player. + get-freeze-ticks: func() -> s32; + + /// Sends custom server links to the player (displayed in the client Esc pause menu in 1.21+). + set-server-links: func(links: list); + // Teleport & kick /// Teleports the player to a position in a world. @@ -1254,6 +1375,12 @@ interface player { /// Kicks the Java player with the specified options. kick: func(options: java-kick-options); + + /// Sends a clientbound GameEvent packet to the Java player. + send-game-event: func(event: client-game-event, value: f32); + + /// Sends an entity status / animation event packet to the Java player for a specific entity ID. + send-entity-status: func(entity-id: s32, status: entity-status); } /// A handle to a player connected via the Bedrock Edition. diff --git a/v0.1/plugin.wit b/v0.1/plugin.wit index 7cc8a49..33ee2b8 100644 --- a/v0.1/plugin.wit +++ b/v0.1/plugin.wit @@ -71,6 +71,12 @@ world plugin { import display; /// Provides game rules definitions and queries. import game-rules; + /// Provides game event types. + import game-events; + /// Provides potion types. + import potions; + /// Provides entity status / animation event types. + import entity-statuses; // --- Plugin-provided exports --- diff --git a/v0.1/potions.wit b/v0.1/potions.wit new file mode 100644 index 0000000..6e97629 --- /dev/null +++ b/v0.1/potions.wit @@ -0,0 +1,52 @@ +package pumpkin:plugin@0.1.0; + +interface potions { + enum potion-type { + water, + mundane, + thick, + awkward, + night-vision, + long-night-vision, + invisibility, + long-invisibility, + leaping, + long-leaping, + strong-leaping, + fire-resistance, + long-fire-resistance, + swiftness, + long-swiftness, + strong-swiftness, + slowness, + long-slowness, + strong-slowness, + turtle-master, + long-turtle-master, + strong-turtle-master, + water-breathing, + long-water-breathing, + healing, + strong-healing, + harming, + strong-harming, + poison, + long-poison, + strong-poison, + regeneration, + long-regeneration, + strong-regeneration, + strength, + long-strength, + strong-strength, + weakness, + long-weakness, + luck, + slow-falling, + long-slow-falling, + wind-charged, + weaving, + oozing, + infested, + } +} diff --git a/v0.1/server.wit b/v0.1/server.wit index a57f0c7..fa78ed6 100644 --- a/v0.1/server.wit +++ b/v0.1/server.wit @@ -1,5 +1,5 @@ interface server { - use player.{player, ban-player-options, ban-ip-options}; + use player.{player, ban-player-options, ban-ip-options, server-link, known-server-link, server-link-label}; use common.{game-mode}; use %world.{%world}; use text.{text-component}; @@ -211,6 +211,12 @@ interface server { /// Broadcasts a system chat message to all players. broadcast: func(message: string); + /// Deletes a signed chat message from all players' chat windows using its 256-byte signature. + delete-message-by-signature: func(signature: list); + + /// Deletes a signed chat message from all players' chat windows using its signature cache ID. + delete-message-by-id: func(signature-id: s32); + /// Broadcasts a tab list header and footer to all players. broadcast-tab-list-header-footer: func(header: text-component, footer: text-component); @@ -273,5 +279,8 @@ interface server { /// Returns the global datapack manager for inspecting, enabling, disabling, and reloading datapacks. get-datapack-manager: func() -> datapack-manager; + + /// Broadcasts custom server links to all connected players (displayed in the client Esc pause menu in 1.21+). + set-server-links: func(links: list); } } diff --git a/v0.1/sounds.wit b/v0.1/sounds.wit index 7c7b507..dead57f 100644 --- a/v0.1/sounds.wit +++ b/v0.1/sounds.wit @@ -1,6 +1,19 @@ package pumpkin:plugin@0.1.0; interface sounds { + enum sound-category { + master, + music, + records, + weather, + blocks, + hostile, + neutral, + players, + ambient, + voice, + ui, + } enum sound { entity-allay-ambient-with-item, entity-allay-ambient-without-item, diff --git a/v0.1/world.wit b/v0.1/world.wit index 034528e..e0e746f 100644 --- a/v0.1/world.wit +++ b/v0.1/world.wit @@ -4,7 +4,7 @@ interface %world { use text.{text-component}; use scoreboard.{scoreboard}; use particles.{particle}; - use sounds.{sound}; + use sounds.{sound, sound-category}; use entity-types.{entity-type}; use biomes.{biome}; use attributes.{attribute, modifier-operation, attribute-modifier}; @@ -224,20 +224,6 @@ interface %world { generic, } - /// 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. @@ -618,6 +604,11 @@ interface %world { /// Sets the specialized mob-specific data for this mob. /// Returns false if the provided data variant is incompatible with this mob. set-mob-data: func(data: mob-data) -> bool; + + /// Sets the number of freeze ticks on this entity (0 to 140). + set-freeze-ticks: func(ticks: s32); + /// Returns the number of freeze ticks currently on this entity. + get-freeze-ticks: func() -> s32; } /// Result of a raycast operation. @@ -876,6 +867,9 @@ interface %world { /// 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); + /// Plays a custom resource pack sound identifier at the specified position for all players in the world. + play-custom-sound: func(sound-name: string, 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);