Post Template

Templates are predefined models and textures that streamline item creation. Through Nexo Maker’s API, creators can load their own templates directly in the templates window.

How does Templates work

Templates are lightweight objects containing the keys: name, texture, model, and type. Once registered, a template is displayed as a quick-access option for its specified type. Textures and models must be imported using both the loadModel() and loadAsset() loaders. An example can be found in the links above.


Code Examples

module.exports.init = async () => {
  
  const model = await nm.loadModel(
    __dirname + "/assets/mana_potion_small.json"
  );

  const texture = await nm.loadAsset(
    __dirname + "/assets/mana_potion_small.png"
  );

  nm.postTemplate({
    type: "create_item",
    model: model,
    texture: texture,
    title: "Mana Potion",
  });
};

module.exports.metadata = {
  id: "myexpansion",
  version: "0.1",
};
circle-info

Default types are: "create_item", "create_weapon", "create_tool", "create_food", "create_block" and "create_furniture"

Last updated