Examples: Sword

Textures

Item

/* mySword.js */
id = config.getItemId("mySwordId");
name = "mySword";
displayName[0] = "My Sword";
addToCreative[0] = true;
creativeTab = "combat";
damage[0] = 10;
full3d = true;
effectiveBlocks = "30";
harvestBlocks = "30";
efficiency[0] = 6.0;
maxDamage = 200;
maxUsingDuration[0] = 72000;
usingAction[0] = "block";
onHitEntity[0] = "itemstack.damageItem(1);";
onRightClick[0] = "player.setItemInUse();";
onBlockDestroyed[0] = "itemstack.damageItem(2);";

textureFile[0] = "sword.png";

mod.js

config.addItemIdProperty("mySwordId", 6000);
mod.addItem("mySword.js", "normal");