feat(plugin-api): add entity api

This commit is contained in:
Alexander Medvedev committed 2026-04-15 18:10:51 +02:00
1 parent 9012a92287
commit b31f8a0fdd
15 files changed
+547 -112

No files matched your search

@@ -0,0 +1,36 @@
interface block-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 block-entity-type {
command-block-entity(command-block-entity),
}
}