NNNNOOOOOOOOO!!!!!!!!!! NOT FORGE TUTORIALS!! PLEASE NO!!!!! HOW AM I SUPOSED TO MAKE A MOD THEN?!?!??!
Chill. Out. Use normal font sizing too. As Skyress2000 said above, the ModLoader tutorials will still be there.
Rollback Post to RevisionRollBack
“Computers are incredibly fast, accurate and stupid; humans are incredibly slow, inaccurate and brilliant; together they are powerful beyond imagination."
So I followed along with the crops tut and something isn't working right. I can plant my CoffeeSeeds, they grow through their process, and I can even harvest CoffeeBeans from the fully matured plant. My issue is that the CoffeeCrop is in the inventory with the seeds, but the CoffeeBeans are NOT showing in the creative inventory.
mod_Breakfast (Coffee portions, not the entire code) I did classify the seeds as ItemSeeds. When I tried to use my own custom class the seeds would not show in the creative inventory
public class mod_Breakfast extends BaseMod
{
//Crops
//Coffee
public static final Block CoffeeCrop = new BlockCoffeeCrop(150, 0).setBlockName("CoffeeCrop");
public static final Item CoffeeBeans = new Item (2343).setItemName("CoffeeBeans");
public static final Item CoffeeSeeds = new ItemSeeds(2344, mod_Breakfast.CoffeeCrop.blockID, Block.tilledField.blockID).setItemName("CoffeeSeeds");
public static int CoffeePlant1 = ModLoader.addOverride("/terrain.png", "/items/CoffeePlant1.png");
public static int CoffeePlant2 = ModLoader.addOverride("/terrain.png", "/items/CoffeePlant2.png");
public static int CoffeePlant3 = ModLoader.addOverride("/terrain.png", "/items/CoffeePlant3.png");
public static int CoffeePlant4 = ModLoader.addOverride("/terrain.png", "/items/CoffeePlant4.png");
public void load()
{
//Crops
//Coffee
CoffeeCrop.blockIndexInTexture = ModLoader.addOverride("/terrain.png", "/items/CoffeePlant1.png");
ModLoader.registerBlock(CoffeeCrop);
ModLoader.addName(CoffeeCrop, "Coffee Crop");
CoffeeSeeds.iconIndex = ModLoader.addOverride("/gui/items.png", "/items/CoffeeSeeds.png");
ModLoader.addName(CoffeeSeeds, "Coffee Seeds");
CoffeeBeans.iconIndex = ModLoader.addOverride("/gui/items.png", "/items/CoffeeBeans.png");
ModLoader.addName(CoffeeBeans, "Coffee Beans");
}
public String getVersion()
{
return "v1.0";
}
Here is my BlockCoffeeBeans.java *NOTE* The only real change from the tut is that I only used 4 steps, but filled out 8 steps with multiples of each stage and changed Item.whet.shiftedIndex to mod_Breakfast.CoffeeBeans.shiftedIndex
package net.minecraft.src;
import java.util.Random;
public class BlockCoffeeCrop extends BlockFlower
{
public BlockCoffeeCrop(int i, int j)
{
super(i, j);
blockIndexInTexture = j;
setTickRandomly(true);
float f = 0.5F;
setBlockBounds(0.5F - f, 0.0F, 0.5F - f, 0.5F + f, 0.25F, 0.5F + f);
}
/**
* Gets passed in the blockID of the block below and supposed to return true if its allowed to grow on the type of
* blockID passed in. Args: blockID.
* This basically checks to see if the block below is a tilled field/tilled dirt. If it is true then the crop can grow.
*/
protected boolean canThisPlantGrowOnThisBlockID(int par1)
{
return par1 == Block.tilledField.blockID;
}
/**
* Ticks the block if it's been scheduled. This method gets scheduled to run because of the setTickRandomly part in the constructor of the class.
*/
public void updateTick(World par1World, int par2, int par3, int par4, Random par5Random)
{
super.updateTick(par1World, par2, par3, par4, par5Random);
if (par1World.getBlockLightValue(par2, par3 + 1, par4) >= 9)
{
int i = par1World.getBlockMetadata(par2, par3, par4);
if (i < 8)
{
float f = getGrowthRate(par1World, par2, par3, par4);
if (par5Random.nextInt((int)(25F / f) + 1) == 0)
{
i++;
par1World.setBlockMetadataWithNotify(par2, par3, par4, i);
}
}
}
}
/**
* This method allows you to use bonemeal on your crop. Code explanation below:
ItemStack itemstack = entityplayer.inventory.getCurrentItem(); - This line makes "itemstack" equal to the item currently in the players hand.
if(itemstack != null && itemstack.itemID == Item.dyePowder.shiftedIndex) - This line checks if the item in players hand is equal to dye.
if(itemstack.getItemDamage() == 15) - This line checks if the damage value of that item is 15. Item.dyePowder's damage value of 15 is bonemeal.
world.setBlockMetadataWithNotify(i, j, k, 8); - This line sets the metadata value of the block to 8 which is the final growth stage.
itemstack.stackSize--; - This line makes the stack size go down by one.
world.notifyBlockChange(i, j, k, 0); - This line notifys adjacent blocks that this block has updated its state.
*/
public boolean onBlockActivated(World par1World, int par2, int par3, int par4, EntityPlayer par5EntityPlayer, int par6, float par7, float par8, float par9)
{
ItemStack itemstack = par5EntityPlayer.inventory.getCurrentItem();
if(itemstack != null && itemstack.itemID == Item.dyePowder.shiftedIndex)
{
if(itemstack.getItemDamage() == 15)
{
par1World.setBlockMetadataWithNotify(par2, par3, par4, 8);
itemstack.stackSize--;
par1World.notifyBlockChange(par2, par3, par4, 0);
}
}
super.onBlockActivated(par1World, par2, par3, par4, par5EntityPlayer, par6, par7, par8, par9);
return true;
}
/**
* Gets the growth rate for the crop. Setup to encourage rows by halving growth rate if there is diagonals, crops on
* different sides that aren't opposing, and by adding growth for every crop next to this one (and for crop below
* this one). Args: x, y, z
*/
private float getGrowthRate(World par1World, int par2, int par3, int par4)
{
float f = 1.0F;
int i = par1World.getBlockId(par2, par3, par4 - 1);
int j = par1World.getBlockId(par2, par3, par4 + 1);
int k = par1World.getBlockId(par2 - 1, par3, par4);
int l = par1World.getBlockId(par2 + 1, par3, par4);
int i1 = par1World.getBlockId(par2 - 1, par3, par4 - 1);
int j1 = par1World.getBlockId(par2 + 1, par3, par4 - 1);
int k1 = par1World.getBlockId(par2 + 1, par3, par4 + 1);
int l1 = par1World.getBlockId(par2 - 1, par3, par4 + 1);
boolean flag = k == blockID || l == blockID;
boolean flag1 = i == blockID || j == blockID;
boolean flag2 = i1 == blockID || j1 == blockID || k1 == blockID || l1 == blockID;
for (int i2 = par2 - 1; i2 <= par2 + 1; i2++)
{
for (int j2 = par4 - 1; j2 <= par4 + 1; j2++)
{
int k2 = par1World.getBlockId(i2, par3 - 1, j2);
float f1 = 0.0F;
if (k2 == Block.tilledField.blockID)
{
f1 = 1.0F;
if (par1World.getBlockMetadata(i2, par3 - 1, j2) > 0)
{
f1 = 3F;
}
}
if (i2 != par2 || j2 != par4)
{
f1 /= 4F;
}
f += f1;
}
}
if (flag2 || flag && flag1)
{
f /= 2.0F;
}
return f;
}
/**
* The type of render function that is called for this block. The render type of 6 gets the texture and places it four times around the sides of the block and leaves nothing on the top or bottom.
*/
public int getRenderType()
{
return 6;
}
/**
* Drops the block items with a specified chance of dropping the specified items
*/
public void dropBlockAsItemWithChance(World par1World, int par2, int par3, int par4, int par5, float par6, int par7)
{
super.dropBlockAsItemWithChance(par1World, par2, par3, par4, par5, par6, 0);
if (par1World.isRemote)
{
return;
}
int i = 3 + par7;
for (int j = 0; j < i; j++)
{
if (par1World.rand.nextInt(15) <= par5)
{
float f = 0.7F;
float f1 = par1World.rand.nextFloat() * f + (1.0F - f) * 0.5F;
float f2 = par1World.rand.nextFloat() * f + (1.0F - f) * 0.5F;
float f3 = par1World.rand.nextFloat() * f + (1.0F - f) * 0.5F;
EntityItem entityitem = new EntityItem(par1World, (float)par2 + f1, (float)par3 + f2, (float)par4 + f3, new ItemStack(mod_Breakfast.CoffeeSeeds));
entityitem.delayBeforeCanPickup = 10;
par1World.spawnEntityInWorld(entityitem);
}
}
}
/**
* Returns the ID of the items to drop on destruction. "i" is equal to the blocks metadata value(explained slightly more in the getBlockTextureFromSideAndMetadata method below).
* This means that it will check that that value is equal to 8(the final stage of growth) and if it is then it will drop wheat. It may be fairly obvious, but the 'else' statement means that if the growth state is
* not equal to 7 then drop nothing (-1 means nothing)
*/
public int idDropped(int i, Random random, int j)
{
if (i == 8)
{
return mod_Breakfast.CoffeeBeans.shiftedIndex;
}
else
{
return -1;
}
}
/**
* Returns the quantity of items to drop on block destruction.
*/
public int quantityDropped(Random random)
{
return 1;
}
/**
* From the specified side and block metadata retrieves the blocks texture. Args: side, metadata.
* As you may have been able to tell from the line above, "j" is equal to the metadata value of the block. This checks if that value is equal to a certain number then sets the blocks texture to what you have defined.
* The things that are being returned are the ints in your mod_ class which you created and set to your texture for the specific stages of growth.
*/
public int getBlockTextureFromSideAndMetadata(int i, int j)
{
if(j == 0)
{
return blockIndexInTexture;
}
if(j == 1)
{
return mod_Breakfast.CoffeePlant1;
}
if(j == 2)
{
return mod_Breakfast.CoffeePlant2;
}
if(j == 3)
{
return mod_Breakfast.CoffeePlant2;
}
if(j == 4)
{
return mod_Breakfast.CoffeePlant2;
}
if(j == 5)
{
return mod_Breakfast.CoffeePlant3;
}
if(j == 6)
{
return mod_Breakfast.CoffeePlant3;
}
if(j == 7)
{
return mod_Breakfast.CoffeePlant3;
}
if(j == 8)
{
return mod_Breakfast.CoffeePlant4;
}
return j;
}
}
I'm not getting an error report.
Any help would be appreciated. I'm not looking for a solid answer (I'm trying to learn this without being spoon fed), but could someone at least point me in the right direction, like a hint?
-EDITS-
When I change the CoffeeSeeds = new ItemCoffeeSeeds to CoffeeSeeds = new ItemSeeds, the seeds now show up and can be planted. BUT I can still plant the Seeds AND the Beans
Anyone know how to make a sword catch entities on fire?
Using the hitEntity method in your sword and set the second EntityLiving parameter on fire.
Rollback Post to RevisionRollBack
“Computers are incredibly fast, accurate and stupid; humans are incredibly slow, inaccurate and brilliant; together they are powerful beyond imagination."
Still having an issue with my crops. I finally got it working and growing now my only issue is that my crop is showing up in the inventory and the Beans are not. I'm trying to use CoffeeSeeds to plant, then harvest CoffeePlant to get the CoffeeBeans.
How do I put cocoa beans on a shapeless recipe? I'm getting this error
Minecraft has crashed!
----------------------
Minecraft has stopped running because it encountered a problem; ModLoader has failed to initialize.
This error has been saved to C:\Users\Diego Granada\Desktop\mcp72\jars\.\crash-reports\crash-2012-08-24_21.23.47-client.txt for your convenience. Please include a copy of this file if you report this crash to anyone.
--- BEGIN ERROR REPORT 84f2ee --------
Generated 8/24/12 9:23 PM
- Minecraft Version: 1.3.2
- Operating System: Windows 7 (amd64) version 6.1
- Java Version: 1.7.0_05, Oracle Corporation
- Java VM Version: Java HotSpotâ„¢ 64-Bit Server VM (mixed mode), Oracle Corporation
- Memory: 994663456 bytes (948 MB) / 1056309248 bytes (1007 MB) up to 1056309248 bytes (1007 MB)
- JVM Flags: 3 total; -Xincgc -Xmx1024M -Xms1024M
- ModLoader: Mods loaded: 3
ModLoader 1.3.2
mod_ApplePieNathan 1.3.2
mod_BrownieJoaco 1.3.2
java.lang.RuntimeException: Invalid shapeless recipy!
at net.minecraft.src.CraftingManager.addShapelessRecipe(CraftingManager.java:222)
at net.minecraft.src.ModLoader.addShapelessRecipe(ModLoader.java:512)
at net.minecraft.src.mod_BrownieJoaco.load(mod_BrownieJoaco.java:10)
at net.minecraft.src.ModLoader.init(ModLoader.java:952)
at net.minecraft.src.ModLoader.addAllRenderers(ModLoader.java:186)
at net.minecraft.src.RenderManager.<init>(RenderManager.java:86)
at net.minecraft.src.RenderManager.<clinit>(RenderManager.java:14)
at net.minecraft.client.Minecraft.startGame(Minecraft.java:404)
at net.minecraft.client.Minecraft.run(Minecraft.java:724)
at java.lang.Thread.run(Unknown Source)
--- END ERROR REPORT b8e807d9 ----------
And this is my code
package net.minecraft.src;
public class mod_BrownieJoaco extends BaseMod
{
public static final Item brownie = new ItemFood(5002, 6, 5F, false).setItemName("anybrownie");
public void load()
{
brownie.iconIndex = ModLoader.addOverride("/gui/items.png", "/brownie.png");
ModLoader.addName(brownie, "Brownie con leche");
ModLoader.addShapelessRecipe(new ItemStack(brownie, 1), new Object[]
{Item.sugar, Item.bucketMilk, Item.egg, Item.dyePowder, 1, 3});
}public String getVersion()
{
return "1.3.2";
}
}
Do know how to make structures very rare. Like desert wells?
This is as rare I can make it, but it is still very common.
public void generateSurface(World world, Random random, int chunkX, int chunkZ) {
for (int k = 0; k < 1; k++) {
int RandPosX = chunkX + random.nextInt(1);
int RandPosY = random.nextInt(80);
int RandPosZ = chunkZ + random.nextInt(1);
(new WorldGenStoneWell()).generate(world, random, RandPosX, RandPosY, RandPosZ);
}
}
there is NO bad thing porting to forge u know. all Modloader funcs are there.
Who ever said there was?
Rollback Post to RevisionRollBack
“Computers are incredibly fast, accurate and stupid; humans are incredibly slow, inaccurate and brilliant; together they are powerful beyond imagination."
Yes but I'm not making a tutorial on it for a few weeks.
Using the hitEntity method in your sword and set the second EntityLiving parameter on fire.
And, one tiny question: is there a way to use that to make experience pop out each time you hit the entity in the hitEntity method?
Rollback Post to RevisionRollBack
When life gives you a potato, wonder why the heck life just gave you a potato. Why not something else? Like money? Or a combustable lemon? No, you get a potato. Nothing else.
Do know how to make structures very rare. Like desert wells?
This is as rare I can make it, but it is still very common.
public void generateSurface(World world, Random random, int chunkX, int chunkZ) {
for (int k = 0; k < 1; k++) {
int RandPosX = chunkX + random.nextInt(1);
int RandPosY = random.nextInt(80);
int RandPosZ = chunkZ + random.nextInt(1);
(new WorldGenStoneWell()).generate(world, random, RandPosX, RandPosY, RandPosZ);
}
}
Sorry I had forgotten spoiler tags
You could do it so that within the for loop there is a certain chance of doing WorldGenStoneWell, so it looks like this:
public void generateSurface(World world, Random random, int chunkX, int chunkZ) {
for (int k = 0; k < 1; k++) {
int RandPosX = chunkX + random.nextInt(1);
int RandPosY = random.nextInt(80);
int RandPosZ = chunkZ + random.nextInt(1);
if (random.nextInt(5)==1)
(new WorldGenStoneWell()).generate(world, random, RandPosX, RandPosY, RandPosZ);
}
}
If i'm correct, this will give it a 1/5 chance of spawning in every chunk. You can change the 5 to make it as rare as you want.
And, one tiny question: is there a way to use that to make experience pop out each time you hit the entity in the hitEntity method?
As experience orbs are entitys, you could use a method like the one that TNT uses to spawn Primed TNT (an entity) or the one that the mob egg uses to place a mob, and then figure out what the name of the XP orbs is, and just change it a bit
Rollback Post to RevisionRollBack
To post a comment, please login or register a new account.
Just wondering... how can you not like Forge? It adds some useful stuff and it ain't THAT hard to move your mod over..
Author of the Clarity, Serenity, Sapphire & Halcyon shader packs for Minecraft: Java Edition.
My Github page.
The entire Minecraft shader development community now has its own Discord server! Feel free to join and chat with all the developers!
I'm pretty sure the ModLoader tutorials will still be there.
Chill. Out. Use normal font sizing too. As Skyress2000 said above, the ModLoader tutorials will still be there.
together they are powerful beyond imagination."
So I followed along with the crops tut and something isn't working right. I can plant my CoffeeSeeds, they grow through their process, and I can even harvest CoffeeBeans from the fully matured plant. My issue is that the CoffeeCrop is in the inventory with the seeds, but the CoffeeBeans are NOT showing in the creative inventory.
mod_Breakfast (Coffee portions, not the entire code) I did classify the seeds as ItemSeeds. When I tried to use my own custom class the seeds would not show in the creative inventory
public class mod_Breakfast extends BaseMod { //Crops //Coffee public static final Block CoffeeCrop = new BlockCoffeeCrop(150, 0).setBlockName("CoffeeCrop"); public static final Item CoffeeBeans = new Item (2343).setItemName("CoffeeBeans"); public static final Item CoffeeSeeds = new ItemSeeds(2344, mod_Breakfast.CoffeeCrop.blockID, Block.tilledField.blockID).setItemName("CoffeeSeeds"); public static int CoffeePlant1 = ModLoader.addOverride("/terrain.png", "/items/CoffeePlant1.png"); public static int CoffeePlant2 = ModLoader.addOverride("/terrain.png", "/items/CoffeePlant2.png"); public static int CoffeePlant3 = ModLoader.addOverride("/terrain.png", "/items/CoffeePlant3.png"); public static int CoffeePlant4 = ModLoader.addOverride("/terrain.png", "/items/CoffeePlant4.png"); public void load() { //Crops //Coffee CoffeeCrop.blockIndexInTexture = ModLoader.addOverride("/terrain.png", "/items/CoffeePlant1.png"); ModLoader.registerBlock(CoffeeCrop); ModLoader.addName(CoffeeCrop, "Coffee Crop"); CoffeeSeeds.iconIndex = ModLoader.addOverride("/gui/items.png", "/items/CoffeeSeeds.png"); ModLoader.addName(CoffeeSeeds, "Coffee Seeds"); CoffeeBeans.iconIndex = ModLoader.addOverride("/gui/items.png", "/items/CoffeeBeans.png"); ModLoader.addName(CoffeeBeans, "Coffee Beans"); } public String getVersion() { return "v1.0"; }Here is my BlockCoffeeBeans.java *NOTE* The only real change from the tut is that I only used 4 steps, but filled out 8 steps with multiples of each stage and changed Item.whet.shiftedIndex to mod_Breakfast.CoffeeBeans.shiftedIndex
package net.minecraft.src; import java.util.Random; public class BlockCoffeeCrop extends BlockFlower { public BlockCoffeeCrop(int i, int j) { super(i, j); blockIndexInTexture = j; setTickRandomly(true); float f = 0.5F; setBlockBounds(0.5F - f, 0.0F, 0.5F - f, 0.5F + f, 0.25F, 0.5F + f); } /** * Gets passed in the blockID of the block below and supposed to return true if its allowed to grow on the type of * blockID passed in. Args: blockID. * This basically checks to see if the block below is a tilled field/tilled dirt. If it is true then the crop can grow. */ protected boolean canThisPlantGrowOnThisBlockID(int par1) { return par1 == Block.tilledField.blockID; } /** * Ticks the block if it's been scheduled. This method gets scheduled to run because of the setTickRandomly part in the constructor of the class. */ public void updateTick(World par1World, int par2, int par3, int par4, Random par5Random) { super.updateTick(par1World, par2, par3, par4, par5Random); if (par1World.getBlockLightValue(par2, par3 + 1, par4) >= 9) { int i = par1World.getBlockMetadata(par2, par3, par4); if (i < 8) { float f = getGrowthRate(par1World, par2, par3, par4); if (par5Random.nextInt((int)(25F / f) + 1) == 0) { i++; par1World.setBlockMetadataWithNotify(par2, par3, par4, i); } } } } /** * This method allows you to use bonemeal on your crop. Code explanation below: ItemStack itemstack = entityplayer.inventory.getCurrentItem(); - This line makes "itemstack" equal to the item currently in the players hand. if(itemstack != null && itemstack.itemID == Item.dyePowder.shiftedIndex) - This line checks if the item in players hand is equal to dye. if(itemstack.getItemDamage() == 15) - This line checks if the damage value of that item is 15. Item.dyePowder's damage value of 15 is bonemeal. world.setBlockMetadataWithNotify(i, j, k, 8); - This line sets the metadata value of the block to 8 which is the final growth stage. itemstack.stackSize--; - This line makes the stack size go down by one. world.notifyBlockChange(i, j, k, 0); - This line notifys adjacent blocks that this block has updated its state. */ public boolean onBlockActivated(World par1World, int par2, int par3, int par4, EntityPlayer par5EntityPlayer, int par6, float par7, float par8, float par9) { ItemStack itemstack = par5EntityPlayer.inventory.getCurrentItem(); if(itemstack != null && itemstack.itemID == Item.dyePowder.shiftedIndex) { if(itemstack.getItemDamage() == 15) { par1World.setBlockMetadataWithNotify(par2, par3, par4, 8); itemstack.stackSize--; par1World.notifyBlockChange(par2, par3, par4, 0); } } super.onBlockActivated(par1World, par2, par3, par4, par5EntityPlayer, par6, par7, par8, par9); return true; } /** * Gets the growth rate for the crop. Setup to encourage rows by halving growth rate if there is diagonals, crops on * different sides that aren't opposing, and by adding growth for every crop next to this one (and for crop below * this one). Args: x, y, z */ private float getGrowthRate(World par1World, int par2, int par3, int par4) { float f = 1.0F; int i = par1World.getBlockId(par2, par3, par4 - 1); int j = par1World.getBlockId(par2, par3, par4 + 1); int k = par1World.getBlockId(par2 - 1, par3, par4); int l = par1World.getBlockId(par2 + 1, par3, par4); int i1 = par1World.getBlockId(par2 - 1, par3, par4 - 1); int j1 = par1World.getBlockId(par2 + 1, par3, par4 - 1); int k1 = par1World.getBlockId(par2 + 1, par3, par4 + 1); int l1 = par1World.getBlockId(par2 - 1, par3, par4 + 1); boolean flag = k == blockID || l == blockID; boolean flag1 = i == blockID || j == blockID; boolean flag2 = i1 == blockID || j1 == blockID || k1 == blockID || l1 == blockID; for (int i2 = par2 - 1; i2 <= par2 + 1; i2++) { for (int j2 = par4 - 1; j2 <= par4 + 1; j2++) { int k2 = par1World.getBlockId(i2, par3 - 1, j2); float f1 = 0.0F; if (k2 == Block.tilledField.blockID) { f1 = 1.0F; if (par1World.getBlockMetadata(i2, par3 - 1, j2) > 0) { f1 = 3F; } } if (i2 != par2 || j2 != par4) { f1 /= 4F; } f += f1; } } if (flag2 || flag && flag1) { f /= 2.0F; } return f; } /** * The type of render function that is called for this block. The render type of 6 gets the texture and places it four times around the sides of the block and leaves nothing on the top or bottom. */ public int getRenderType() { return 6; } /** * Drops the block items with a specified chance of dropping the specified items */ public void dropBlockAsItemWithChance(World par1World, int par2, int par3, int par4, int par5, float par6, int par7) { super.dropBlockAsItemWithChance(par1World, par2, par3, par4, par5, par6, 0); if (par1World.isRemote) { return; } int i = 3 + par7; for (int j = 0; j < i; j++) { if (par1World.rand.nextInt(15) <= par5) { float f = 0.7F; float f1 = par1World.rand.nextFloat() * f + (1.0F - f) * 0.5F; float f2 = par1World.rand.nextFloat() * f + (1.0F - f) * 0.5F; float f3 = par1World.rand.nextFloat() * f + (1.0F - f) * 0.5F; EntityItem entityitem = new EntityItem(par1World, (float)par2 + f1, (float)par3 + f2, (float)par4 + f3, new ItemStack(mod_Breakfast.CoffeeSeeds)); entityitem.delayBeforeCanPickup = 10; par1World.spawnEntityInWorld(entityitem); } } } /** * Returns the ID of the items to drop on destruction. "i" is equal to the blocks metadata value(explained slightly more in the getBlockTextureFromSideAndMetadata method below). * This means that it will check that that value is equal to 8(the final stage of growth) and if it is then it will drop wheat. It may be fairly obvious, but the 'else' statement means that if the growth state is * not equal to 7 then drop nothing (-1 means nothing) */ public int idDropped(int i, Random random, int j) { if (i == 8) { return mod_Breakfast.CoffeeBeans.shiftedIndex; } else { return -1; } } /** * Returns the quantity of items to drop on block destruction. */ public int quantityDropped(Random random) { return 1; } /** * From the specified side and block metadata retrieves the blocks texture. Args: side, metadata. * As you may have been able to tell from the line above, "j" is equal to the metadata value of the block. This checks if that value is equal to a certain number then sets the blocks texture to what you have defined. * The things that are being returned are the ints in your mod_ class which you created and set to your texture for the specific stages of growth. */ public int getBlockTextureFromSideAndMetadata(int i, int j) { if(j == 0) { return blockIndexInTexture; } if(j == 1) { return mod_Breakfast.CoffeePlant1; } if(j == 2) { return mod_Breakfast.CoffeePlant2; } if(j == 3) { return mod_Breakfast.CoffeePlant2; } if(j == 4) { return mod_Breakfast.CoffeePlant2; } if(j == 5) { return mod_Breakfast.CoffeePlant3; } if(j == 6) { return mod_Breakfast.CoffeePlant3; } if(j == 7) { return mod_Breakfast.CoffeePlant3; } if(j == 8) { return mod_Breakfast.CoffeePlant4; } return j; } }I'm not getting an error report.
Any help would be appreciated. I'm not looking for a solid answer (I'm trying to learn this without being spoon fed), but could someone at least point me in the right direction, like a hint?
-EDITS-
When I change the CoffeeSeeds = new ItemCoffeeSeeds to CoffeeSeeds = new ItemSeeds, the seeds now show up and can be planted. BUT I can still plant the Seeds AND the Beans
-
View User Profile
-
View Posts
-
Send Message
Retired Staff-
View User Profile
-
View Posts
-
Send Message
Curse Premium@TechGuy do u know how to make another world?
like aether?
http://www.codecademy.com/
Good place to get started.
Ok
Yes but I'm not making a tutorial on it for a few weeks.
Using the hitEntity method in your sword and set the second EntityLiving parameter on fire.
together they are powerful beyond imagination."
Thanks for the help, it worked, and so simple as well.
And how do I make it drop multiple items?
Remove the 1, 3 I believe.
This is as rare I can make it, but it is still very common.
public void generateSurface(World world, Random random, int chunkX, int chunkZ) { for (int k = 0; k < 1; k++) { int RandPosX = chunkX + random.nextInt(1); int RandPosY = random.nextInt(80); int RandPosZ = chunkZ + random.nextInt(1); (new WorldGenStoneWell()).generate(world, random, RandPosX, RandPosY, RandPosZ); } }Sorry I had forgotten spoiler tags
For example,
I mined CustomBlock with a pickaxe, and it gave CustomItem
I mined CustomBlock with a pickaxe with a silk touch/whatever enchantment, and it gave AnotherCustomItem.
Who ever said there was?
together they are powerful beyond imagination."
-
View User Profile
-
View Posts
-
Send Message
Retired StaffAnd, one tiny question: is there a way to use that to make experience pop out each time you hit the entity in the hitEntity method?
post got buried
use this:
protected boolean canSilkHarvest { return true; }wait, never mind, you're asking about ANY enchantment. There is some code in BlockIce that might give you a clue...
that might help.
You could do it so that within the for loop there is a certain chance of doing WorldGenStoneWell, so it looks like this:
public void generateSurface(World world, Random random, int chunkX, int chunkZ) { for (int k = 0; k < 1; k++) { int RandPosX = chunkX + random.nextInt(1); int RandPosY = random.nextInt(80); int RandPosZ = chunkZ + random.nextInt(1); if (random.nextInt(5)==1) (new WorldGenStoneWell()).generate(world, random, RandPosX, RandPosY, RandPosZ); } }If i'm correct, this will give it a 1/5 chance of spawning in every chunk. You can change the 5 to make it as rare as you want.
-
View User Profile
-
View Posts
-
Send Message
Curse PremiumAs experience orbs are entitys, you could use a method like the one that TNT uses to spawn Primed TNT (an entity) or the one that the mob egg uses to place a mob, and then figure out what the name of the XP orbs is, and just change it a bit