Skip to content

Namespaced ids ​

You'll learn: how blocks, items and entity types are named. You'll need this when: you add or refer to any content.

Status: Built.

Ids are Minecraft-style: namespace:name.

IdWhose
inventery:stone, inventery:glassthe base game (the inventery namespace)
bedwars:bedthe package whose namespace is bedwars
furniture:oak_tableanother package
  • You add content with the local name; the host adds your namespace:

    ts
    const BED = blocks.add("bed", { hardness: 1 });        // "bedwars:bed"
  • You refer to anything with the full id. A base block may drop the inventery: prefix when you look it up:

    ts
    const STONE = world.blockId("stone");                 // "inventery:stone"
    recipes.add({ ingredients: ["inventery:obsidian", "furniture:oak_table"], result: { item: "bedwars:bed", count: 1 } });
  • inventery and minecraft are reserved. Two packages in one plot can't share a namespace.

  • On the wire, ids are small numbers with a per-scope palette; your code never sees that. A BlockId is a number for the life of the plot's code; look it up again after a restart (top-level code does this for you).

The base set is the engine's. Base block names are the engine's real list (plot/runtime/base-blocks.json): grass_block, red_wool, oak_leaves, bed and bed_head with their _south, _west and _east facings, and the rest. A few older names (grass, wool_red, leaves, end_stone) still resolve to the same blocks. Every base block is also an item (inventery:white_wool), beside the base items (inventery:iron_sword). An unknown name is refused with a hint. Base models for entities (inventery:villager) arrive with pack:base (Planned).

Next ​

Lobbies.