Examples: Sword
Textures
Item
/* mySword.js */
id = config.getItemId("mySwordId");
name = "mySword";
displayName = "My Sword";
addToCreative = true;
creativeTab = "combat";
damage = 10;
full3d = true;
effectiveBlocks = "30";
harvestBlocks = "30";
efficiency = 6.0;
maxDamage = 200;
maxUsingDuration = 72000;
usingAction = "block";
onHitEntity = "itemstack.damageItem(1);";
onRightClick = "player.setItemInUse();";
onBlockDestroyed = "itemstack.damageItem(2);";
textureFile = "myItems.png";
textureIndex = 0;
mod.js
config.addItemIdProperty("mySwordId", 6000);
mod.addItem("mySword.js", "normal");