Source: item.jsdoc

/**
 *
 * @namespace   Item
 * @description Static methods for the Item API.
 *
 *////

/**
 *
 * @memberof    Item
 * @function    addCraftRecipe
 * @description Add a new crafting recipe.
 *
 * @param {int}   id          - the id of the item to make
 * @param {int}   quantity    - the quantity of items to produce
 * @param {int}   damage      - the damage value of the new item
 * @param {int[]} ingredients - the items required to complete the recipe (max 9)
 *                              as an array: [id1, qty1, dmg1, id2, qty2, dmg2, ...]
 *
 * @example
 * // make a diamond sword from 1 coal [263, 1, 0] and 3 torches [50, 3, 0]
 * var ingredients = [
 *   263, 1, 0,
 *   50, 3, 0
 * ];
 * Item.addCraftRecipe(276, 1, 0, ingredients);
 *
 *////

/**
 *
 * @memberof    Item
 * @function    addFurnaceRecipe
 * @description Add a new smelting recipe.
 *
 * @param {int} id     - the id of the item to make
 * @param {int} damage - the damage value of the new item
 * @param {int} source - the source ingredient
 *
 * @example
 * // make a diamond sword from a stick
 * Item.addFurnaceRecipe(276, 0, 280);
 *
 *////

/**
 *
 * @memberof    Item
 * @function    addShapedRecipe
 * @description Add a new smelting recipe.
 *
 * @param {int}               id          - the id of the item to make
 * @param {int}               quantity    - the quantity of items to produce
 * @param {int}               damage      - the damage value of the new item
 * @param {string[]}          keys        - the layout of the ingredient keys
 * @param {Array<string|int>} ingredients - the ingredients
 *
 * @example
 * <caption>Credit: {@link https://goo.gl/ApLbnm|Zhuowei Zhang}</caption>
 *
 * // make an enchantment table
 * var ENCHANTMENT_TABLE_ID = 240;
 * var currentWorkbenchX;
 * var currentWorkbenchY;
 * var currentWorkbenchZ;
 *
 * // define the table block with the textures in the following order:
 * // bottom, top, south, north, west, east
 * // in this case, the side textures are the same, and the top/bottom
 * // textures are different.
 * Block.defineBlock(ENCHANTMENT_TABLE_ID, "Enchantment Table", [
 *   ["enchanting_table_bottom" , 0],
 *   ["enchanting_table_top"    , 0],
 *   ["enchanting_table_side"   , 0],
 *   ["enchanting_table_side"   , 0],
 *   ["enchanting_table_side"   , 0],
 *   ["enchanting_table_side"   , 0]
 * ]);
 * Block.setShape(ENCHANTMENT_TABLE_ID, 0, 0, 0, 1, 3/4, 1);
 * Block.setDestroyTime(ENCHANTMENT_TABLE_ID, 1);
 *
 * // add the shaped recipe to build the table
 * Item.addShapedRecipe(
 *   // the item we're making
 *   ENCHANTMENT_TABLE_ID, 1, 0,
 *   // the keys in the shape of the recipe
 *   [
 *     " b ",
 *     "dod",
 *     "ooo"
 *   ],
 *   // specify what each character represents.
 *   // b = book, d = diamond, o = obsidian
 *   [
 *     "b", 340, 0,
 *     "d", 264, 0,
 *     "o", 49, 0
 *   ]
 * );
 *
 *////

/**
 *
 * @memberof    Item
 * @function    defineArmor
 * @description Define custom armor.
 *
 * @param {int}    id           - the new, unique item id (see: {@tutorial item-ids})
 * @param {string} iconName     - the name of the icon to use for this item
 * @param {int}    iconIndex    - the index of the icon to use for this item
 * @param {string} name         - the name of the new armor item
 * @param {string} texture      - the texture to use for this item
 * @param {int}    damageReduce - how much damage is taken when hit
 * @param {int}    maxDamage    - the maximum amount of damage the item can sustain
 * @param {int}    type         - the type of armor this item is
 *
 * @example
 * <caption>Credit: {@link https://goo.gl/sTc5jr|Zhuowei Zhang}</caption>
 *
 * // WOOT! Zombie armor!
 * Item.defineArmor(410 , "empty_armor_slot_helmet"     , 0 , "Zombie mask"  , "mob/zombie.png" , 1 , 10 , ArmorType.helmet);
 * Item.defineArmor(411 , "empty_armor_slot_chestplate" , 0 , "Zombie shirt" , "mob/zombie.png" , 1 , 10 , ArmorType.chestplate);
 * Item.defineArmor(412 , "empty_armor_slot_leggings"   , 0 , "Zombie pants" , "mob/zombie.png" , 1 , 10 , ArmorType.leggings);
 * Item.defineArmor(413 , "empty_armor_slot_boots"      , 0 , "Zombie shoes" , "mob/zombie.png" , 1 , 10 , ArmorType.boots);
 * function procCmd(cmd) {
 *   if (cmd == "zombiegear") {
 *     addItemInventory(411, 1);
 *     addItemInventory(412, 1);
 *     addItemInventory(413, 1);
 *     addItemInventory(414, 1);
 *   }
 * }
 *
 *////

