Tidy 5e Sheets API
    Preparing search index...

    Class ItemConfigApi

    APIs related to the configuration of items.

    Index
    • Registers a custom group of equipment types, to be rendered on the item sheet as their own section of options within the Equipment Type input.

      Parameters

      Returns void

      Hooks.once('tidy5e-sheet.ready', (api) => {
      api.config.item.registerCustomEquipmentTypeGroup({
      label: 'Helmet',
      types: {
      clothhat: 'Clothings Helmet',
      lighthat: 'Light Helmet',
      mediumhat: 'Medium Helmet',
      heavyhat: 'Heavy Helmet',
      },
      });
      });
    • Registers a custom description, to be rendered on the item sheet.

      Parameters

      Returns void

      Hooks.once('tidy5e-sheet.ready', (api) => {
      api.config.item.registerDescription({
      id: 'my-curse-description',
      label: 'Curse Details',
      itemTypes: ['weapon', 'equipment', 'tool', 'loot'],
      visible: (item) => game.user.isGM && foundry.utils.getProperty(item, 'flags.my-example.is-cursed'),
      field: 'flags.my-example.my-curse-description',
      editable: (item) => game.user.isGM,
      });
      });
    • Registers a custom toggle switch to appear in the item sheet sidebar, where other toggles like "Identified," "Equipped," and "Attuned."

      Parameters

      Returns void

      Hooks.once('tidy5e-sheet.ready', (api) => {
      api.config.item.registerToggle?.({
      id: 'cursed-toggle',
      label: 'Cursed',
      icon: 'fa-solid fa-book-skull',
      itemTypes: ['weapon', 'equipment', 'tool', 'loot'],
      editable: () => game.user.isGM,
      field: 'flags.my-example.is-cursed',
      visible: (item) => game.user.isGM,
      });
      });