Files
Pumpkin/pumpkin-plugin-wit/v0.1.0/entity.wit
Bjorn Beishline 576d76dfd6 feat: add wasm plugin api (#1675)
* feat: wasm plugin api base

* fix: make metadata macro work

* chore: fix clippy lints

* Implement guest registering of events

* chore: remove hardcoded v0.1.0  dep in wasm_host

* feat: add events to wasm

* feat: add caching of components

* fix: clippy lints

* chore: update Cargo.lock

* fix: add feature flag for link section

* feat: add base for command wit definitions

* feat: implement arg variants for command wit interface

* feat: add commented out command-tree arg variant

* feat: add wit definitions for text-component and command tree

Introduces the text interface with a builder-pattern resource,
argument-type variant, command-node resource, and register-command
on context. Migrates event and command-sender to use the new
text-component resource.

* feat: add stubs for wasm host

* chore: update wasmtime to v42

* feat: implement three methods of wit textcomponent

* Add consume function

* feat: implement all text-component host methods

Replace todo!() stubs with working implementations for all
HostTextComponent trait methods: style setters, click events,
hover events, add_text, get_text, and encode.

* feat: allow events to be modified

* feat: add some of base for commands

* chore: fix spelling mistake

* chore: remove unused dep

* feat: implement all argument-type to consumer mappings

* Add command exports

* log plugin load errors

* Some commands work

* Some more Commands work

* Update how commands are registered

* Implement locale

* Use handler id with require

* chore: fix some warnings

* Add PlayerLeaveEvent

* chore: fix all clippy warnings

* fix: add more descriptive error message

---------

Co-authored-by: Purdze <r.s.sutton@hotmail.co.uk>
Co-authored-by: Alexander Medvedev <lilalexmed@proton.me>
2026-03-09 18:12:48 +01:00

37 lines
1.3 KiB
Plaintext

interface entity {
use common.{block-position};
resource block-entity {
resource-location: func() -> string;
get-position: func() -> block-position;
get-id: func() -> u32;
// write-nbt: func(nbt: nbt-compound);
// from-nbt: func(nbt: nbt-compound, position: block-position) -> entity;
// tick: func(world: simple-world);
// write-internal: func(nbt: nbt-compound);
// chunk-data-nbt: func() -> option<nbt-compound;
// get-inventory: func() -> option<inventory>;
// set-block-state: func(block-state: block-state-id);
// on-block-replaced: func(world: simple-world, position: block-position);
is-dirty: func() -> bool;
clear-dirty: func();
// to-property-delegate: func() -> option<property-delegate>;
// to-experience-container: func() -> option<experience-container>;
}
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;
}
variant entity {
command-block-entity(command-block-entity),
}
}