I MUST WARN YOU! A BUNCH OF THESE TUTORIALS WILL NOT WORK WITH 1.8!
your own mod_***
New block! with properties
New item! Edible!
Generation!
simple generation + ores
Spikes!
A epic Grenade!
A growing block like grass!
Mushrooms!
Block like reeds generating
Tools and Weapons
A Block that grows like reeds
Armour!
Redstone reacting blocks!
a block with different textures on some sides!
a block that reacts to left or right click!
A new mob!
Achievements
A Bow, or ranged weapon
something that grows like crops! or wheat!
A sword that sets your enemies on FIRE!
And much much more!
well, thats all the tutorials for now.
good luck with modding, and i hope you do very well!
now, what the helping point is here for... is to help you of course!
now, if you need some spare .png's just check out inside the spoiler, there will be many there :smile.gif:
this shows MCP that this is a file, hard too explain, just go with it
now we need to add this
public class mod_Tankite extends BaseMod
{
public mod_Tankite()
{
it shows sets up the file, telling it what to extend
next we need to add all the block files do this
ModLoader.RegisterBlock(blocknamehere);
this will register the block to show up on minecraft, VERY IMPOTANT
next this, its a recipe for the block and item,
ModLoader.AddRecipe(new ItemStack(tankite, 1), new Object[] {
"XX", "XX", Character.valueOf('X'), tankitebar
});
ModLoader.AddRecipe(new ItemStack(tankitepickaxe, 1), new Object[] {
"XXX", " Y ", " Y ", Character.valueOf('X'), tankitebar, Character.valueOf('Y'), Item.stick
});
those are just 2 recipes, see how it works, but remember if you want a recipe like a stick use this
"X", "X", rest of the code
now that thats over with, down to some more! The string version!
use this code
public String Version()
{
return "1.7.3";
}
remember, in error reports it will say mod_modname 1.7.3
so keep it like that
now to the part that sets properties to the blocks!!!
use this code here
public static Block tankite = (new BlockCow(211, ModLoader.addOverride("/terrain.png", "/Cow.png"))).setHardness(1F).setBlockName("cow");
now this makes it so it looks for the .png file called "Cow"
also, it makes it search for a file called BlockCow, and after that, the part that says BlockCow(211, the 211 is the block ID
it will also set the hardness, but, there is much more than just plain old Hardness :smile.gif:
here are some propertys
.setLightValue(1.0F) makes it glow like a torch
.setResistence(100F) makes it more invulnerable to TNT or other explosions
now, you have your awesome file!!!
now, you might be thinking, WHERE DO I PUT IT!?!?! ARRRGHHHHH!
well your in luck, here is a whole file, with a block :smile.gif:
package net.minecraft.src;
import java.util.Random;
public class mod_Tankite extends BaseMod
{
public mod_Tankite()
{
ModLoader.RegisterBlock(tankite);
ModLoader.AddName(tankite, "Tankite");
ModLoader.AddRecipe(new ItemStack(tankite, 1), new Object[] {
"XX", "XX", Character.valueOf('X'), Block.dirt
});
public String Version()
{
return "1.7.3 Items, Blocks";
}
public static Block tankite = (new BlockTankite(211, ModLoader.addOverride("/terrain.png", "/Tankite.png"))).setHardness(1F).setLightValue(1.0F).setResistance(5000F).setBlockName("tankite");
}
well, there you go! your own mod_tankite, but it is not fully complete just yet, look down to the next tutorial to finish of your epic BLOCK!!!
Rollback Post to RevisionRollBack
I made this map! Please check it out! It's a really awesome map that took me over a year to make! :3
public class BlockCow extends Block
{
public BlockCow(int i, int j)
{
super(i, j, Material.ice);
setStepSound(soundGrassFootstep);
}
as you can see, it extends Block, this will make it able to set a lot of cool properties, here is a few
first, super(i, j, Material.ice);
this changes the material, i am pretty sure that is the block breaking sound, not sure though
next, setStepSound(soundGrassFootstep);
this adds a lot of good sound to it
a great property
slipperiness(1.1F);
if you put it above 1.0F, you will slowly gain speed and run REAL FAST!
its (may be) the same code they use in the aether mod for quick soil, its great quality for such a simple code :smile.gif:
next, is the drop
{
return mod_***.cow.blockID;
}
this changes the drop, if you want it to drop, dirt you can add this:
return Block.dirt.blockID
pretty simple eh?
now what you have been waiting for... drum roll!
some awesome properties!
you can do some awesome things with blocks, i wont get too complicated though
this will make you go sky high when you jump on it!!!
really awesome :smile.gif:
change the entity.motionY += 2.0; higher if you want it to go much higher, but be careful, about 0.1F is 1 block, or 2!
change the "portal" to "splash" and it will start spaying out water!
now a couple more!
public int quantityDropped(Random random)
{
return 1;
}
this defines how much of the block is dropped,
ok, now for the whole code if your confused
package net.minecraft.src;
import java.util.Random;
public class BlockCow extends Block
{
public BlockCow(int i, int j)
{
super(i, j, Material.ice);
slipperiness = 1.17566F;
setStepSound(soundClothFootstep);
}
public int idDropped(int i, Random random)
{
return mod_***.cow.blockID;
}
public int quantityDropped(Random random)
{
return 1;
}
}
and there you have it, test your MCP, and see your slippery block in the works!
Rollback Post to RevisionRollBack
I made this map! Please check it out! It's a really awesome map that took me over a year to make! :3
you should be able to understand this after the block code
next part! and last part!
public static Item cheese = (new ItemFood(3068, 10, true)).setItemName("healthpotion");
like the block properties, but its item properties instead
and, the part after ItemFood, this (3068, 10, true))
true makes it feed-able to wolves the 10 sets its healing power, and 3068 is the ID
now, the part where it says, new ItemFood sets it to be a food, if you dont want it to be food just use this code
public static Item cheese = (new ItemCheese(3031)).setItemName("cheese");
ok, you've done half of it!
now for the
ItemCheese!
package net.minecraft.src;
public class ItemHealthpotion extends ItemFood
{
public ItemHealthpotion(int i, int j, boolean flag, int k)
{
super(i, j, flag);
maxStackSize = 64;
}
}
really, this is the easiest code ever
all to tell you is maxStackSize = 64;
is the max stack size, thats all
again, if you dont want it to be a food, change this
public class ItemHealthpotion extends ItemFood
to this!
public class ItemHealthpotion extends Item
ok, here are all the codes,
mod_***
package net.minecraft.src;
import java.util.Random;
public class mod_Tankite extends BaseMod
{
public mod_Tankite()
{
ModLoader.RegisterBlock(cow);
ModLoader.AddName(tankite, "Tankite");
ModLoader.AddRecipe(new ItemStack(tankite, 1), new Object[] {
"XX", "XX", Character.valueOf('X'), Block.dirt
});
ModLoader.AddRecipe(new ItemStack(cheese, 1), new Object[] {
"XX", Character.valueOf('X'), Block.dirt
});
public String Version()
{
return "1.7.3 Items, Blocks";
}
public static Block tankite = (new BlockTankite(211, ModLoader.addOverride("/terrain.png", "/Tankite.png"))).setHardness(1F).setLightValue(1.0F).setResistance(5000F).setBlockName("tankite");
public static Item cheese = (new ItemFood(3068, 10, true)).setItemName("cheese");
}
ItemCheese
package net.minecraft.src;
public class ItemHealthpotion extends ItemFood
{
public ItemHealthpotion(int i, int j, boolean flag, int k)
{
super(i, j, flag);
maxStackSize = 64;
}
}
by now you should have something like this:
nom nom noms. drinking my nom potions
Rollback Post to RevisionRollBack
I made this map! Please check it out! It's a really awesome map that took me over a year to make! :3
first, to set up our generation, make a new mod_***
but this one will be a tiny bit different
here it is
package net.minecraft.src;
import java.util.Random;
public class mod_Tankitegen extends BaseMod
{
public mod_Tankitegen()
{
}
public String Version()
{
return "1.7.3";
}
public void GenerateSurface(World world, Random rand, int i, int j)
{
{
for(int k = 0; k <0.1; k++)
{
int RandPosX = i + rand.nextInt(16);
int RandPosY = rand.nextInt(128);
int RandPosZ = j + rand.nextInt(16);
(new WorldGenT()).generate(world, rand, RandPosX, RandPosY, RandPosZ);
}
}
}
so, its simple, pretty much tells it on load to generate your, umm, letter T!
and if your wondering, its way too common!! then just do this:
the first one is X, or width
second one is Y, or hight
and the last one is Z, or length
this one also selects an area to generate, kind of like, MCEdit selecting, or Single Player Commands, wand, to select areas
so, now we will use more of the
world.setBlock(i + i1, j + l1, k + k1, mod_***.cow.blockID);
but change it around abit
so change it to this
world.setBlock(i + 0, j + 3, k + 1, 17);
remember you cant use the block, like Block.dirt.blockID like last time
you MUST use the ID!
so here you must imagine, your in a 3D plane, full of nothing, now you must use the codes to direct where the block will go,
chuck a bunch of these in, and change them around
remember put them in the same spot as the other world.setBlock
and DO NOT, use too many world.setBlock(i + 0, j + 3, k + 1, 17); as it will cause, huge lag!
and that lag is pretty damn annoying :0
so theres the tutorial, here are the files
mod_yogenerate!
package net.minecraft.src;
import java.util.Random;
public class mod_Tankitegen extends BaseMod
{
public mod_Tankitegen()
{
}
public String Version()
{
return "1.7.3";
}
public void GenerateSurface(World world, Random rand, int i, int j)
{
{
for(int k = 0; k <0.1; k++)
{
int RandPosX = i + rand.nextInt(16);
int RandPosY = rand.nextInt(128);
int RandPosZ = j + rand.nextInt(16);
(new WorldGenT()).generate(world, rand, RandPosX, RandPosY, RandPosZ);
}
}
}
ok, now for a generation that you will say EASY to :smile.gif:
so first, create a new block using my other block tutorial and make it an ore, like... cow ore!
after that you want it to generate, but if you use the other generation, it will not be random enough!
so, just put this chunk of code in your mod_***
public void GenerateSurface(World world, Random random, int i, int j)
{
for(int k = 0; k < 20; k++)
{
int j1 = i + random.nextInt(16);
int i2 = random.nextInt(128);
int l2 = j + random.nextInt(16);
(new WorldGenMinable(tankiteore.blockID, 12)).generate(world, random, j1, i2, l2);
}
}
but, if you want more than one to generate just do this!
public void GenerateSurface(World world, Random random, int i, int j)
{
for(int k = 0; k < 20; k++)
{
int j1 = i + random.nextInt(16);
int i2 = random.nextInt(128);
int l2 = j + random.nextInt(16);
(new WorldGenMinable(tankiteore.blockID, 12)).generate(world, random, j1, i2, l2);
}
for(int l = 0; l < 4; l++)
{
int k1 = i + random.nextInt(16);
int j2 = random.nextInt(16);
int i3 = j + random.nextInt(16);
(new WorldGenMinable(poweriteore.blockID, 6)).generate(world, random, k1, j2, i3);
}
and if you want it to generate in the nether... do this!
public void GenerateNether(World world, Random random, int i, int j)
{
for(int k = 0; k < 20; k++)
{
int j1 = i + random.nextInt(16);
int i2 = random.nextInt(128);
int l2 = j + random.nextInt(16);
(new WorldGenMinable(tankiteore.blockID, 12)).generate(world, random, j1, i2, l2);
}
for(int l = 0; l < 4; l++)
{
int k1 = i + random.nextInt(16);
int j2 = random.nextInt(16);
int i3 = j + random.nextInt(16);
(new WorldGenMinable(poweriteore.blockID, 6)).generate(world, random, k1, j2, i3);
}
now, some explaining, these fellas here
int k1 = i + random.nextInt(16);
int j2 = random.nextInt(16);
int i3 = j + random.nextInt(16);
are where it can generate in each chunk
the second one is how high it can generate, coal and iron have 128
but diamonds would have 16
this chunk of code here
(new WorldGenMinable(poweriteore.blockID, 6)).generate(world, random, k1, j2, i3);
shows what will generate, and the amount of it found in a vein, just after poweriteore.blockID is how much will generate in each vein
now this part here
for(int l = 0; l < 4; l++)
is the amount generated in a chunk
ok, with that simple generation over i want you to create a new item that is an ingot of the ore you are doing
after that i will show you how to add smelting!
here it is
remember, chuck it right above the recipes!
ModLoader.AddSmelting(cow.blockID, new ItemStack(cowingot));
see, pretty simple hey?
when i mean chuck it right behind i mean here:
ModLoader.AddSmelting(infiniumore.blockID, new ItemStack(infiniumingot));
ModLoader.AddRecipe(new ItemStack(tankite, 1), new Object[] {
"XX", "XX", Character.valueOf('X'), tankitebar
});
see? :smile.gif:
ok, next tutorial... a block that hurts you!!!
like spikes :tongue.gif:
mod_***
package net.minecraft.src;
import java.util.Random;
public class mod_Tankite extends BaseMod
{
public mod_Tankite()
{
ModLoader.RegisterBlock(cow);
ModLoader.AddName(tankite, "Tankite");
ModLoader.AddSmelting(cow.blockID, new ItemStack(cowingot));
ModLoader.AddRecipe(new ItemStack(tankite, 1), new Object[] {
"XX", "XX", Character.valueOf('X'), Block.dirt
});
ModLoader.AddRecipe(new ItemStack(cheese, 1), new Object[] {
"XX", Character.valueOf('X'), Block.dirt
});
public void GenerateSurface(World world, Random random, int i, int j)
{
for(int k = 0; k < 20; k++)
{
int j1 = i + random.nextInt(16);
int i2 = random.nextInt(128);
int l2 = j + random.nextInt(16);
(new WorldGenMinable(cowore.blockID, 12)).generate(world, random, j1, i2, l2);
}
public String Version()
{
return "1.7.3 Items, Blocks";
}
public static Block tankite = (new BlockTankite(211, ModLoader.addOverride("/terrain.png", "/Tankite.png"))).setHardness(1F).setLightValue(1.0F).setResistance(5000F).setBlockName("tankite");
public static Item cheese = (new ItemFood(3068, 10, true)).setItemName("cheese");
}
and well, by now, you should have something like this!
IM'A MINING MAH ORES!!!
Rollback Post to RevisionRollBack
I made this map! Please check it out! It's a really awesome map that took me over a year to make! :3
I warn you! do not attempt this tutorial in 1.8.1! it will NOT work!
ok, well today i will show you how to create...
Spikes! they HURT BAD!
ok, REAL simple tutorial here, so i might add some more to it
so first create a new block, yep, done, but it does nothing, easy to fix!
go into your BlockSpikes
and chuck this code in
public boolean isOpaqueCube()
{
return false;
}
public AxisAlignedBB getCollisionBoundingBoxFromPool(World world, int i, int j, int k)
{
return null;
}
public int getRenderType()
{
return 1;
}
public boolean renderAsNormalBlock()
{
return false;
}
now, these fella's will make it like the web block, so remember to make your png most transparent, but with spikes, its hard to explain :tongue.gif:
so this makes it like a kinda like a flower
now chuck this buddy in
public void onEntityCollidedWithBlock(World world, int i, int j, int k, Entity entity)
{
entity.attackEntityFrom(null, 4);
}
this will make it hurt you 4 hp, so 2 hearts
now if you want them to heal you just do this
public void onEntityCollidedWithBlock(World world, int i, int j, int k, Entity entity)
{
entity.attackEntityFrom(null, -4);
}
now if you walk into it, bam! you will get healed, annoyingly it will have that gay hurt sound, so you will be getting healed, and you will be like, urrgg aahhhh blaaa XD
now, you can change it, to make it into a normal block, just get rid of this code:
public boolean isOpaqueCube()
{
return false;
}
public AxisAlignedBB getCollisionBoundingBoxFromPool(World world, int i, int j, int k)
{
return null;
}
public int getRenderType()
{
return 1;
}
public boolean renderAsNormalBlock()
{
return false;
}
well, there you have it, your own personal, SPIKES!
you can make mob traps with these deadly things
full code:
package net.minecraft.src;
import java.util.Random;
public class BlockSpikes extends Block
{
public BlockSpikes(int i, int j)
{
super(i, j, Material.rock);
}
public int idDropped(int i, Random random)
{
return mod_Tankite.spikes.blockID;
}
public void onEntityCollidedWithBlock(World world, int i, int j, int k, Entity entity)
{
entity.attackEntityFrom(null, 4);
}
public boolean isOpaqueCube()
{
return false;
}
public AxisAlignedBB getCollisionBoundingBoxFromPool(World world, int i, int j, int k)
{
return null;
}
public int getRenderType()
{
return 1;
}
public boolean renderAsNormalBlock()
{
return false;
}
there you go :smile.gif:
with this tutorial, you should have this!
YAY!
Rollback Post to RevisionRollBack
I made this map! Please check it out! It's a really awesome map that took me over a year to make! :3
ok, now for grenades, they are very complex, and pretty hard too understand, but if you really think about them its easy :smile.gif:
because all you got to do is make an item launch and entity that sets a tick then explodes when the tick reaches a curtain point... ok maybe that is hard XD
if you don't know what an entity is, its a living thing, or a thing that can interact with the environment... hard to explain
enough of me rambling along about stuff time for the real tutorial!
ok here we go
first you must take the steps and CREATE A NEW ITEM called grenade
now go into your ItemGrenade and now you have to chuck a few codes in to spawn the EntityGrenade on right click!
// Decompiled by Jad v1.5.8g. Copyright 2001 Pavel Kouznetsov.
// Jad home page: http://www.kpdus.com/jad.html
// Decompiler options: packimports(3) braces deadcode
package net.minecraft.src;
// Referenced classes of package net.minecraft.src:
// Item, EntityGrenade, World, ItemStack,
// EntityPlayer
public class ItemGrenade extends Item
{
public ItemGrenade(int i)
{
super(i);
setIconIndex(30);
grenadeID = shiftedIndex;
}
public ItemStack onItemRightClick(ItemStack itemstack, World world, EntityPlayer entityplayer)
{
world.entityJoinedWorld(new EntityGrenade(world, entityplayer));
itemstack.stackSize--;
return itemstack;
}
public static int grenadeID;
}
as you can see here there is a new code, that is onItemRightClick
that makes the entitygrenade join the world on right click :tongue.gif:
there is also a bunch of other things in it... not sure what the purpose of them are, but just chuck it in.
so now that thats over and done with we need to add... EntityGrenade!
yes, on this tutorial, we will create a new block, that is... a mushroom!
it also glows :smile.gif:
ok, so here we go
first, like all new block things, create a new block, just a normal block, we will change it soon, now check back at the making a new block tutorial, and you can see that there is .setLightValue(1.0F) put that where the tutorial tells you, you might want to change it so it glows less, remember, i you put it over 1.0 it will craft minecraft
so first, put this code inside where you put the slipperiness and stuff
then make a new one, remember Emerald is diamond, change it to the power you want, here is what all of them do.
"the first is the material number, similar to the item number, and should be unique to the others. The second is the harvest level, meaning what it can actually mine. The third number is the amount of uses it can do before it breaks, The fourth is efficiency on the material it's used for, and the fifth is the damage it does to entities" this was from drumsofdoom :biggrin.gif: thanks
so after thats done create your recipes and your done!
:smile.gif:
another thing to note, all of the properties on the tools extend something else, you dont need to make a new file like cowpickaxe, just make them extend this:
tankitepickaxe = (new ItemPickaxe(3036, EnumToolMaterialTankite.TANKITE)).setItemName("tankitepickaxe");
tankitehoe = (new ItemHoe(3038, EnumToolMaterialTankite.TANKITE)).setItemName("tankitehoe");
tankiteaxe = (new ItemAxe(3039, EnumToolMaterialTankite.TANKITE)).setItemName("tankiteaxe");
tankitesword = (new ItemSword(3040, EnumToolMaterialTankite.TANKITE)).setItemName("tankitesword");
tankiteshovel = (new ItemSpade(3041, EnumToolMaterialTankite.TANKITE)).setItemName("tankiteshovel");
see what i mean, if you have a question, just post it :smile.gif:
Rollback Post to RevisionRollBack
I made this map! Please check it out! It's a really awesome map that took me over a year to make! :3
ok, after doing your tools tutorial you want more... SURE!
have this Armor!
Tutorial!
ok, armour is simple, if you have the tools and weapons done
lets get to it,
first make 4 new items, just normal items now go into your mod_***
and change the item properties from this:
public static Item bottle = (new ItemBottle(3069)).setItemName("bottle");
to this:
public static Item tankitehelmet = (new ItemArmor(3047, 1, ModLoader.AddArmor("tankite"), 0)).setItemName("Tankitehelmet");
public static Item tankitebody = (new ItemArmor(3048, 1, ModLoader.AddArmor("tankite"), 1)).setItemName("Tankitebody");
public static Item tankitelegs = (new ItemArmor(3049, 1, ModLoader.AddArmor("tankite"), 2)).setItemName("Tankitelegs");
public static Item tankiteboots = (new ItemArmor(3050, 1, ModLoader.AddArmor("tankite"), 3)).setItemName("Tankiteboots");
note that after add armor they have a number, 0 = helmet, 1 = bodyplate, 2 = legs, 3 = boots
ok, now that thats done
its easy, now remember what you did with the ModLoader.AddArmor("***")
you will require that name, just copy diamond armour or something .png
then change it, call it ***_1 and ***_2
i think, then it should work!
and you will be able to equip your epic armour!
full codes not to be here, sorry
after doing this... and the tools well, you should end up with...
THIS!
but not as many tools XD
Rollback Post to RevisionRollBack
I made this map! Please check it out! It's a really awesome map that took me over a year to make! :3
ok, lets get right into it, first make a new block, then open up Blocknewblockthing
now pretty simple, put in this code, and it will make it will spawn lightning when redstone powered!
ok, now thats done!
you now know how to make it, here i will break it down
the is a simple constructer, just checks if the block next to it is powered redstone, then it will do the function, (i think)
world.entityJoinedWorld(new EntityLightningBolt(world, i, j, k));
you probably don't need the full code, its just one thing!
well, have fun
here are some examples of what entity's you can spawn, im not sure if they work with this code though
EntityLightningBolt
EntityCow
EntityZombie
EntityCreeper
EntityArrow
EntityYourGrenade (if you use this one you should make it resistant to TNT)
EntityMonster (not sure about this one, i think its a human looking guy that chases you)
EntityGiant (that would be fun)
good luck! :smile.gif:
Rollback Post to RevisionRollBack
I made this map! Please check it out! It's a really awesome map that took me over a year to make! :3
first, you must find you block property line, which should look a bit like this
public static Block spikes = (new BlockIronspikes(191, ModLoader.addOverride("/terrain.png", "/Iron Spikes.png"))).setHardness(1F).setBlockName("spikes");
and you must change it more like this
public static Block spikes = (new BlockIronspikes(191, 0))).setHardness(1F).setBlockName("spikes");
this will make it so there is no texture here, so now into our blockMultitex block, or whatever you called it
now, you must change your publicBlock to look more like this
public BlockNetherwood(int i, int j)
{
super(i, logSide, Material.wood);
}
the logSide part is already defined, we will get to it, but change logSide to the texture you will use most in the block
now add this function to your block
public int getBlockTextureFromSideAndMetadata(int i, int j)
{
if(i <= 1 && j <= 3)
{
return logTop;
}
if(j <= 1)
{
return logSide;
} else
{
return logSide;
}
}
this will be what sides each textures on!
now from groxmappers tutorial, he has this code which will show you what all of the sides, numbers are..
public int getBlockTexture(IBlockAccess iblockaccess, int i, int j, int k, int l)
{
if(l == 5)
{
return blockIndexInTexture;
}
if(l == 4)
{
return blockIndexInTexture;
}
if(l == 3)
{
return blockIndexInTexture;
}
if(l == 2)
{
return blockIndexInTexture;
}
if(l == 1)
{
return blockIndexInTexture2;
}
if(l == 0)
{
return blockIndexInTexture2;
}
return 0;
}
and here is his explanation..
This setup will produce a setup like wood: a different texture for the top/bottom. it's very simple to explain. L 0-1 is the top/bottom, L 2-5 are the sides. The "return 0;" line is only called if you did not include all of the sides (which we did). Think of it as a base; if it's not overriden it will default to that. You can set this to a custom texture too if you for example only want to change the top/bottom. Just add the L 0-1 lines using one texture and make the "return 0;" line the other texture.
now you know how to do it... but there is... ONE more thing...
add this to your second bottom line, and all the other textures you want
public static int logTop = ModLoader.addOverride("/terrain.png", "/Netherwoodtop.png");
public static int logSide = ModLoader.addOverride("/terrain.png", "/Netherwood.png");
now this is from my code, but it just say what texture the logSide and logBottom booleans have!
now full code time :biggrin.gif:
Blockfile
package net.minecraft.src;
import java.util.Random;
public class BlockNetherwood extends Block
{
public BlockNetherwood(int i, int j)
{
super(i, logSide, Material.wood);
}
public int idDropped(int i, Random random)
{
return mod_Tankite.netherwood.blockID;
}
public int getBlockTextureFromSideAndMetadata(int i, int j)
{
if(i <= 1 && j <= 3)
{
return logTop;
}
if(j <= 1)
{
return logSide;
} else
{
return logSide;
}
}
public static int logTop = ModLoader.addOverride("/terrain.png", "/Netherwoodtop.png");
public static int logSide = ModLoader.addOverride("/terrain.png", "/Netherwood.png");
}
Big credits to groxmapper, for helping me out with this :biggrin.gif:
Making a block, that does stuff, when placed, right clicked, or left clicked!
ok, now this isn't a very hard tutorial, so, lets get straight to it!
ok, so first, make a new block, done! then open up your new block.. so now, here are all the lists of things we can do to our block!
public void onBlockRemoval(World world, int i, int j, int k)
{
}
public void onBlockPlaced(World world, int i, int j, int k, int l)
{
}
public void onBlockClicked(World world, int i, int j, int k, EntityPlayer entityplayer)
{
}
public boolean blockActivated(World world, int i, int j, int k, EntityPlayer entityplayer)
{
}
pretty easy to understand, just a bunch of constucters, so, now what we do is this:
if we want it to stike lightning, we just add this to it!
world.entityJoinedWorld(new EntityLightningBolt(world, i, j, k));
so it would look like this:
public boolean blockActivated(World world, int i, int j, int k, EntityPlayer entityplayer)
{
world.entityJoinedWorld(new EntityLightningBolt(world, i, j, k));
}
see? now you understand it :smile.gif:
there are lots of things you can make it spawn, i will add more later, because you have to nerf the code a bit
well good luck!
full code:
// Decompiled by Jad v1.5.8g. Copyright 2001 Pavel Kouznetsov.
// Jad home page: http://www.kpdus.com/jad.html
// Decompiler options: packimports(3) braces deadcode
package net.minecraft.src;
// Referenced classes of package net.minecraft.src:
// Block, Material
public class BlockDirt extends Block
{
protected BlockDirt(int i, int j)
{
super(i, j, Material.ground);
}
public boolean blockActivated(World world, int i, int j, int k, EntityPlayer entityplayer)
{
world.entityJoinedWorld(new EntityLightningBolt(world, i, j, k));
}
}
Rollback Post to RevisionRollBack
I made this map! Please check it out! It's a really awesome map that took me over a year to make! :3
just try both, and BAM! your enemys will set ablaze!
Understanding Errors please read!
well, i found that many people have tons of errors, and they dont know how to fix them, this tutorial will show you how to fix those nasty errors
so say this guy pops up when you recompile..
src\minecraft\net\minecraft\src\WorldGenT.java:26: cannot find symbol
symbol : variable Lavaore
its saying it cant find Lavaore, but what it could find, is the ID of your block!
so simply rename it, to 200 if thats what its ID is, or maybe 150, :tongue.gif:
now say you get this simple error when recompiling, that says, something like this:
"Reached end of file while parsing"
but its much longer, its simple to fix, just chuck a curly bracket (this }) at the end, because it cant find where to end the file, so it gives you the error!
Making a block spawn on right click
this is pretty simple, but you wouldn't just easily create it of the spot, so all you have to do, is chuck this in your item file!
public boolean onItemUse(ItemStack itemstack, EntityPlayer entityplayer, World world, int i, int j, int k, int l)
{
super.onItemUse(itemstack,entityplayer,world,i,j,k,l);
if(l==0)j--;
if(l==1)j++;
if(l==2)k--;
if(l==3)k++;
if(l==4)i--;
if(l==5)i++;
world.setBlockWithNotify(i,j,k,BLOCKIDHERE);
return true;
}
this will make it, when the player right clicks, it will spawn a block where he right clicks!
now for some more complex ones!
from request, how to make the player, get trapped in ice, or something else! (good for shields)
public boolean onItemUse(ItemStack itemstack, EntityPlayer entityplayer, World world, int i, int j, int k, int l)
{
super.onItemUse(itemstack,entityplayer,world,i,j,k,l);
if(l==0)j--;
if(l==1)j++;
if(l==2)k--;
if(l==3)k++;
if(l==4)i--;
if(l==5)i++;
for(int i1 = i-2; i1 < i+2; i1++)
{
for(int j1 = j-2; j1 < j+2; j1++)
{
for(int k1 = k-2; k1 < k+2; k1++)
{
if( (i1>i-5 && i1<i+4 && j1>j-5 && j1<j+4 && k1>j-5 && k1<k+4)==false) world.setBlockWithNotify(i1,j1,k1,BLOCKIDHERE);
}
}
}
return true;
}
this will, select a cube, then make sure its hollow, then set the block, the ID you chose!
it works pretty awesomely
how to make a block GLOW! upon redstone activation
pretty complex.. but here is what you have to do
add this to your block (you must make 2 types, a glowing one, and a non glowing onw
public void onNeighborBlockChange(World world, int i, int j, int k, int l)
{
if(world.isBlockIndirectlyGettingPowered(i, j, k))
{
world.setBlockWithNotify(i, j, k, mod_Yourmod.Lighton.blockID);
} else
{
world.setBlockWithNotify(i, j, k, mod_Yourmod.Lightoff.blockID);
}
}
Playing since Beta 1.3_01. Yeah. I like BTW. Or used to. Still do. Stuff Technic. (Back in the day...)
*Plays Minecraft on a craptop* *Optifine user since Optimine* *Using mods since Beta 1.5_01*
right here is the
Helping Point!
list of tutorials!
I MUST WARN YOU! A BUNCH OF THESE TUTORIALS WILL NOT WORK WITH 1.8!
well, thats all the tutorials for now.
good luck with modding, and i hope you do very well!
now, what the helping point is here for... is to help you of course!
now, if you need some spare .png's just check out inside the spoiler, there will be many there :smile.gif:
theres all of them for now :smile.gif:
Banner!
here is the banner, put this in your signature...
and it will look like this!
now, remember to comment if you having troubles, and please click the + button :smile.gif: its really nice if you do!
I made this map! Please check it out! It's a really awesome map that took me over a year to make! :3
ok, so this may be your first tutorial, dont worry, it's not that hard, it just needs time
now, first you have to set up MCP, might make a tutorial, but come here with it set up
so, starting of with modloader is easy
first make a class named
mod_***
*** = the name of your mod
open it up and put up at the top this
this shows MCP that this is a file, hard too explain, just go with it
now we need to add this
it shows sets up the file, telling it what to extend
next we need to add all the block files do this
this will register the block to show up on minecraft, VERY IMPOTANT
next this, its a recipe for the block and item,
those are just 2 recipes, see how it works, but remember if you want a recipe like a stick use this
now that thats over with, down to some more! The string version!
use this code
remember, in error reports it will say mod_modname 1.7.3
so keep it like that
now to the part that sets properties to the blocks!!!
use this code here
now this makes it so it looks for the .png file called "Cow"
also, it makes it search for a file called BlockCow, and after that, the part that says BlockCow(211, the 211 is the block ID
it will also set the hardness, but, there is much more than just plain old Hardness :smile.gif:
here are some propertys
.setLightValue(1.0F) makes it glow like a torch
.setResistence(100F) makes it more invulnerable to TNT or other explosions
now, you have your awesome file!!!
now, you might be thinking, WHERE DO I PUT IT!?!?! ARRRGHHHHH!
well your in luck, here is a whole file, with a block :smile.gif:
well, there you go! your own mod_tankite, but it is not fully complete just yet, look down to the next tutorial to finish of your epic BLOCK!!!
I made this map! Please check it out! It's a really awesome map that took me over a year to make! :3
hey, now i will show you how to finish off your block, after setting up your mod_***
today we will make...... a Cow block!
so first we start of with the thing we ALWAYS START OF WITH!
guess what it is
the
the next part is very similar, here it is
as you can see, it extends Block, this will make it able to set a lot of cool properties, here is a few
first, super(i, j, Material.ice);
this changes the material, i am pretty sure that is the block breaking sound, not sure though
next, setStepSound(soundGrassFootstep);
this adds a lot of good sound to it
a great property
slipperiness(1.1F);
if you put it above 1.0F, you will slowly gain speed and run REAL FAST!
its (may be) the same code they use in the aether mod for quick soil, its great quality for such a simple code :smile.gif:
next, is the drop
this changes the drop, if you want it to drop, dirt you can add this:
return Block.dirt.blockID
pretty simple eh?
now what you have been waiting for... drum roll!
some awesome properties!
you can do some awesome things with blocks, i wont get too complicated though
so here is a few
this will make you go sky high when you jump on it!!!
really awesome :smile.gif:
change the entity.motionY += 2.0; higher if you want it to go much higher, but be careful, about 0.1F is 1 block, or 2!
next some awesome looks for your block
spawns particles like a portal, pretty cool, but you can use much more, with this code here
change the "portal" to "splash" and it will start spaying out water!
now a couple more!
this defines how much of the block is dropped,
ok, now for the whole code if your confused
and there you have it, test your MCP, and see your slippery block in the works!
I made this map! Please check it out! It's a really awesome map that took me over a year to make! :3
ok, here we go, for some items
first we need to add some stuff to our mod_***
here is the part that shows it where the .png is
you should be able to understand this after the block code
next part! and last part!
like the block properties, but its item properties instead
and, the part after ItemFood, this (3068, 10, true))
true makes it feed-able to wolves the 10 sets its healing power, and 3068 is the ID
now, the part where it says, new ItemFood sets it to be a food, if you dont want it to be food just use this code
ok, you've done half of it!
now for the
ItemCheese!
really, this is the easiest code ever
all to tell you is maxStackSize = 64;
is the max stack size, thats all
again, if you dont want it to be a food, change this
to this!
ok, here are all the codes,
mod_***
ItemCheese
by now you should have something like this:
nom nom noms. drinking my nom potions
I made this map! Please check it out! It's a really awesome map that took me over a year to make! :3
Generation!
yes i know, GENERATION
ok here we go!
but this one will be a tiny bit different
here it is
so, its simple, pretty much tells it on load to generate your, umm, letter T!
and if your wondering, its way too common!! then just do this:
and so on
so, you should understand most of that
now to the part why you should try hard at maths XD
ok here we go,
this code is a code from my mod, (in signature)
it generates, Golden clouds in the sky, but i changed a few things for you, to make it generate your... cow block in the sky!
ok, now for some explaining, this part here
the first one is X, or width
second one is Y, or hight
and the last one is Z, or length
this one also selects an area to generate, kind of like, MCEdit selecting, or Single Player Commands, wand, to select areas
so, now we will use more of the
but change it around abit
so change it to this
remember you cant use the block, like Block.dirt.blockID like last time
you MUST use the ID!
so here you must imagine, your in a 3D plane, full of nothing, now you must use the codes to direct where the block will go,
chuck a bunch of these in, and change them around
remember put them in the same spot as the other world.setBlock
and DO NOT, use too many world.setBlock(i + 0, j + 3, k + 1, 17); as it will cause, huge lag!
and that lag is pretty damn annoying :0
so theres the tutorial, here are the files
mod_yogenerate!
WorldGenT
heres the cool kind of stuff you can make with it
pretty cool hey?
check this one out, made with a few variables
see, you can make really cool stuff, you just have to put some time into it
Extras!
Making a sphere generate
now, what Math.pow means, is to the power of, so Math.pow(3,3) would be 3x3x3 i think
then it just rounds it up into a ball
thats that
now, i must credit Guff for most of this, as his tutorial Here and a lot of others he made, did teach me, check out his tutorial!
also, im crediting Will.eze, for helping me with some generation and a lot of other things! you can check his mod out Here
I made this map! Please check it out! It's a really awesome map that took me over a year to make! :3
Simple generation + ore!
ok, now for a generation that you will say EASY to :smile.gif:
so first, create a new block using my other block tutorial and make it an ore, like... cow ore!
after that you want it to generate, but if you use the other generation, it will not be random enough!
so, just put this chunk of code in your mod_***
but, if you want more than one to generate just do this!
and if you want it to generate in the nether... do this!
now, some explaining, these fellas here
are where it can generate in each chunk
the second one is how high it can generate, coal and iron have 128
but diamonds would have 16
this chunk of code here
shows what will generate, and the amount of it found in a vein, just after poweriteore.blockID is how much will generate in each vein
now this part here
is the amount generated in a chunk
ok, with that simple generation over i want you to create a new item that is an ingot of the ore you are doing
after that i will show you how to add smelting!
here it is
remember, chuck it right above the recipes!
see, pretty simple hey?
when i mean chuck it right behind i mean here:
see? :smile.gif:
ok, next tutorial... a block that hurts you!!!
like spikes :tongue.gif:
mod_***
package net.minecraft.src;
import java.util.Random;
public class mod_Tankite extends BaseMod
{
public mod_Tankite()
{
ModLoader.RegisterBlock(cow);
ModLoader.AddName(tankite, "Tankite");
ModLoader.AddSmelting(cow.blockID, new ItemStack(cowingot));
ModLoader.AddRecipe(new ItemStack(tankite, 1), new Object[] {
"XX", "XX", Character.valueOf('X'), Block.dirt
});
ModLoader.AddRecipe(new ItemStack(cheese, 1), new Object[] {
"XX", Character.valueOf('X'), Block.dirt
});
and well, by now, you should have something like this!
IM'A MINING MAH ORES!!!
I made this map! Please check it out! It's a really awesome map that took me over a year to make! :3
ok, well today i will show you how to create...
Spikes! they HURT BAD!
ok, REAL simple tutorial here, so i might add some more to it
so first create a new block, yep, done, but it does nothing, easy to fix!
go into your BlockSpikes
and chuck this code in
now, these fella's will make it like the web block, so remember to make your png most transparent, but with spikes, its hard to explain :tongue.gif:
so this makes it like a kinda like a flower
now chuck this buddy in
this will make it hurt you 4 hp, so 2 hearts
now if you want them to heal you just do this
now if you walk into it, bam! you will get healed, annoyingly it will have that gay hurt sound, so you will be getting healed, and you will be like, urrgg aahhhh blaaa XD
now, you can change it, to make it into a normal block, just get rid of this code:
well, there you have it, your own personal, SPIKES!
you can make mob traps with these deadly things
full code:
there you go :smile.gif:
with this tutorial, you should have this!
YAY!
I made this map! Please check it out! It's a really awesome map that took me over a year to make! :3
Grenades!
yes thats right
GRENADES!!
ok, now for grenades, they are very complex, and pretty hard too understand, but if you really think about them its easy :smile.gif:
because all you got to do is make an item launch and entity that sets a tick then explodes when the tick reaches a curtain point... ok maybe that is hard XD
if you don't know what an entity is, its a living thing, or a thing that can interact with the environment... hard to explain
enough of me rambling along about stuff time for the real tutorial!
ok here we go
first you must take the steps and CREATE A NEW ITEM called grenade
now go into your ItemGrenade and now you have to chuck a few codes in to spawn the EntityGrenade on right click!
as you can see here there is a new code, that is onItemRightClick
that makes the entitygrenade join the world on right click :tongue.gif:
there is also a bunch of other things in it... not sure what the purpose of them are, but just chuck it in.
so now that thats over and done with we need to add... EntityGrenade!
so, here we go.. this is REAL complicated here
here is the whole file
ok, i told you it was complicated i will quickly go though it
this part here sets the velocity, or speed, whatever
hmm, i guess you dont really need to know what parts do what
im too tired to tell you :sleep.gif:
so umm, just chuck those fellas in and there you have it... a grenade
remember, the png for your item grenade is the same as the entity grenade :smile.gif:
ok, now to show you some more complicated grenades
well, first a splitnade, or Cluster grenade
all you have to do, is copy all the codes and make a completely new grenade
right now its the same, but you have to edit this code here
and make it like the ItemGrenade
but different
make it like this
you should probably understand it, just says, when i explode, i will shoot out 4 grenades in lots of directions, just change the names :tongue.gif:
ok now here is an important part...
this part here
change the 15F to the explosion size you want
hope you like this tutorial
by now, you should have this!
umm, chuck chuck
BBOOOOOOOMMMM!
I made this map! Please check it out! It's a really awesome map that took me over a year to make! :3
mushroom!
yes, on this tutorial, we will create a new block, that is... a mushroom!
it also glows :smile.gif:
ok, so here we go
first, like all new block things, create a new block, just a normal block, we will change it soon, now check back at the making a new block tutorial, and you can see that there is .setLightValue(1.0F) put that where the tutorial tells you, you might want to change it so it glows less, remember, i you put it over 1.0 it will craft minecraft
so first, put this code inside where you put the slipperiness and stuff
the
public class BlockMushroomCool i think
now, you must add the growing method, using the setTickOnLoad(true);
so add this to your block
now, if you want it to be able to grow in light, add this:
that should work, now you have a mushroom, that glows, and GROWS!
like a normal mushroom
now it should look a little like this
:smile.gif: good luck
I made this map! Please check it out! It's a really awesome map that took me over a year to make! :3
making a thing generate like reeds!
ok, this is not a very hard tutorial, so you do not need to add any new classes, all you need to do is edit your mod_***
this tutorial relates to the complex generation tutorial
so all you need to do is add this code into your mod_***
this will make a wood block generate on grass
you can change it so mushrooms generate or anything else you want
the place you need to put this code is just under your ore genration, no other brackets, just like this:
pretty simple, so there you have it, your own generating blocks
now if you want to get more complicated, you can do this
this will make wood generate in a wall 3 high, you cant add X or Z to it though, only Y
I made this map! Please check it out! It's a really awesome map that took me over a year to make! :3
a growing block that grows all over grass!
first, make a new block, same as always, now go into your BlockGrowingThing
and add these codes
this will make it on every tick, it may turn a grass block next to it into a GrowingThing
but where are the ticks?
easy to add, just go into this part
and add this
and there you go, you now have a block that will grow all over grass!
here is the whole code :smile.gif:
I made this map! Please check it out! It's a really awesome map that took me over a year to make! :3
Tools and weapons!
this will be a long, but not complicated tutorial
first make a few new items, but with the properties in your mod_*** change this
to this
this will change the material so then you can tell how strong it is or durability
ok now copy your enumToolMaterial and copy and paste, it, very important! paste it, then change its name to enumToolMaterialCow
go inside and find the line that says this
then make a new one, remember Emerald is diamond, change it to the power you want, here is what all of them do.
"the first is the material number, similar to the item number, and should be unique to the others. The second is the harvest level, meaning what it can actually mine. The third number is the amount of uses it can do before it breaks, The fourth is efficiency on the material it's used for, and the fifth is the damage it does to entities" this was from drumsofdoom :biggrin.gif: thanks
so it will look like this:
so after thats done create your recipes and your done!
:smile.gif:
another thing to note, all of the properties on the tools extend something else, you dont need to make a new file like cowpickaxe, just make them extend this:
see what i mean, if you have a question, just post it :smile.gif:
I made this map! Please check it out! It's a really awesome map that took me over a year to make! :3
A block that grows!
ok, so you want a block that grows like reeds, simple, first like always, make a new block.
when you have finished that go into your BlockGrowningNewBlock or whatever you named it
now first, you must set the tick, like this
after you've done that
put this code in
now this will make it slowly grow up, just like reeds
good luck with your growing block :smile.gif:
here is the full code:
good luck :smile.gif:
I made this map! Please check it out! It's a really awesome map that took me over a year to make! :3
have this
Armor!
Tutorial!
ok, armour is simple, if you have the tools and weapons done
lets get to it,
first make 4 new items, just normal items now go into your mod_***
and change the item properties from this:
to this:
note that after add armor they have a number, 0 = helmet, 1 = bodyplate, 2 = legs, 3 = boots
ok, now that thats done
its easy, now remember what you did with the ModLoader.AddArmor("***")
you will require that name, just copy diamond armour or something .png
then change it, call it ***_1 and ***_2
i think, then it should work!
and you will be able to equip your epic armour!
full codes not to be here, sorry
after doing this... and the tools well, you should end up with...
THIS!
but not as many tools XD
I made this map! Please check it out! It's a really awesome map that took me over a year to make! :3
Something that reacts to Redstone!
GOT IT WORKING THANKS TO STRENGTHOWNS
ok, lets get right into it, first make a new block, then open up Blocknewblockthing
now pretty simple, put in this code, and it will make it will spawn lightning when redstone powered!
ok, now thats done!
you now know how to make it, here i will break it down
the is a simple constructer, just checks if the block next to it is powered redstone, then it will do the function, (i think)
you probably don't need the full code, its just one thing!
well, have fun
here are some examples of what entity's you can spawn, im not sure if they work with this code though
EntityLightningBolt
EntityCow
EntityZombie
EntityCreeper
EntityArrow
EntityYourGrenade (if you use this one you should make it resistant to TNT)
EntityMonster (not sure about this one, i think its a human looking guy that chases you)
EntityGiant (that would be fun)
good luck! :smile.gif:
I made this map! Please check it out! It's a really awesome map that took me over a year to make! :3
block with different textured sides!
ok, lets go straight into it!
ok, to get to it
first, you must find you block property line, which should look a bit like this
and you must change it more like this
this will make it so there is no texture here, so now into our blockMultitex block, or whatever you called it
now, you must change your publicBlock to look more like this
the logSide part is already defined, we will get to it, but change logSide to the texture you will use most in the block
now add this function to your block
this will be what sides each textures on!
now from groxmappers tutorial, he has this code which will show you what all of the sides, numbers are..
and here is his explanation..
This setup will produce a setup like wood: a different texture for the top/bottom. it's very simple to explain. L 0-1 is the top/bottom, L 2-5 are the sides. The "return 0;" line is only called if you did not include all of the sides (which we did). Think of it as a base; if it's not overriden it will default to that. You can set this to a custom texture too if you for example only want to change the top/bottom. Just add the L 0-1 lines using one texture and make the "return 0;" line the other texture.
now you know how to do it... but there is... ONE more thing...
add this to your second bottom line, and all the other textures you want
now this is from my code, but it just say what texture the logSide and logBottom booleans have!
now full code time :biggrin.gif:
Blockfile
Big credits to groxmapper, for helping me out with this :biggrin.gif:
you can check out his tutorials here!
I made this map! Please check it out! It's a really awesome map that took me over a year to make! :3
Making a block, that does stuff, when placed, right clicked, or left clicked!
ok, now this isn't a very hard tutorial, so, lets get straight to it!
ok, so first, make a new block, done! then open up your new block.. so now, here are all the lists of things we can do to our block!
pretty easy to understand, just a bunch of constucters, so, now what we do is this:
if we want it to stike lightning, we just add this to it!
so it would look like this:
see? now you understand it :smile.gif:
there are lots of things you can make it spawn, i will add more later, because you have to nerf the code a bit
well good luck!
full code:
I made this map! Please check it out! It's a really awesome map that took me over a year to make! :3
A New Mob! WILL NOT WORK WITH 1.8!
ok, remember, i will NOT show you how to model, just how to make the mob :smile.gif:
ok, so lets get straight into it!
first, make 2 files, call one EntityYourMobName
and the other mod_CoolMobs
ok, but there is nothing in the files!
so lets start with the mod_CoolMobs
its much like your normal mod_*** but with some different parts, so chuck this in!
that is my code, a developed code thats grown bigger :tongue.gif:
see, that is the full code, now for some explaining:
so, this here:
shows how and where it will spawn, if its a monster, it will spawn in dark, creature, light and on grass
you can also do waterCreature. that will make it spawn in the water :smile.gif:
you know what string version means so no explaining there
now this part
that 0.4F at the end is how big its shadow is, keep the Render and Model the same, make it say Biped
so, now thats done, with your entity CoolMan
the 50 in it is the spawn rate, 50 is tons, make it lower by putting it to 5 or 10
chuck this in
now, this will make him hold an iron sword, and drop an iron sword
it will set many properties of him aswell
the cool man will attack you on sight!
also, if you want him to not attack you, get rid of this:
and make him extend entityCreature like this:
ok, now your done!
test it and you will see a cool guy!
Achievements!
now, achievements are pretty easy, so lets get to it :biggrin.gif:
so, first chuck this
here:
done :biggrin.gif:
so, Creator Of Planks is the name of the achievement, and Create wooden planks is the description :biggrin.gif:
nothing else to worry about there
so then you must chuck this:
in an empty spot like this:
this says, when a planks block is taken from crafting, it gives the achievement!
then add stat must be the same name, there are many other methods you can use, will list at bottom :biggrin.gif:
so, last part, chuck this in:
here:
ok, so 3450 is the ID of the achievement, 10, 2 is where it is placed, 10 = x and 2 = y, remember in maths? x first then y then z :0
Block.Planks is what block is on the achievement, and, well, the rest is not important!
but there you have it, your own achievement! test it out, cut a tree down, then craft it into planks and BAM!
well, here are the extra functions:
those are all the functions you can use, you can use more, but im not sure what!
i hope you enjoyed this tutorial, and good luck :biggrin.gif:
Making a bow (ranged weapon)
now this is quite simple, all it is is a little function!
chuck this in to an item file, that you have made, like itemAwesomeBow
what this will do it make it launch an arrow, and player the sound, bow!
so if you've done the grenades tutorial, you could change this
to this
but this just isn't complex enough, lets make a new arrow!!
ok, making a new arrow
simply like the grenade tutorial, you must make a new file, like EntityCoolArrow..
now with this file, it should look like the arrows file, which looks like this:
now, this is quite complex, but lets look for some important bits
this part here:
what the bottom part does, it count up the ticks in game, so when there has been 1200 ticks on ground it will die (dissapear)
so if you want it to die instantly when hitting the ground, just change this:
to this!
ok, i will finish the rest soon, sorry im out of time!
Making a plant like wheat!
Making a sword set your enemys on fire!
this is quite simple, you just have to add this into your sword item :biggrin.gif:
it may be this, i havn't tested
just try both, and BAM! your enemys will set ablaze!
Understanding Errors please read!
well, i found that many people have tons of errors, and they dont know how to fix them, this tutorial will show you how to fix those nasty errors
so say this guy pops up when you recompile..
its saying it cant find Lavaore, but what it could find, is the ID of your block!
so simply rename it, to 200 if thats what its ID is, or maybe 150, :tongue.gif:
now say you get this simple error when recompiling, that says, something like this:
but its much longer, its simple to fix, just chuck a curly bracket (this }) at the end, because it cant find where to end the file, so it gives you the error!
Making a block spawn on right click
this is pretty simple, but you wouldn't just easily create it of the spot, so all you have to do, is chuck this in your item file!
this will make it, when the player right clicks, it will spawn a block where he right clicks!
now for some more complex ones!
from request, how to make the player, get trapped in ice, or something else! (good for shields)
this will, select a cube, then make sure its hollow, then set the block, the ID you chose!
it works pretty awesomely
how to make a block GLOW! upon redstone activation
pretty complex.. but here is what you have to do
add this to your block (you must make 2 types, a glowing one, and a non glowing onw
and then chuck this at the end
right before the last braket, like this
then you must put this
here
and then lastly, put this in:
and thats all :biggrin.gif:
I made this map! Please check it out! It's a really awesome map that took me over a year to make! :3
EDIT: OOH, im so scared, XD
*Plays Minecraft on a craptop* *Optifine user since Optimine* *Using mods since Beta 1.5_01*
I made this map! Please check it out! It's a really awesome map that took me over a year to make! :3