Skip to content

content ​

INFO

Анықтаманың өзі ағылшын тілінде: ол WIT файлдарынан автоматты түрде жасалады.

(0.3) Content a mod declares in [content] of mod.toml and the numeric ids the world gave it, plus cosmetics: a server mod puts one of its own cosmetics on a player and the modded clients draw it.

Package blockheads:api@0.3.1 · Lua table bh.content · WIT source

Uses: types.{api-error}, players.{player}

Types ​

kind enum ​

A kind of content.

CaseDescription
blockA block.
itemAn item.
cosmeticA cosmetic (hat, shirt, pants, shoes, hair, weapon skin).

cosmetic-info record ​

A cosmetic of a loaded mod.

FieldTypeDescription
keystring<mod-id>:<name>.
mod-idstringThe mod that declares it.
slotstringhat, shirt, pants, shoes, hair or weapon.
idoption<u32>The world's id; none on hosts that keep no registry.

Functions ​

id-of function ​

txt
id-of: func(kind: kind, key: string) -> option<u32>;

The id this world gave a declared key; none for an unknown key or on hosts without a registry.

key-of function ​

txt
key-of: func(kind: kind, id: u32) -> option<string>;

The key of an id; none when unknown.

cosmetics function ​

txt
cosmetics: func() -> list<cosmetic-info>;

The cosmetics of all loaded mods.

equipped function ​

txt
equipped: func(who: borrow<player>) -> result<list<tuple<string, string>>, api-error>;

What a player wears as (slot, key) pairs.

equip function ​

txt
equip: func(who: borrow<player>, key: string) -> result<_, api-error>;

Puts one of the calling mod's cosmetics on a player, replacing the one in its slot. Other mods' keys give not-permitted, unknown keys invalid-argument, a player who left stale-handle; clients get unsupported.

unequip function ​

txt
unequip: func(who: borrow<player>, slot: string) -> result<_, api-error>;

Takes the cosmetic of slot off a player.

Ресми емес қауымдастық жобасы. Majic Jungle Software немесе Noodlecake компанияларымен байланысы жоқ. Ойын файлдары қамтылмаған.