Didn't test it yet, but that does only change the name I thought
The ingame name is the ModLoader.AddName
The one I'm having you change is the name you need so Minecraft knows which item it is using, if that explains it?
That SHOULD be all you need to do, but I'm not 100% sure.
Yep... Maybe you can try it by yourself? But I put my top.png and side.png in C:\Users\Frank\Desktop\mcp\mcp50_test\bin\minecraft is that correct?!
Ya, if you made a new folder for the textures, that's where the folder goes with the textures in it.
If there isn't a folder, which I don't recommend, then that's the right spot.
could you please do a tutorial on how to increase range of swords/items vs mobs and if you could how to increase/ decrease max health when wearing a certain armor.
Hello! I've studied your tutorials intently, and I've successfully made a block replicating the qualities of redstone ore (particles, glowing effect, etc). My biggest achievement so far! :biggrin.gif:
I'm planning on making a new block, well, it's pretty much made already, but I was wondering if you could give me a tip on the correct syntax/code for making the block spawn an item/block like with the onBlockRightClicked function or maybe onBlockActivated.
My idea was to have the block spawn a rose each time it's right clicked.
If you could please give me any advice, or make a short tutorial on it, that would be wonderful. Thanks. :smile.gif:
If you could please give me any advice, or make a short tutorial on it, that would be wonderful. Thanks. :smile.gif:
You want to look at BlockIce and take the code that places still water. You want to add that to your onRightClick, but change the j to j + 1 so it places it 1 up.
OH! Wonderful idea! I was trying to think of any blocks that would create an effect that spawned a new block!
Should have though about ice. Thanks! I'll check it out/test it after a nap, I've been up all night trying to think of something. :tongue.gif:
Edit: Also, would that be the same code I'd need to make an item "drop" from the block onRightClick? Like when a block is destroyed, you get the item back.
But in this case I just want to right click, and the block will still be there, but drop an item of my choice.
OH! Wonderful idea! I was trying to think of any blocks that would create an effect that spawned a new block!
Should have though about ice. Thanks! I'll check it out/test it after a nap, I've been up all night trying to think of something. :tongue.gif:
Edit: Also, would that be the same code I'd need to make an item "drop" from the block onRightClick? Like when a block is destroyed, you get the item back.
But in this case I just want to right click, and the block will still be there, but drop an item of my choice.
Thanks again for your help. :biggrin.gif:
After testing the BlockIce code, that seemed to work for the block I wanted it to. :smile.gif:
However I'm still trying to make a different block drop an item/block(of my choice) when right clicked.
I'm looking to the DispenserBlock for this,
private void dispenseItem(World world, int i, int j, int k, Random random)
etc...
I'm THINKING that using that last else statement that defines pretty much every other item (Not snowball or arrow etc.) will do what I'm hoping for.
But there's a few problems with this...
1)Would I have to set the block to extend as a container?
If so, how would I "pre-fill" the container with infinite items/blocks that I want it to dispense? (I don't want it to have a GUI to "open" the "dispenser")
2)I'd have to define a bunch more int's. :tongue.gif:
-----
Or is there something that I can use to imitate the "/give <player> <itemID>" command (like in SMP), but when right clicked?
Either one of these would work, I think.
I'll check back periodically. Trial and Error time. :tongue.gif:
I'll check back periodically. Trial and Error time. :tongue.gif:
EntityItem entityitem = new EntityItem(world, i, j, k, new ItemStack(mod_whatever.theitem, howmuchdropped));
entityitem.delayBeforeCanPickup = 10;
world.spawnEntityInWorld(entityitem);
Muserae, great tutorials man, but I'm having one issue. I can't seem to get my custom flowers (Blueberries) to generate. I've tried changing rarity, but I'm having no luck. I think it might be because I already have
public void GenerateSurface(World world, Random rand, int chunkX, int chunkZ)
In my mod (not in a block class but the mod class) for my ores and gems. I'm not sure what to do here.
Any idea what I can do to fix this? Thanks in advance.
My mod java file: (Heads up it's fairly long)
package net.minecraft.src;
import java.util.Map;
import java.util.Random;
public class mod_Mores extends BaseMod
{
public static Block Emerald = new BlockEmerald(181, 0).setHardness(1.5F).setResistance(5.0F).setLightValue(0.0F).setBlockName("Uncut Emerald");
public static Block Ruby = new BlockRuby(180, 0).setHardness(1.0F).setResistance(5.0F).setLightValue(0.0F).setBlockName("Uncut Ruby");
public static Block CopperOre = new BlockCopperOre(182, 0).setHardness(0.5F).setResistance(2.0F).setLightValue(0.0F).setBlockName("Copper Ore");
public static Block Silver = new BlockSilver(185, 0).setHardness(2.0F).setResistance(2.0F).setLightValue(0.0F).setBlockName("Silver Block");
public static Block FieryCoal = new BlockFieryCoal(183, 0).setHardness(0.5F).setResistance(2.0F).setLightValue(0.0F).setBlockName("Fiery Coal");
public static Block FrostyStone = new BlockFrostyStone(184, 0).setHardness(1.5F).setResistance(5.0F).setLightValue(0.0F).setBlockName("Frost Stone");
public static Block Beryl = new BlockBeryl(186, 0).setHardness(3F).setResistance(10F).setLightValue(0.0F).setBlockName("Beryl");
public static Block FieryTorch = new BlockFieryTorch(187, ModLoader.addOverride("/terrain.png", "/fierytorch.png")).setHardness(0.1F).setResistance(1.0F).setLightValue(1.0F).setBlockName("Fiery Torch");
public static Block FirstAid = new BlockFirstAid(188, 0).setHardness(3.0F).setResistance(10.0F).setLightValue(0.0F).setBlockName("First Aid Kit");
public static Block Pyrite = new BlockPyrite(189, 0).setHardness(3.0F).setResistance(5.0F).setLightValue(0.0F).setBlockName("Pyrite");
public static Block MossAgate = new BlockMossAgate(190, 0).setHardness(2.0F).setResistance(5.0F).setLightValue(0.0F).setBlockName("Moss Agate");
public static Block BlueBerry = new BlockBlueBerry(191, 0).setHardness(0.0F).setResistance(5.0F).setLightValue(0.0F).setBlockName("Blueberry");
public static Item FrostStoneOre = new Item(423).setItemName("Frost Stone");
public static Item HardenedFrostStone = new Item(425).setItemName("Hardened Frost Stone");
public static Item FieryCoalOre = new Item(422).setItemName("Fiery Coal");
public static Item Copper = new Item(419).setItemName("Copper");
public static Item RubyGem = new Item(415).setItemName("Cut Ruby");
public static Item Copper_Ore = new Item(424).setItemName("Copper Ore");
public static Item LargeRuby = new Item(416).setItemName("Large Cut Ruby");
public static Item LargeEmerald = new Item(418).setItemName("Large Cut Emerald");
public static Item EmeraldCut = new Item(417).setItemName("Cut Emerald");
public static Item Bong = new Item(555).setItemName("Glass Bong");
public static Item CopperIngot = new Item(420).setItemName("Copper Ingot");
public static Item SilverOre = new Item(426).setItemName("Silver Ore");
public static Item SilverIngot = new Item(427).setItemName("Silver Ingot");
public static Item UncutBeryl = new Item(428).setItemName("Uncut Beryl");
public static Item RoughPyrite = new Item(429).setItemName("Rough Pyrite");
public static Item PyriteCut = new Item(430).setItemName("Pyrite");
public static Item MossAgateUncut = new Item(431).setItemName("Rough Moss Agate");
public static Item MossAgateCut = new Item(432).setItemName("Moss Agate");
public static Item Blueberrys = new Item(433).setItemName("Blue Berry");
public String getVersion()
{
return "1.0.1";
}
public mod_Mores()
{
ModLoader.RegisterBlock(BlueBerry);
BlueBerry.blockIndexInTexture = ModLoader.addOverride("/terrain.png", "/blockblueberry.png");
ModLoader.AddName(BlueBerry, "Blue Berry");
Blueberrys.iconIndex = ModLoader.addOverride("/gui/items.png", "/blueberryitem.png");
ModLoader.AddName(Blueberrys, "Blue Berry");
MossAgateUncut.iconIndex = ModLoader.addOverride("/gui/items.png", "/mossagateuncut.png");
ModLoader.AddName( MossAgateUncut, "Rough Moss Agate");
MossAgateCut.iconIndex = ModLoader.addOverride("/gui/items.png", "/mossagatecut.png");
ModLoader.AddName( MossAgateCut, "Moss Agate");
ModLoader.AddRecipe(new ItemStack( MossAgateCut, 1), new Object[] {
"##", "##", Character.valueOf('#'), mod_Mores.MossAgateUncut });
ModLoader.RegisterBlock(MossAgate);
MossAgate.blockIndexInTexture = ModLoader.addOverride("/terrain.png", "/mossagate.png");
ModLoader.AddName(MossAgate, "Moss Agate");
ModLoader.AddRecipe(new ItemStack(MossAgate, 1), new Object[] {
"###", "###", "###", Character.valueOf('#'), Item.redstone });
PyriteCut.iconIndex = ModLoader.addOverride("/gui/items.png", "/pyritecut.png");
ModLoader.AddName( PyriteCut, "Pyrite");
ModLoader.AddRecipe(new ItemStack( PyriteCut, 1), new Object[] {
"##", "##", Character.valueOf('#'), mod_Mores.RoughPyrite });
RoughPyrite.iconIndex = ModLoader.addOverride("/gui/items.png", "/pyriteuncut.png");
ModLoader.AddName( RoughPyrite, "Rough Pyrite");
ModLoader.AddRecipe(new ItemStack( RoughPyrite, 1), new Object[] {
"###", "###", "###", Character.valueOf('#'), Item.redstone });
ModLoader.RegisterBlock(Pyrite);
Pyrite.blockIndexInTexture = ModLoader.addOverride("/terrain.png", "/pyriteblock.png");
ModLoader.AddName(Pyrite, "Pyrite");
ModLoader.AddRecipe(new ItemStack(Pyrite, 1), new Object[] {
"###", "###", "###", Character.valueOf('#'), Item.redstone });
ModLoader.RegisterBlock(FirstAid);
FirstAid.blockIndexInTexture = ModLoader.addOverride("/terrain.png", "/firstaid.png");
ModLoader.AddName( FirstAid, "First Aid Kit");
ModLoader.AddRecipe(new ItemStack( FirstAid, 1), new Object[] {
"#X#", "XXX", "#X#", Character.valueOf('#'), mod_Mores.HardenedFrostStone, Character.valueOf('X'), mod_Mores.LargeRuby });
ModLoader.RegisterBlock(FieryTorch);
ModLoader.AddName(FieryTorch, "Fiery Torch");
ModLoader.AddRecipe(new ItemStack(FieryTorch, 8), new Object[] {
"X", "#", Character.valueOf('X'), mod_Mores.FieryCoalOre, Character.valueOf('#'), Item.stick });
ModLoader.RegisterBlock(FieryCoal);
FieryCoal.blockIndexInTexture = ModLoader.addOverride("/terrain.png", "/fierycoal.png");
ModLoader.AddName(FieryCoal, "Fiery Coal");
ModLoader.AddRecipe(new ItemStack(FieryCoal, 1), new Object[] {
"###", "###", "###", Character.valueOf('#'), Item.redstone });
FieryCoalOre.iconIndex = ModLoader.addOverride("/gui/items.png", "/supercoal.png");
ModLoader.AddName(FieryCoalOre, "Fiery Coal");
ModLoader.AddRecipe(new ItemStack(FieryCoalOre, 1), new Object[] {
"###", "###", "###", Character.valueOf('#'), Item.redstone });
ModLoader.RegisterBlock(Ruby);
Ruby.blockIndexInTexture = ModLoader.addOverride("/terrain.png", "/Ruby.png");
ModLoader.AddName(Ruby, "Uncut Ruby");
ModLoader.AddRecipe(new ItemStack(Ruby, 1), new Object[] {
"###", "###", "###", Character.valueOf('#'), Item.redstone });
RubyGem.iconIndex = ModLoader.addOverride("/gui/items.png", "/rubygem.png");
ModLoader.AddName(RubyGem, "Cut Ruby");
ModLoader.AddRecipe(new ItemStack(RubyGem, 1), new Object[] {
"X", Character.valueOf('X'), mod_Mores.Ruby });
LargeRuby.iconIndex = ModLoader.addOverride("/gui/items.png", "/largeruby.png");
ModLoader.AddName(LargeRuby, "Large Cut Ruby");
ModLoader.AddRecipe(new ItemStack(LargeRuby, 1), new Object[] {
"XX", "XX", Character.valueOf('X'), mod_Mores.RubyGem });
ModLoader.RegisterBlock(Emerald);
Emerald.blockIndexInTexture = ModLoader.addOverride("/terrain.png", "/emerald.png");
ModLoader.AddName(Emerald, "Uncut Emerald");
ModLoader.AddRecipe(new ItemStack(Emerald, 1), new Object[] {
"###", "###", "###", Character.valueOf('#'), Item.redstone });
EmeraldCut.iconIndex = ModLoader.addOverride("/gui/items.png", "/emeraldgem.png");
ModLoader.AddName(EmeraldCut, "Cut Emerald");
ModLoader.AddRecipe(new ItemStack(EmeraldCut, 1), new Object[] {
"X", Character.valueOf('X'), mod_Mores.Emerald });
LargeEmerald.iconIndex = ModLoader.addOverride("/gui/items.png", "/largeemerald.png");
ModLoader.AddName(LargeEmerald, "Large Cut Emerald");
ModLoader.AddRecipe(new ItemStack(LargeEmerald, 1), new Object[] {
"XX", "XX", Character.valueOf('X'), mod_Mores.EmeraldCut });
ModLoader.RegisterBlock(CopperOre);
CopperOre.blockIndexInTexture = ModLoader.addOverride("/terrain.png", "/copper.png");
ModLoader.AddName(CopperOre, "Copper Ore");
ModLoader.AddRecipe(new ItemStack(CopperOre, 1), new Object[] {
"###", "###", "###", Character.valueOf('#'), Item.redstone });
CopperIngot.iconIndex = ModLoader.addOverride("/gui/items.png", "/copperingot.png");
ModLoader.AddName(CopperIngot, "Copper Ingot");
ModLoader.AddRecipe(new ItemStack(CopperIngot, 1), new Object[] {
"###", "###", "###", Character.valueOf('#'), Item.redstone });
Copper_Ore.iconIndex = ModLoader.addOverride("/gui/items.png", "/copperore.png");
ModLoader.AddName(Copper_Ore, "Copper Ore");
ModLoader.AddSmelting(mod_Mores.Copper_Ore.shiftedIndex, new ItemStack(mod_Mores.CopperIngot, 1));
ModLoader.AddRecipe(new ItemStack(CopperIngot, 1), new Object[] {
"###", "###", "###", Character.valueOf('#'), Item.redstone });
Bong.iconIndex = ModLoader.addOverride("/gui/items.png", "/bong.png");
ModLoader.AddName(Bong, "Emerald Bong");
ModLoader.AddRecipe(new ItemStack(Bong, 1), new Object[] {
"X", "X", "X", Character.valueOf('X'), mod_Mores.EmeraldCut });
FrostStoneOre.iconIndex = ModLoader.addOverride("/gui/items.png", "/froststone.png");
ModLoader.AddName(FrostStoneOre, "Frost Stone");
ModLoader.AddSmelting(mod_Mores.FrostStoneOre.shiftedIndex, new ItemStack(mod_Mores.HardenedFrostStone, 1));
ModLoader.AddRecipe(new ItemStack(FrostStoneOre, 1), new Object[] {
"###", "###", "###", Character.valueOf('#'), Item.redstone });
HardenedFrostStone.iconIndex = ModLoader.addOverride("/gui/items.png", "/hardenedfroststone.png");
ModLoader.AddName(HardenedFrostStone, "Hardened Frost Stone");
ModLoader.AddRecipe(new ItemStack(HardenedFrostStone, 1), new Object[] {
"###", "###", "###", Character.valueOf('#'), Item.redstone });
ModLoader.RegisterBlock(FrostyStone);
FrostyStone.blockIndexInTexture = ModLoader.addOverride("/terrain.png", "/froststoneblock.png");
ModLoader.AddName(FrostyStone, "Frost Stone");
ModLoader.AddRecipe(new ItemStack(FrostyStone, 1), new Object[] {
"###", "###", "###", Character.valueOf('#'), Item.redstone });
ModLoader.RegisterBlock(Silver);
Silver.blockIndexInTexture = ModLoader.addOverride("/terrain.png", "/silverblock.png");
ModLoader.AddName(Silver, "Silver Block");
ModLoader.AddRecipe(new ItemStack(Silver, 1), new Object[] {
"###", "###", "###", Character.valueOf('#'), Item.redstone });
SilverOre.iconIndex = ModLoader.addOverride("/gui/items.png", "/silverore.png");
ModLoader.AddName(SilverOre, "Silver Ore");
ModLoader.AddSmelting(mod_Mores.SilverOre.shiftedIndex, new ItemStack(mod_Mores.SilverIngot, 1));
ModLoader.AddRecipe(new ItemStack(CopperIngot, 1), new Object[] {
"###", "###", "###", Character.valueOf('#'), Item.redstone });
SilverIngot.iconIndex = ModLoader.addOverride("/gui/items.png", "/silveringot.png");
ModLoader.AddName(SilverIngot, "Silver Ingot");
ModLoader.AddRecipe(new ItemStack(SilverIngot, 1), new Object[] {
"###", "###", "###", Character.valueOf('#'), Item.redstone });
ModLoader.RegisterBlock(Beryl);
Beryl.blockIndexInTexture = ModLoader.addOverride("/terrain.png", "/berylblock.png");
ModLoader.AddName(Beryl, "Beryl Block");
ModLoader.AddRecipe(new ItemStack(Beryl, 1), new Object[] {
"###", "###", "###", Character.valueOf('#'), Item.redstone });
UncutBeryl.iconIndex = ModLoader.addOverride("/gui/items.png", "/uncutberyl.png");
ModLoader.AddName(UncutBeryl, "Uncut Beryl");
ModLoader.AddRecipe(new ItemStack(UncutBeryl, 1), new Object[] {
"###", "###", "###", Character.valueOf('#'), Item.redstone });
}
public void load()
{
}
//(World var1, Random rand, int chunkX, int chunkZ)
//(World var1, Random var2, int var3, int var4)
public void GenerateSurface(World world, Random rand, int chunkX, int chunkZ)
{
for(int i = 0; i < 8; i++)
{
int randPosX = chunkX + rand.nextInt(16);
int randPosY = rand.nextInt(55);
int randPosZ = chunkZ + rand.nextInt(16);
(new WorldGenMinable(mod_Mores.Ruby.blockID, 6)).generate(world, rand, randPosX, randPosY, randPosZ);
}
for(int i = 0; i < 1; i++)
{
int randPosX = chunkX + rand.nextInt(16);
int randPosY = rand.nextInt(15);
int randPosZ = chunkZ + rand.nextInt(16);
(new WorldGenMinable(mod_Mores.Beryl.blockID, 2)).generate(world, rand, randPosX, randPosY, randPosZ);
}
for(int i = 0; i < 3; i++)
{
int randPosX = chunkX + rand.nextInt(16);
int randPosY = rand.nextInt(25);
int randPosZ = chunkZ + rand.nextInt(16);
(new WorldGenMinable(mod_Mores.Emerald.blockID, 6)).generate(world, rand, randPosX, randPosY, randPosZ);
}
for(int i = 0; i < 30; i++)
{
int randPosX = chunkX + rand.nextInt(16);
int randPosY = rand.nextInt(124);
int randPosZ = chunkZ + rand.nextInt(16);
(new WorldGenMinable(mod_Mores.CopperOre.blockID, 12)).generate(world, rand, randPosX, randPosY, randPosZ);
}
for(int i = 0; i < 5; i++)
{
int randPosX = chunkX + rand.nextInt(16);
int randPosY = rand.nextInt(35);
int randPosZ = chunkZ + rand.nextInt(16);
(new WorldGenMinable(mod_Mores.FieryCoal.blockID, 6)).generate(world, rand, randPosX, randPosY, randPosZ);
}
for(int i = 0; i < 5; i++)
{
int randPosX = chunkX + rand.nextInt(16);
int randPosY = rand.nextInt(20);
int randPosZ = chunkZ + rand.nextInt(16);
(new WorldGenMinable(mod_Mores.Silver.blockID, 8)).generate(world, rand, randPosX, randPosY, randPosZ);
}
BiomeGenBase biome = world.getWorldChunkManager().getBiomeGenAt(chunkX, chunkZ);
if((biome instanceof BiomeGenTaiga) || (biome instanceof BiomeGenSnow))
for(int i = 0; i < 50; i++)
{
int randPosX = chunkX + rand.nextInt(16);
int randPosY = rand.nextInt(128);
int randPosZ = chunkZ + rand.nextInt(16);
(new WorldGenMinable(mod_Mores.FrostyStone.blockID, 4)).generate(world, rand, randPosX, randPosY, randPosZ);
}
if((biome instanceof BiomeGenDesert))
for(int i = 0; i < 80; i++)
{
int randPosX = chunkX + rand.nextInt(16);
int randPosY = rand.nextInt(128);
int randPosZ = chunkZ + rand.nextInt(16);
(new WorldGenMinable(mod_Mores.Pyrite.blockID, 4)).generate(world, rand, randPosX, randPosY, randPosZ);
}
if((biome instanceof BiomeGenSwamp))
for(int i = 0; i < 80; i++)
{
int randPosX = chunkX + rand.nextInt(16);
int randPosY = rand.nextInt(128);
int randPosZ = chunkZ + rand.nextInt(16);
(new WorldGenMinable(mod_Mores.MossAgate.blockID, 4)).generate(world, rand, randPosX, randPosY, randPosZ);
}
}
public int AddFuel(int i, int j)
{
if (i == FieryCoalOre.shiftedIndex)
{
return 3200;
}
return 0;
}
}
my block java file:
package net.minecraft.src;
import java.util.Random;
import java.util.Map;
public class BlockBlueBerry extends BlockFlower
{
protected BlockBlueBerry(int i, int j)
{
super(i, j);
float f = 0.2F;
setBlockBounds(0.5F - f, 0.0F, 0.5F - f, 0.5F + f, f * 2.0F, 0.5F + f);
setTickOnLoad(true);
}
public int idDropped(int i, Random random)
{
if(blockID == mod_Mores.BlueBerry.blockID)
{
return mod_Mores.Blueberrys.shiftedIndex;
} else
{
return blockID;
}
}
public int quantityDropped(Random random)
{
return 1;
}
public void GenerateSurface(World var1, Random var2, int var3, int var4)
{
int var5;
int var6;
int var7;
int var8;
for(var5 = 0; var5 < 100; ++var5)
{
var6 = var3 + var2.nextInt(16) + 8;
var7 = var2.nextInt(128);
var8 = var4 + var2.nextInt(16) + 8;
(new WorldGenFlowers(mod_Mores.BlueBerry.blockID)).generate(var1, var2, var6, var7, var8);
}
}
public void updateTick(World world, int i, int j, int k, Random random)
{
if(random.nextInt(100) == 0)
{
int l = (i + random.nextInt(3)) - 1;
int i1 = (j + random.nextInt(2)) - random.nextInt(2);
int j1 = (k + random.nextInt(3)) - 1;
if(world.isAirBlock(l, i1, j1) && canBlockStay(world, l, i1, j1))
{
i += random.nextInt(3) - 1;
k += random.nextInt(3) - 1;
if(world.isAirBlock(l, i1, j1) && canBlockStay(world, l, i1, j1))
{
world.setBlockWithNotify(l, i1, j1, blockID);
}
}
}
}
protected boolean canThisPlantGrowOnThisBlockID(int i)
{
return Block.opaqueCubeLookup[i];
}
public boolean canBlockStay(World world, int i, int j, int k)
{
if(j < 0 || j >= 128)
{
return false;
} else
{
return world.getFullBlockLightValue(i, j, k) < 13 && canThisPlantGrowOnThisBlockID(world.getBlockId(i, j - 1, k));
}
}
}
Muserae, great tutorials man, but I'm having one issue.
Best I can say is try to move it over to your mod_Mores, look harder (I noticed they like spawning under trees/shaded areas), or maybe fiddle with the code alittle more.
The flower code is semi-old, since 1.8.1, and I haven't had a chance to mess with it now, which I don't think I'll need to. I'll be adding a flower type block to my mod soon, so hopefully I'll be able to see any problems then.
Best I can say is try to move it over to your mod_Mores, look harder (I noticed they like spawning under trees/shaded areas), or maybe fiddle with the code alittle more.
The flower code is semi-old, since 1.8.1, and I haven't had a chance to mess with it now, which I don't think I'll need to. I'll be adding a flower type block to my mod soon, so hopefully I'll be able to see any problems then.
Ok I'm going to mess around with it a bit for a while. At one point I got it to generate by moving
public void GenerateSurface(World var1, Random var2, int var3, int var4)
into my mod but it made my ores not generate and also made the plants generate underground, on stone and stuff.
I'm going to try and figure this out, if I find a solution I will let you know.
EDIT:
Do you have any idea why my plant block (I've been testing on the one world I got it to generate a **** ton but without ores generating) is still dropping the block and not the item I've set? Like is it not possible for flowers to drop an item?
BlockBlueBerry.java
package net.minecraft.src;
import java.util.Random;
public class BlockBlueBerry extends Block
{
public BlockBlueBerry(int i, int j)
{
super(i, Material.plants);
blockIndexInTexture = j;
setTickOnLoad(true);
float f = 0.2F;
setBlockBounds(0.5F - f, 0.0F, 0.5F - f, 0.5F + f, f * 3F, 0.5F + f);
}
public int idDropped(int i, Random rand, int j)
{
return mod_Mores.Blueberrys.iconIndex;
}
public int quantityDropped(Random random)
{
return 1;
}
public boolean canPlaceBlockAt(World world, int i, int j, int k)
{
return super.canPlaceBlockAt(world, i, j, k) && canThisPlantGrowOnThisBlockID(world.getBlockId(i, j - 1, k));
}
protected boolean canThisPlantGrowOnThisBlockID(int i)
{
return i == Block.grass.blockID || i == Block.dirt.blockID || i == Block.tilledField.blockID;
}
public void onNeighborBlockChange(World world, int i, int j, int k, int l)
{
super.onNeighborBlockChange(world, i, j, k, l);
checkFlowerChange(world, i, j, k);
}
public void updateTick(World world, int i, int j, int k, Random random)
{
checkFlowerChange(world, i, j, k);
}
protected final void checkFlowerChange(World world, int i, int j, int k)
{
if (!canBlockStay(world, i, j, k))
{
dropBlockAsItem(world, i, j, k, world.getBlockMetadata(i, j, k), 0);
world.setBlockWithNotify(i, j, k, 0);
}
}
public boolean canBlockStay(World world, int i, int j, int k)
{
return (world.getFullBlockLightValue(i, j, k) >= 8 || world.canBlockSeeTheSky(i, j, k)) && canThisPlantGrowOnThisBlockID(world.getBlockId(i, j - 1, k));
}
public AxisAlignedBB getCollisionBoundingBoxFromPool(World world, int i, int j, int k)
{
return null;
}
public boolean isOpaqueCube()
{
return false;
}
public boolean renderAsNormalBlock()
{
return false;
}
public int getRenderType()
{
return 1;
}
}
So I'm at the Oracle Downloads part, feeling like a noob. I can't find any "IDE" downloads or "SDK" or anything of that nature. Just a TON of links on this download page. Which do I download? Is it one of the popular downloads? Which category is it in?
So I'm at the Oracle Downloads part, feeling like a noob.
Click the link to the oracle site that I posted in the MCP tutorial, scroll down a bit till you see Java SE Development Kit 7 and a bunch of download links. Pick the one that goes with your computer.
Ok ill try to Ask again and use GOOD grammar=D in next post thought and Thx
The ingame name is the ModLoader.AddName
The one I'm having you change is the name you need so Minecraft knows which item it is using, if that explains it?
That SHOULD be all you need to do, but I'm not 100% sure.
Recompiling adds the new files into the game.
Ya, if you made a new folder for the textures, that's where the folder goes with the textures in it.
If there isn't a folder, which I don't recommend, then that's the right spot.
Only thing I can think of is you didn't make do the java build path right.
I'm planning on making a new block, well, it's pretty much made already, but I was wondering if you could give me a tip on the correct syntax/code for making the block spawn an item/block like with the onBlockRightClicked function or maybe onBlockActivated.
My idea was to have the block spawn a rose each time it's right clicked.
If you could please give me any advice, or make a short tutorial on it, that would be wonderful. Thanks. :smile.gif:
You want to look at BlockIce and take the code that places still water. You want to add that to your onRightClick, but change the j to j + 1 so it places it 1 up.
Should have though about ice. Thanks! I'll check it out/test it after a nap, I've been up all night trying to think of something. :tongue.gif:
Edit: Also, would that be the same code I'd need to make an item "drop" from the block onRightClick? Like when a block is destroyed, you get the item back.
But in this case I just want to right click, and the block will still be there, but drop an item of my choice.
Thanks again for your help. :biggrin.gif:
After testing the BlockIce code, that seemed to work for the block I wanted it to. :smile.gif:
However I'm still trying to make a different block drop an item/block(of my choice) when right clicked.
I'm looking to the DispenserBlock for this,
etc...
I'm THINKING that using that last else statement that defines pretty much every other item (Not snowball or arrow etc.) will do what I'm hoping for.
But there's a few problems with this...
1)Would I have to set the block to extend as a container?
If so, how would I "pre-fill" the container with infinite items/blocks that I want it to dispense? (I don't want it to have a GUI to "open" the "dispenser")
2)I'd have to define a bunch more int's. :tongue.gif:
-----
Or is there something that I can use to imitate the "/give <player> <itemID>" command (like in SMP), but when right clicked?
Either one of these would work, I think.
I'll check back periodically. Trial and Error time. :tongue.gif:
Add this to the onRightClick as well
2 more reps on the main post and we get the popular logo, come on guys!
In my mod (not in a block class but the mod class) for my ores and gems. I'm not sure what to do here.
Any idea what I can do to fix this? Thanks in advance.
My mod java file: (Heads up it's fairly long)
my block java file:
Best I can say is try to move it over to your mod_Mores, look harder (I noticed they like spawning under trees/shaded areas), or maybe fiddle with the code alittle more.
The flower code is semi-old, since 1.8.1, and I haven't had a chance to mess with it now, which I don't think I'll need to. I'll be adding a flower type block to my mod soon, so hopefully I'll be able to see any problems then.
Ok I'm going to mess around with it a bit for a while. At one point I got it to generate by moving
public void GenerateSurface(World var1, Random var2, int var3, int var4)
into my mod but it made my ores not generate and also made the plants generate underground, on stone and stuff.
I'm going to try and figure this out, if I find a solution I will let you know.
EDIT:
Do you have any idea why my plant block (I've been testing on the one world I got it to generate a **** ton but without ores generating) is still dropping the block and not the item I've set? Like is it not possible for flowers to drop an item?
BlockBlueBerry.java
You want it to be
mod_Mores.Blueberrys.shiftedIndex;
I feel so derp.
Click the link to the oracle site that I posted in the MCP tutorial, scroll down a bit till you see Java SE Development Kit 7 and a bunch of download links. Pick the one that goes with your computer.
I'd rather not include the code, because it's rather long as well, but do you know how to fix the problem?
Static
{
Blah = item(533)
}
Rough example :tongue.gif:
I'll be able to help better in a few days when I can use my laptop again