drackiseries

Minecraft Food Special Effects Code

Apr 30th, 2012
412
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.18 KB | None | 0 0
  1. MOD_ FILE CONTENTS:
  2.  
  3.  
  4. package net.minecraft.src;
  5.  
  6. import java.util.Random;
  7.  
  8. public class mod_tutorial extends BaseMod
  9. {
  10.  
  11. //Blocks
  12.  
  13. //Items
  14.  
  15. public static final Item RedBanana = (new ItemRedBanana(1002,10, 4, false)).setAlwaysEdible().setPotionEffect(Potion.moveSpeed.id,500,0,10).setItemName("RedBanana");
  16.  
  17.  
  18. public void load()
  19. {
  20.  
  21.  
  22. RedBanana.iconIndex = ModLoader.addOverride("/gui/items.png","/Items/redbanana.png");
  23.  
  24. //Registering
  25.  
  26. //Adding names
  27.  
  28. ModLoader.addName(RedBanana, "Red Banana");
  29.  
  30. //Crafting Recipes
  31.  
  32. //Smelting Recipes
  33.  
  34. //Shapeless Recipes
  35.  
  36. ModLoader.addShapelessRecipe(new ItemStack(mod_tutorial.RedBanana, 1), new Object[]
  37. {
  38. mod_tutorial.Banana, Item.redstone //Crafting Line
  39. });
  40.  
  41. }
  42.  
  43. public String getVersion()
  44. {
  45. return "1.2.5";
  46. }
  47. }
  48.  
  49.  
  50. ITEM RED BANANA FILE:
  51.  
  52. package net.minecraft.src;
  53.  
  54. public class ItemRedBanana extends ItemFood
  55. {
  56. public ItemRedBanana(int par1,int par2, float par3, boolean par4)
  57. {
  58. super(par1,par2,par3,par4);
  59. }
  60.  
  61. public boolean hasEffect(ItemStack par1ItemStack)
  62. {
  63. return true;
  64. }
  65. }
Advertisement
Add Comment
Please, Sign In to add comment