drackiseries

Basic Item Minecraft Code

Apr 30th, 2012
556
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.89 KB | None | 0 0
  1. MOD_ FILE CONTENTS:
  2.  
  3. package net.minecraft.src;
  4.  
  5. import java.util.Random;
  6.  
  7. public class mod_tutorial extends BaseMod
  8. {
  9.    
  10.     //Blocks
  11.    
  12.     //Items
  13.    
  14.     public static final Item Skull = (new ItemSkull(1000)).setItemName("Skull");
  15.  
  16.     public void load()
  17.     {
  18.        
  19.         Skull.iconIndex = ModLoader.addOverride("/gui/items.png","/Items/skull.png");
  20.        
  21.         //Registering
  22.        
  23.         //Adding names
  24.  
  25.         ModLoader.addName(Skull,"Skull");
  26.        
  27.         //Crafting Recipes
  28.        
  29.         ModLoader.addRecipe(new ItemStack(mod_tutorial.Skull, 1), new Object[]
  30.                 {
  31.                     "XX ", 'X', Item.bone   //Crafting Line
  32.                 });
  33.        
  34.         //Smelting Recipes
  35.        
  36.         //Shapeless Recipes
  37.        
  38.     }
  39.    
  40.     public String getVersion()
  41.     {
  42.         return "1.2.5";
  43.     }
  44. }
  45.  
  46.  
  47. THE ITEM FILE :
  48.  
  49. package net.minecraft.src;
  50.  
  51. public class ItemSkull extends Item
  52. {
  53.     protected ItemSkull(int par1)
  54.     {
  55.         super(par1);
  56.     }
  57. }
Advertisement
Add Comment
Please, Sign In to add comment