/**
 *
 * @memberof    Item
 * @function    getName
 * @description Return the name of an item.
 *
 * @param {int}     id          - the item id
 * @param {int}     [data=null] - additional data to describe item such as damage
 *                                or sub-item
 * @param {boolean} [raw=false] - if the returned data should be in the raw form
 *
 * @return {string}             - the item name
 *
 * @example
 * // get data in raw form
 * clientMessage(Item.getName(263, 0, true)); // prints "item.coal.name"
 * // get data in normal form
 * clientMessage(Item.getName(263, 0, false)); // prints "Coal"
 * clientMessage(Item.getName(263, 1));        // prints "Charcoal" (item 263:1)
 *
 *////

/**
 *
 * @memberof    Item
 * @function    isValidItem
 * @description Determine if an item is valid.
 *
 * @param {int} id   - the item id
 *
 * @return {boolean} - true if the item is valid, false otherwise
 *
 * @example
 * // see if coal is a valid item
 * if (Item.isValidItem(263)) {
 *   clientMessage("Yay, let's make torches!");
 * }
 *
 *////

/**
 *
 * @memberof    Item
 * @function    setCategory
 * @description Set the category for an item which will determine where
 *              it appears in the crafting table interface, as well as
 *              how it can be used (e.g., food can be eaten).
 *
 * @param {int} id       - the id of the item to change
 * @param {int} category - the new category the item will be assigned to
 *
 * @see {@link ItemCategory}
 *
 * @example
 * // coal can be food, right?
 * Item.setCategory(263, ItemCategory.FOOD);
 *
 *////

/**
 *
 * @memberof    Item
 * @function    setHandEquipped
 * @description Set an item to render as a tool.
 *
 * @param {int}     id             - the item id
 * @param {boolean} isHandEquipped - whether or not the item should be set as hand equipped
 *
 * @example
 * // make custom item hand equipable
 * var MY_CUSTOM_ITEM_ID = 220;
 * Item.setHandEquipped(MY_CUSTOM_ITEM_ID, true);
 *
 *////

/**
 *
 * @memberof    Item
 * @function    setMaxDamage
 * @description Set the amount of damage an item can sustain when used
 *              (i.e., the number of times it can be used before it breaks).
 *
 * @param {int} id     - the item id
 * @param {int} damage - the maximum damage
 *
 * @example
 * // who says wooden pick axes are useless?
 * Item.setMaxDamage(270, 10000);
 *
 *////

/**
 *
 * @memberof    Item
 * @function    setProperties
 * @description Set custom propertires for an item using the same format as found
 *              in the items.json file.
 *
 * @param {int}    id         - the item ID
 * @param {Object} properties - an object literal describing the new properties
 *
 * @example
 * <caption>Credit: {@link https://goo.gl/E0FnzE|Zhuowei Zhang}</caption>
 *
 * // make zombie shoes edible
 * Item.defineArmor(4014, "empty_armor_slot_boots", 0, "Zombie shoes", "mob/zombie.png", 1, 10, ArmorType.boots);
 * Item.setCategory(4014, ItemCategory.FOOD);
 * Player.addItemCreativeInv(4014, 1, 0);
 *
 * var shoesNutrition = 4;
 *
 * // anything that can be specified in items.json can be specified here
 * Item.setProperties(4014, {
 *   "use_animation": "eat",
 *   "use_duration": 32,
 *   "food": {
 *     "nutrition": shoesNutrition,
 *     "saturation_modifier": "low",
 *     "is_meat": false
 *   }
 * });
 *
 *////