Başvuru
Bu sayfa İngilizce gösteriliyor.
custom-blocks
Custom blocks with a model of their own from the server's resource pack, including passable and multi-state blocks.
Declarations from the script contract strawberry:plugin, version 0.2.0, without source comments.
WIT declarations
use %world.{%world};
use common.{block-pos};
record carrier {
instrument: string,
note: u8,
powered: bool,
}
register: func(key: string) -> result<carrier, string>;
place: func(world-ref: borrow<%world>, pos: block-pos, key: string) -> result<_, string>;
id-at: func(world-ref: borrow<%world>, pos: block-pos) -> option<string>;
enum tool-kind {
pickaxe,
axe,
shovel,
hoe,
}
enum tool-tier {
any,
stone,
iron,
diamond,
}
record block-settings {
hardness: f32,
blast-resistance: f32,
tool: option<tool-kind>,
tier: tool-tier,
requires-tool: bool,
sounds-like: option<string>,
place-sound: option<string>,
pushable: bool,
}
enum block-shape {
cube,
passable,
}
record tripwire-carrier {
attached: bool,
disarmed: bool,
east: bool,
north: bool,
powered: bool,
south: bool,
west: bool,
}
variant carrier-state {
note-block(carrier),
tripwire(tripwire-carrier),
}
register-states: func(key: string, shape: block-shape, states: u16) -> result<list<carrier-state>, string>;
place-state: func(world-ref: borrow<%world>, pos: block-pos, key: string, state: u16) -> result<_, string>;
state-at: func(world-ref: borrow<%world>, pos: block-pos) -> option<u16>;
configure: func(key: string, settings: block-settings) -> result<_, string>;
record block-support {
survives-on: list<string>,
needs-solid-top: bool,
}
configure-support: func(key: string, support: option<block-support>) -> result<_, string>;
set-light: func(key: string, level: u8) -> result<_, string>;