I have been modding minecraft for some time now and I've learned a lot of nice stuff. Now I want others to learn stuff just like I did and to give them the opportunity to make what they want to make. I can't say that I am an expert and can the answer of everything, but I have a fair bit of knowledge and can try to solve your problems as good as I can.
Minecraft 1.5.2
Video tutorials
- None for now
Planned: (in exactly this order)
- Setting up Eclipse
- Basic classes
- Custom Block
- Multi Textured Block
- Custom Item
- Adding Configs
- Custom tools
- Custom Armour
- Custom Recipes
- Custom Creativetab
- Custom Fuel
- Custom Food
- Adding Potion Effects to your food
- Custom Mob
- Custom Tree
Support this tutorial with the banner made by GristlyIsMe:
Now for some explanation.
The first parameter is refering to your mobs class which we will make later.
The second parameter or "Tutorial" is the name of your mob (this won't show up though).
The third parameter or 1, is the mobs id.
The fourth parameter or this, is referring to which is the Main class of your mod.
The fifth parameter or 40, is how long the mob can be away from you before it doesn't send any more information.
The sixth parameter or 1, is how often the mob will update in seconds.
The last parameter or true, is if the mob should send velocity updates or not so leave this as true.
The first parameter is referring to our class.
The second parameter or 10, is how rare it is where 1 is really rare and 10 is common.
The third parameter or 2, is the minimum spawn amount of the mob each time it spawn.
The fourth parameter or 4, is the maximum spawn amount of the mob each time it spawn.
The fifth parameter is what type of mob it is (monster only spawn in the dark, creature are stuff like pigs etc.).
The last parameters is which biome it should spawn in. To add more biomes add a "," and then the next biome.
Now for all this to work we need to import a couple of things:
Now I know this looks a bit complicated because of the Tutorial everywhere, but it is easy.
The first Tutorial is Referring to the class and the second look for our mob.
The last Tutorial is for our mob name, note this is what actually will show up.
Now we are done here and here is our whold main class now:
package xeto.tutorial.common;
import java.util.logging.Level;
import net.minecraft.block.Block;
import net.minecraft.entity.EnumCreatureType;
import net.minecraft.item.EnumArmorMaterial;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.potion.Potion;
import net.minecraft.world.biome.BiomeGenBase;
import net.minecraftforge.common.Configuration;
import net.minecraftforge.common.EnumHelper;
import cpw.mods.fml.common.FMLLog;
import cpw.mods.fml.common.Mod;
import cpw.mods.fml.common.Mod.Init;
import cpw.mods.fml.common.Mod.Instance;
import cpw.mods.fml.common.Mod.PostInit;
import cpw.mods.fml.common.Mod.PreInit;
import cpw.mods.fml.common.SidedProxy;
import cpw.mods.fml.common.event.FMLInitializationEvent;
import cpw.mods.fml.common.event.FMLPostInitializationEvent;
import cpw.mods.fml.common.event.FMLPreInitializationEvent;
import cpw.mods.fml.common.network.NetworkMod;
import cpw.mods.fml.common.registry.EntityRegistry;
import cpw.mods.fml.common.registry.GameRegistry;
import cpw.mods.fml.common.registry.LanguageRegistry;
@Mod(modid = "Xetosphere-Tutorial", name = "Tutorial", version = "1.0.0")
@NetworkMod(clientSideRequired = true, serverSideRequired = false)
public class Tutorial {
@Instance("Xetosphere-Tutorial")
public static Tutorial instance;
@SidedProxy(clientSide = "xeto.tutorial.common.ClientProxy", serverSide = "xeto.tutorial.common.CommonProxy")
public static CommonProxy proxy;
// Blocks
public static Block tutBlock;
// Liquids
public static Block tutWaterStill;
public static Block tutWaterFlowing;
// Liquid IDs
public static int tutWaterID;
// BlockIDs
public static int tutBlockID;
// Items
public static Item tutItem;
public static Item tutFood;
// Armour
public static Item tutHelmet;
public static Item tutPlatebody;
public static Item tutLeggings;
public static Item tutBoots;
// ItemIDs
public static int tutItemID;
public static int tutFoodID;
static EnumArmorMaterial TutorialEnumArmourMaterial = EnumHelper.addArmorMaterial("tutorial", 24, new int[] { 2, 5, 3, 2 }, 16);
@PreInit
public void preInit(FMLPreInitializationEvent evt) {
Configuration cfg = new Configuration(evt.getSuggestedConfigurationFile());
try {
tutBlockID = cfg.getBlock("Tutorial Block", 701).getInt();
tutWaterID = cfg.getBlock("tutorial water", 703).getInt();
tutItemID = cfg.getItem("Tutorial Item", 7001).getInt();
tutFoodID = cfg.getItem("Tutorial Food", 7002).getInt();
} catch (Exception e) {
FMLLog.log(Level.SEVERE, e, "Tutorial has problems loading configs");
} finally {
cfg.save();
}
}
@Init
public void load(FMLInitializationEvent evt) {
GameRegistry.registerWorldGenerator(new WorldGeneratorTutorial());
proxy.registerRenderThings();
EntityRegistry.registerModEntity(EntityTutorial.class, "Tutorial", 1, Tutorial.class, 40, 1, true);
EntityRegistry.addSpawn(EntityTutorial.class, 10, 2, 4, EnumCreatureType.monster, BiomeGenBase.plains);
// Blocks
tutBlock = new BlockTutorial(tutBlockID, 0).setHardness(3.0F).setResistance(3.0F).setBlockName("tutBlock");
tutWaterStill = new BlockWaterStill(tutWaterID).setBlockName("tutWaterStill");
tutWaterFlowing = new BlockWaterFlowing(tutWaterID - 1).setBlockName("tutWaterFlowing");
// Items
tutItem = new ItemTutorial(tutItemID).setItemName("tutItem").setIconIndex(0);
tutFood = new ItemFoodTutorial(tutFoodID, 6, 1F, false).setAlwaysEdible().setPotionEffect(Potion.regeneration.id, 5, 0, 1.0F).setItemName("tutFood").setIconIndex(1);
tutHelmet = new ArmourTutorial(7004, TutorialEnumArmourMaterial, proxy.addArmour("tutorial"), 0).setItemName("tutHelmet").setIconIndex(2);
tutPlatebody = new ArmourTutorial(7005, TutorialEnumArmourMaterial, proxy.addArmour("tutorial"), 1).setItemName("tutBody").setIconIndex(3);
tutLeggings = new ArmourTutorial(7006, TutorialEnumArmourMaterial, proxy.addArmour("tutorial"), 2).setItemName("tutLegs").setIconIndex(4);
tutBoots = new ArmourTutorial(7007, TutorialEnumArmourMaterial, proxy.addArmour("tutorial"), 3).setItemName("tutBoots").setIconIndex(5);
// GameRegistry
GameRegistry.registerBlock(tutBlock, "tutBlock");
GameRegistry.registerBlock(tutWaterStill, "tutWaterStill");
GameRegistry.registerBlock(tutWaterFlowing, "tutWaterFlowing");
// LanguageRegistry
// Blocks
LanguageRegistry.addName(tutBlock, "Tutorial Block");
// Liquid
LanguageRegistry.addName(tutWaterStill, "Tutorial Water");
// Items
LanguageRegistry.addName(tutItem, "Tutorial Item");
LanguageRegistry.addName(tutFood, "Tutorial Food");
// Armour
LanguageRegistry.addName(tutHelmet, "Tutorial helmet");
LanguageRegistry.addName(tutPlatebody, "Tutorial Platebody");
LanguageRegistry.addName(tutLeggings, "Tutorial Leggings");
LanguageRegistry.addName(tutBoots, "Tutorial Boots");
// Item stacks
ItemStack tutStack = new ItemStack(tutBlock);
ItemStack tutWoolStack = new ItemStack(Block.cloth, 1, 3);
// Recipes
GameRegistry.addRecipe(new ItemStack(tutItem, 1), "XXX", "XXX", "XXX", 'X', tutStack);
GameRegistry.addRecipe(new ItemStack(tutItem, 1), "XYX", "YXY", "XYX", 'X', tutStack, 'Y', tutWoolStack);
GameRegistry.addShapelessRecipe(new ItemStack(tutBlock, 1), tutWoolStack, tutWoolStack, tutWoolStack, tutWoolStack);
GameRegistry.addShapelessRecipe(new ItemStack(tutItem, 1), tutWoolStack, tutWoolStack);
GameRegistry.addSmelting(tutBlock.blockID, new ItemStack(tutFood, 1), 1.0F);
}
@PostInit
public void postInit(FMLPostInitializationEvent evt) {
}
}
All this code will give us some errors, but we will fix this in the next class.
Now that was it for the main class, the other class will be up soon.
EntityTutorial part 1:
So first you just make a class and call it the same as you called it inside the main class.
I will call it EntityTutorial since that is what I used.
Now you will end up with this code:
package xeto.tutorial.common;
public class EntityTutorial {
}
And then we to make it extend EntityMob and make a constructor. Like this:
package xeto.tutorial.common;
public class EntityTutorial extends EntityMob {
public EntityTutorial(World par1World) {
super(par1World);
}
}
This should all be quite easy to understand so I won't explain anything here.
But there is more you need for the mob to work so lets put in some other methods.
First you will need this method:
public int getMaxHealth() {
return 20;
}
This gives the mob as much health as the player. 10 hearts or 20 half hearts.
Now for a method to allow our mob to have AI:
protected boolean isAIEnabled() {
return true;
}
Now to change the mobs attack damage:
public int getAttackStrength(Entity par1Entity) {
return 6;
}
This will make our mob deal 6 half hearts of damage or 3 whole hearts.
And then for the sounds, this is optional though. If you don't want it to make any sound just skip this.
I will give this mob the same sounds as a zombie:
okey so the new code here is this.texture and this.moveSpeed.
The this.texture sets the texture to your specified picture.
The this.moveSpeed obviously sets how fast the mob is, I recommend checking this out yourself.
Now for the AI we add this to the same method:
this.tasks.addTask(0, new EntityAISwimming(this));
This will say that it is very important for our mob to stay at the top of the water.
The first parameter (0), is the priority where 0 is highest priority and bigger numbers comes after.
The second parameter is the AI you add and this needs (this) inside the parenthesis.
Now for the attacking stuff:
this.tasks.addTask(1, new EntityAIAttackOnCollide(this, EntityPlayer.class, this.moveSpeed, false));
this.tasks.addTask(2, new EntityAIWatchClosest(this, EntityPlayer.class, 6.0F;
The first one set it so that it attacks the EntityPlayer when it hits it.
The second one is checking which player that is closest to it.
To make it attack other mobs than just players change EntityPlayer.class to for example EntityCow.class.
And now to make it walk around some:
this.tasks.addTask(3, new EntityAIWander(this, this.moveSpeed));
Again the first parameter (3) is the priority.
The second parameter will always be the moveSpeed.
Okey, but as we have set it now it will only look for our player and hurt him, but not move into him by itself.
So to make it move after the player or any other mob we need to add this:
this.targetTasks.addTask(1, new EntityAIHurtByTarget(this, false));
This will make it attack every entity that attacks it.
And last we will need this:
this.targetTasks.addTask(2, new EntityAINearestAttackableTarget(this, EntityPlayer.class, 16.0F, 0, true));
The first parameter for the AI is always this.
The second parameter is the entity it will attack.
The third parameter (16.0F) is the distance it will check for the Entity.
Now our class should look something like this:
package xeto.tutorial.common;
import net.minecraft.entity.Entity;
import net.minecraft.entity.ai.EntityAIAttackOnCollide;
import net.minecraft.entity.ai.EntityAIHurtByTarget;
import net.minecraft.entity.ai.EntityAINearestAttackableTarget;
import net.minecraft.entity.ai.EntityAISwimming;
import net.minecraft.entity.ai.EntityAIWander;
import net.minecraft.entity.ai.EntityAIWatchClosest;
import net.minecraft.entity.monster.EntityMob;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.world.World;
public class EntityTutorial extends EntityMob {
public EntityTutorial(World par1World) {
super(par1World);
this.texture = "/tutorial/mobs/tutorialentity.png";
this.moveSpeed = 0.25F;
this.tasks.addTask(0, new EntityAISwimming(this));
this.tasks.addTask(1, new EntityAIAttackOnCollide(this, EntityPlayer.class, this.moveSpeed, false));
this.tasks.addTask(2, new EntityAIWatchClosest(this, EntityPlayer.class, 6.0F));
this.tasks.addTask(3, new EntityAIWander(this, this.moveSpeed));
this.targetTasks.addTask(1, new EntityAIHurtByTarget(this, false));
this.targetTasks.addTask(2, new EntityAINearestAttackableTarget(this, EntityPlayer.class, 16.0F, 0, true));
}
@Override
public int getMaxHealth() {
return 20;
}
protected boolean isAIEnabled() {
return true;
}
public int getAttackStrength(Entity par1Entity) {
return 6;
}
public String getLivingSound() {
return "mob.zombie.say";
}
public String getHurtSound() {
return "mob.zombie.hurt";
}
public String getDeathSound() {
return "mob.zombie.death";
}
}
btw idk if it's something im doing wrong or if its forge but you (/ I) can't set the config ID to be lower than 256 it seems to cause a crash
it's good to see a updated tutorial tho and a 1 about configs as u don't see them that often
You can't make the block have a ID below 256 or higher than 4096 I believe since the vanilla blocks uses up the ids from 1-256 and forge only sets up spaces for 4096 blocks.
also you got mislead by my first post i men't your config file is blank and has nothing in it
What I meant in my reply is that the configs spoiler tells you have to set it up, so that we can use it on for example a block.
I could change the around of things and have the Block tutorial first without the custom ID you get from the config, but I don't see it as a major problem. I will look into it.
If you meant that the code that I show isn't doing anything that is wrong. the config.load(); makes it load the ID from the config file and config.save(); saves it and kind of puts it in the game with that id. They don't need any parameters at all.
For what to put inside of them look at the Block tutorial for now.
(When it comes to the blockID's being lower than 256 that was a fail of mine... cause till now they only use up to 147 or something, but it doesn't give me an error when I am using an ID below 256. I have used 252 as an ID without any problems.
yeh it lets me use those id's but when the config is being used to set an id lower than 256 it doesn't let me load a world
I've never had that problem before. Are you sure you imported the right thing? You have to import net.minecraftforge.common.Configuration; and not the other one.
package Gruze.mod.common;
import javax.security.auth.login.Configuration;
import net.minecraft.block.Block;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.item.EnumToolMaterial;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraftforge.client.MinecraftForgeClient;
import net.minecraftforge.common.EnumHelper;
import cpw.mods.fml.common.Mod;
import cpw.mods.fml.common.Mod.Init;
import cpw.mods.fml.common.Mod.PreInit;
import cpw.mods.fml.common.SidedProxy;
import cpw.mods.fml.common.event.FMLInitializationEvent;
import cpw.mods.fml.common.event.FMLPreInitializationEvent;
import cpw.mods.fml.common.network.NetworkMod;
import cpw.mods.fml.common.registry.GameRegistry;
import cpw.mods.fml.common.registry.LanguageRegistry;
@Mod(modid = "mod", name = "Xorchigan", version = "v1.0")
@NetworkMod
(clientSideRequired = true,
serverSideRequired = true)
// Fix Granite drop + texture
public class Xorchigan
{
@SidedProxy(clientSide = "Gruze.mod.common.ClientProxy", serverSide = "Gruze.mod.common.CommonProxy")
public static CommonProxy proxy;
//Enum
static EnumToolMaterial Diron = EnumHelper.addToolMaterial("Diron", 0, 300, 8.0F, 3, 0);
static EnumToolMaterial Piron = EnumHelper.addToolMaterial("Piron", 0, 400, 9.5F, 5, 0);
static EnumToolMaterial Airon = EnumHelper.addToolMaterial("Airon", 0, 520, 10.5F, 10, 0);
static EnumToolMaterial NaStaff = EnumHelper.addToolMaterial("NaStaff", 0, 200, 1.0F, 1, 0);
//BLOCKS
public static Block Graniteore;
public static Block test;
public static Block InW;
public static Block InWF;
//Items
public static Item Graniteclimp;
public static Item SmashGlove;
public static Item SmashGlove2;
public static Item SmashGlove3;
public static Item Naturestaff;
//Creative tabs
private static CreativeTabs moreBlocks;
public static final CreativeTabs tabMSMBlock = new TabMSMBlock(12, "moreBlocks");
private static CreativeTabs moreItems;
public static final CreativeTabs tabMSMBlock1 = new TabMIMBlock(13, "moreItems");
@PreInit
public void initConfig(FMLPreInitializationEvent fpe)
{
Configuration config = new Configuration(event.getSuggestedConfigurationFile());
config.load();
config.save();
}
@Init
public void load(FMLInitializationEvent fie)
{
GameRegistry.registerWorldGenerator(new MyBlockWorldGenerator());
//Blocks
Graniteore = (new Granitore(500, 0).setBlockName("Granitore").setStepSound(Block.soundStoneFootstep).setHardness(2F).setResistance(1.0F).setCreativeTab(Xorchigan.tabMSMBlock1));
test = (new test(501, 1).setBlockName("test").setStepSound(Block.soundStoneFootstep).setCreativeTab(Xorchigan.tabMSMBlock1));
//Items
SmashGlove = (new SmashGlove(600, Diron).setIconCoord(0, 0).setItemName("SmashGlove").setCreativeTab(Xorchigan.tabMSMBlock));
SmashGlove2 = (new SmashGlove2(601, Piron).setIconCoord(1, 0).setItemName("SmashGlove2").setCreativeTab(Xorchigan.tabMSMBlock));
SmashGlove3 = (new SmashGlove3(603, Airon).setIconCoord(2, 0).setItemName("SmashGlove3").setCreativeTab(Xorchigan.tabMSMBlock));
Naturestaff = (new Naturestaff(604, NaStaff).setIconCoord(3, 0).setItemName("Naturestaff").setCreativeTab(Xorchigan.tabMSMBlock));
Graniteclimp = (new Graniteclimp(605).setIconCoord(4, 0).setItemName("Graniteclimp").setCreativeTab(Xorchigan.tabMSMBlock));
registeringBlocks();
itemNames();
blockNames();
Recipe();
smelting();
//MINECRAFT FORGE TEXTURE FUNC
MinecraftForgeClient.preloadTexture("/my/lordblock.png");
MinecraftForgeClient.preloadTexture("/myitem/lorditem.png");
}
private void func_92051_a(ItemStack itemStack, Object[] objects) {
// TODO Auto-generated method stub
}
public void registeringBlocks()
{
GameRegistry.registerBlock(Graniteore);
GameRegistry.registerBlock(test);
}
public void blockNames()
{
LanguageRegistry.addName(Graniteore, "Granite Ore");
LanguageRegistry.addName(test, "\u00a74LAND MINE SECRET NOT IN THE GAME");
}
public void itemNames()
{
LanguageRegistry.addName(SmashGlove, "\u00a78Smash \u00a74Glove I");
LanguageRegistry.addName(SmashGlove2, "\u00a78Smash \u00a74Glove II");
LanguageRegistry.addName(SmashGlove3, "\u00a78Smash \u00a74Glove III");
LanguageRegistry.addName(Naturestaff, "\u00a78Nature \u00a72Staff");
LanguageRegistry.addName(Graniteclimp, "Granite Climp");
}
public void Recipe()
{
GameRegistry.addRecipe(new ItemStack(SmashGlove,1), new Object[]
{
"###", "yzy", "zzz", Character.valueOf('#'), Block.obsidian, Character.valueOf('y'), Item.diamond, Character.valueOf('z'), Item.ingotIron
});
GameRegistry.addRecipe(new ItemStack(SmashGlove2,1), new Object[]
{
"###", "ycy", "zzz", Character.valueOf('#'), Block.obsidian, Character.valueOf('y'), Item.diamond, Character.valueOf('z'), Item.ingotIron,
Character.valueOf('c'), Xorchigan.SmashGlove
});
GameRegistry.addRecipe(new ItemStack(SmashGlove3,1), new Object[]
{
"###", "ycy", "zzz", Character.valueOf('#'), Block.obsidian, Character.valueOf('y'), Item.diamond, Character.valueOf('z'), Item.ingotIron,
Character.valueOf('c'), Xorchigan.SmashGlove2
});
GameRegistry.addRecipe(new ItemStack(Naturestaff,1), new Object[]
{
"#x#", "yzy", " z ", Character.valueOf('#'), Block.obsidian, Character.valueOf('y'), Block.plantYellow, Character.valueOf('z'), Item.stick
, Character.valueOf('x'), Block.dirt
});
}
public void smelting()
{
}
}
error code
Caused by: java.lang.Error: Unresolved compilation problems:
event cannot be resolved
The method load() is undefined for the type Configuration
The method save() is undefined for the type Configuration
First of all you've imported the wrong file for configuration, you imported the javax Configuration file, but you should import this: import net.minecraftforge.common.Configuration; Secondly you haven't put in anything inside the configuration file yet, so there is nothing to put inside the config file as it stays. To fix that all you need to add between the config.load(); and config.save(); is: yourBlockID = new config.getBlock("the name of your block", id).getInt(); This needs to be added for every block you have.
As well as you need to have "yourBlockID" as an int as well so before the @PreInit write this code for all your blocks: public int yourBlockID; yourBlock is of course your block name and I at least like to put ID at the end of it. And that's it, you're done.
Also you will need to put in (yourBlockID) instead of the id for every block inside the init method.
BTW: I found it strange that you set the serverSideRequired = true; This should be set to false.
Please can you do some tutorials on how to make trees and generate them and how to make crops as well
I tried trees some time ago and it should be possible, I have to check some on the crops to get all of it though, but I will look into it.
The first thing I will do though is a item since you will need that for a sapling and I want to make a custom Item tutorial before I jump into more advanced stuff.
hay i love your tuts can u make one on
gui's
moving blocks
abnormal blocks (halfs,dubbles,qaurters)
resipe changing
timed durrablites
Food
blocks that cause effects when hit
hay i love your tuts can u make one on
gui's
moving blocks
abnormal blocks (halfs,dubbles,qaurters)
resipe changing
timed durrablites
Food
blocks that cause effects when hit
For gui's I'll have to try som stuff out.
Moving blocks... Do you mean like an entity/mob that looks like a block in that case it's fully possible.
Abnormal blocks, well half slabs shouldn't be a problem.
For the Recipe changing do you mean add a recipe or change an already in game recipe?
I don't really know what you mean with timed durabilities.
I can make a custom food tutorial.
Blocks that causes effects when hit should also be possible. At least redstone ores gets light when hit, I'm not sure if this will work though.
For gui's I'll have to try some stuff out.- yea all the tut i have found are outdated (1.2.5)
Moving blocks... Do you mean like an entity/mob that looks like a block in that case it's fully possible.-yes and blocks that have moving parts like the enchantment table or en gins in build-craft
Abnormal blocks, well half slabs shouldn't be a problem.- but the others maybe ? also what about connected blocks like doors
For the Recipe changing do you mean add a recipe or change an already in game recipe? yes both
I don't really know what you mean with timed durability. i want to make it so all food goes bad unless u put it in a fridge or jar it
I can make a custom food tutorial.that will also be handy i know im not the only one who would like new foods or more enchanted foods (ie. golden apple)
Blocks that causes effects when hit should also be possible.yay i keep getting told no that is imposable, it will never happen,n00b get lost
and your welcome for the suggestions. these are just question n00b ask i guess ill post if i have any more but i dont want to be a bother
1. and maybe a custom fuel (i know it has been said i just really like the idea)
and 2 may be a tut on how to get name badges on items so when you are near them u might see the name plate
i mostly like your tuts because they are easy to follow and cuz they got me started
For gui's I'll have to try some stuff out.- yea all the tut i have found are outdated (1.2.5)
Moving blocks... Do you mean like an entity/mob that looks like a block in that case it's fully possible.-yes and blocks that have moving parts like the enchantment table or en gins in build-craft
Abnormal blocks, well half slabs shouldn't be a problem.- but the others maybe ? also what about connected blocks like doors
For the Recipe changing do you mean add a recipe or change an already in game recipe? yes both
I don't really know what you mean with timed durability. i want to make it so all food goes bad unless u put it in a fridge or jar it
I can make a custom food tutorial.that will also be handy i know im not the only one who would like new foods or more enchanted foods (ie. golden apple)
Blocks that causes effects when hit should also be possible.yay i keep getting told no that is imposable, it will never happen,n00b get lost
and your welcome for the suggestions. these are just question n00b ask i guess ill post if i have any more but i dont want to be a bother
1. and maybe a custom fuel (i know it has been said i just really like the idea)
and 2 may be a tut on how to get name badges on items so when you are near them u might see the name plate
i mostly like your tuts because they are easy to follow and cuz they got me started
Thanks, thats good to hear. I tried to set them up so that it is possible for absolute anyone that tries to be able to make a mod.
I'll make both the itemFood tutorial today as well as I think I will make a ore generation today, but we will see. Also I will check if everything works with 1.4.7 as well.
EDIT: Good news everything should work for 1.4.7 at least I don't get any bugs or errors.
[Help!]
Were is your tutorial for the sprites i can not find it and my stuff has no textures now :/
[Idea]
particles coming out of dies of blocks (ie. Furnace)
Making Blocks drops your items (new blocks)
[WIT]
thx for the food tutorial!its awesome now i got some food
a ore tutorial sounds really cool i edited some of mc base code to make trees drop seeds for crops when u make that tutorial but for now it just drops the object
Keep it up! maybe sometime ill get videos of me following your tutorials (if i have your permission) and post them for people to watch 2 (some ppl are bad at read tutorials and like videos. all though i prefer readable ones) also i have been telling ppl about your tutorials and put u in my credits !
[Help!]
Were is your tutorial for the sprites i can not find it and my stuff has no textures now :/
[Idea]
particles coming out of dies of blocks (ie. Furnace)
Making Blocks drops your items (new blocks)
[WIT]
thx for the food tutorial!its awesome now i got some food
a ore tutorial sounds really cool i edited some of mc base code to make trees drop seeds for crops when u make that tutorial but for now it just drops the object
Keep it up! maybe sometime ill get videos of me following your tutorials (if i have your permission) and post them for people to watch 2 (some ppl are bad at read tutorials and like videos. all though i prefer readable ones) also i have been telling ppl about your tutorials and put u in my credits !
Thanks for keeping this thread (alive).
For the sprites... it is easy to show, but it isn't that easy to explain in words so I might actually make a video about that.
Making a custom Block drop your custom item is fairly simple so I can make a short tutorial for that as well and put it underneath the block tutorials.
Im also done with the ore generation tutorial, but now I think I need a little break from modding. I will continue tomorrow or so.
As for permission on video stuff, I give everyone permission to use this to helping others. I think that everyone should get the imformation they need to get to start with modding. Though it would be nice with references to this page, and giving some credit to me would be apprieciated.
my friend cant post cuz his account is banned here are his suggestions
[Ideas]
Light Blocks
Liquid
Particles Effects
Custom Explosions
Custom mobs and moving entities
@Xetosphere Thankyou for the tutorials i made a account just to tell you this @Neylmane told me about this thread and i have used it it is easier then the way i was taught. i kinda wish there were vids that when with it but THANKS SO MUCH keep it up this is awesome!!!!!!!!!!!!! oh and would you like my ideas for future post (i know that people have contributed a lot and your list is getting longer) i only have a few more because you have either already planed to or some one has already said it (*cough*neylmane*cough*)
my friend cant post cuz his account is banned here are his suggestions
[Ideas]
Light Blocks
Liquid
Particles Effects
Custom Explosions
Custom mobs and moving entities
For the light blocks, I don't know if it's even worth a tutorial since it's just to add a simple .setLightValue(float) in the main method at your block. (if you didn't taught of blocks like torches)
To be honest I have never looked into liquids, but I can look at it.
@Xetosphere Thankyou for the tutorials i made a account just to tell you this @Neylmane told me about this thread and i have used it it is easier then the way i was taught. i kinda wish there were vids that when with it but THANKS SO MUCH keep it up this is awesome!!!!!!!!!!!!! oh and would you like my ideas for future post (i know that people have contributed a lot and your list is getting longer) i only have a few more because you have either already planed to or some one has already said it (*cough*neylmane*cough*)
Keep leaving suggestions, I am glad for any challenge I get. But before anyone post anything about custom dimensions I'll have to disappoint you, I don't know anything about that. Though I know of someone who got a really nice tutorial on exactly that right now.
For that check out wuppy21's tutorials.
I think I have forgotten a line inside our ClientProxy class. Silly me, I forgot to preload the textures. I will put it inside the tutorial right now.
Edit:
The code that was need inside the ClientProxy is now set into the tutorial under the Proxies spoiler.
I have been modding minecraft for some time now and I've learned a lot of nice stuff. Now I want others to learn stuff just like I did and to give them the opportunity to make what they want to make. I can't say that I am an expert and can the answer of everything, but I have a fair bit of knowledge and can try to solve your problems as good as I can.
Custom Mob
So to make to make a mob the first thing you will need is this:
Now for some explanation.
The first parameter is refering to your mobs class which we will make later.
The second parameter or "Tutorial" is the name of your mob (this won't show up though).
The third parameter or 1, is the mobs id.
The fourth parameter or this, is referring to which is the Main class of your mod.
The fifth parameter or 40, is how long the mob can be away from you before it doesn't send any more information.
The sixth parameter or 1, is how often the mob will update in seconds.
The last parameter or true, is if the mob should send velocity updates or not so leave this as true.
Now to make it spawn. All we need is this:
The first parameter is referring to our class.
The second parameter or 10, is how rare it is where 1 is really rare and 10 is common.
The third parameter or 2, is the minimum spawn amount of the mob each time it spawn.
The fourth parameter or 4, is the maximum spawn amount of the mob each time it spawn.
The fifth parameter is what type of mob it is (monster only spawn in the dark, creature are stuff like pigs etc.).
The last parameters is which biome it should spawn in. To add more biomes add a "," and then the next biome.
Now for all this to work we need to import a couple of things:
Now for the last thing we need in our main class which is this:
Now I know this looks a bit complicated because of the Tutorial everywhere, but it is easy.
The first Tutorial is Referring to the class and the second look for our mob.
The last Tutorial is for our mob name, note this is what actually will show up.
Now we are done here and here is our whold main class now:
All this code will give us some errors, but we will fix this in the next class.
Now that was it for the main class, the other class will be up soon.
I will call it EntityTutorial since that is what I used.
Now you will end up with this code:
So first we need to import a couple of things:
And then we to make it extend EntityMob and make a constructor. Like this:
This should all be quite easy to understand so I won't explain anything here.
But there is more you need for the mob to work so lets put in some other methods.
First you will need this method:
This gives the mob as much health as the player. 10 hearts or 20 half hearts.
Now for a method to allow our mob to have AI:
Now to change the mobs attack damage:
This will make our mob deal 6 half hearts of damage or 3 whole hearts.
And then for the sounds, this is optional though. If you don't want it to make any sound just skip this.
I will give this mob the same sounds as a zombie:
Now this is also pretty easy to understand so I don't think it will need any explanation.
And that was it for this tutorial, the next tutorial will be on how to add the AI to your mob, but we don't have any errors now!
Here are the whole EntityTutorial class as it is now:
All of this will be inside the the constructor or the public EntityTutorial(World par1World) method which we created last time.
So let's get to coding.
First we will import a few things:
Now for the constructor:
okey so the new code here is this.texture and this.moveSpeed.
The this.texture sets the texture to your specified picture.
The this.moveSpeed obviously sets how fast the mob is, I recommend checking this out yourself.
Now for the AI we add this to the same method:
This will say that it is very important for our mob to stay at the top of the water.
The first parameter (0), is the priority where 0 is highest priority and bigger numbers comes after.
The second parameter is the AI you add and this needs (this) inside the parenthesis.
Now for the attacking stuff:
The first one set it so that it attacks the EntityPlayer when it hits it.
The second one is checking which player that is closest to it.
To make it attack other mobs than just players change EntityPlayer.class to for example EntityCow.class.
And now to make it walk around some:
Again the first parameter (3) is the priority.
The second parameter will always be the moveSpeed.
Okey, but as we have set it now it will only look for our player and hurt him, but not move into him by itself.
So to make it move after the player or any other mob we need to add this:
This will make it attack every entity that attacks it.
And last we will need this:
The first parameter for the AI is always this.
The second parameter is the entity it will attack.
The third parameter (16.0F) is the distance it will check for the Entity.
Now our class should look something like this:
You can't make the block have a ID below 256 or higher than 4096 I believe since the vanilla blocks uses up the ids from 1-256 and forge only sets up spaces for 4096 blocks.
By the way the Block tutorial is up now :).
What I meant in my reply is that the configs spoiler tells you have to set it up, so that we can use it on for example a block.
I could change the around of things and have the Block tutorial first without the custom ID you get from the config, but I don't see it as a major problem. I will look into it.
If you meant that the code that I show isn't doing anything that is wrong. the config.load(); makes it load the ID from the config file and config.save(); saves it and kind of puts it in the game with that id. They don't need any parameters at all.
For what to put inside of them look at the Block tutorial for now.
(When it comes to the blockID's being lower than 256 that was a fail of mine... cause till now they only use up to 147 or something, but it doesn't give me an error when I am using an ID below 256. I have used 252 as an ID without any problems.
I've never had that problem before. Are you sure you imported the right thing? You have to import net.minecraftforge.common.Configuration; and not the other one.
First of all you've imported the wrong file for configuration, you imported the javax Configuration file, but you should import this:
import net.minecraftforge.common.Configuration;
Secondly you haven't put in anything inside the configuration file yet, so there is nothing to put inside the config file as it stays.
To fix that all you need to add between the config.load(); and config.save(); is:
yourBlockID = new config.getBlock("the name of your block", id).getInt();
This needs to be added for every block you have.
As well as you need to have "yourBlockID" as an int as well so before the @PreInit write this code for all your blocks:
public int yourBlockID;
yourBlock is of course your block name and I at least like to put ID at the end of it.
And that's it, you're done.
Also you will need to put in (yourBlockID) instead of the id for every block inside the init method.
BTW: I found it strange that you set the serverSideRequired = true;
This should be set to false.
I can fix that, but I'll need to make a item tutorial before that, since that is needed for the tool/armour.
I want everyone to understand the tutorials so I've written now in 2 hours to make them become better and easier to understand.
Hope this help you guys, because I really put my soul in this work.
Nice to hear that it helped.
I tried trees some time ago and it should be possible, I have to check some on the crops to get all of it though, but I will look into it.
The first thing I will do though is a item since you will need that for a sapling and I want to make a custom Item tutorial before I jump into more advanced stuff.
Thanks for the reply.
gui's
moving blocks
abnormal blocks (halfs,dubbles,qaurters)
resipe changing
timed durrablites
Food
blocks that cause effects when hit
For gui's I'll have to try som stuff out.
Moving blocks... Do you mean like an entity/mob that looks like a block in that case it's fully possible.
Abnormal blocks, well half slabs shouldn't be a problem.
For the Recipe changing do you mean add a recipe or change an already in game recipe?
I don't really know what you mean with timed durabilities.
I can make a custom food tutorial.
Blocks that causes effects when hit should also be possible. At least redstone ores gets light when hit, I'm not sure if this will work though.
Thanks for the suggestions.
Moving blocks... Do you mean like an entity/mob that looks like a block in that case it's fully possible.-yes and blocks that have moving parts like the enchantment table or en gins in build-craft
Abnormal blocks, well half slabs shouldn't be a problem.- but the others maybe ? also what about connected blocks like doors
For the Recipe changing do you mean add a recipe or change an already in game recipe? yes both
I don't really know what you mean with timed durability. i want to make it so all food goes bad unless u put it in a fridge or jar it
I can make a custom food tutorial.that will also be handy i know im not the only one who would like new foods or more enchanted foods (ie. golden apple)
Blocks that causes effects when hit should also be possible.yay i keep getting told no that is imposable, it will never happen,n00b get lost
and your welcome for the suggestions. these are just question n00b ask i guess ill post if i have any more but i dont want to be a bother
1. and maybe a custom fuel (i know it has been said i just really like the idea)
and 2 may be a tut on how to get name badges on items so when you are near them u might see the name plate
i mostly like your tuts because they are easy to follow and cuz they got me started
Thanks, thats good to hear. I tried to set them up so that it is possible for absolute anyone that tries to be able to make a mod.
I'll make both the itemFood tutorial today as well as I think I will make a ore generation today, but we will see. Also I will check if everything works with 1.4.7 as well.
EDIT: Good news everything should work for 1.4.7 at least I don't get any bugs or errors.
Were is your tutorial for the sprites i can not find it and my stuff has no textures now :/
[Idea]
particles coming out of dies of blocks (ie. Furnace)
Making Blocks drops your items (new blocks)
[WIT]
thx for the food tutorial!its awesome now i got some food
a ore tutorial sounds really cool i edited some of mc base code to make trees drop seeds for crops when u make that tutorial but for now it just drops the object
Keep it up! maybe sometime ill get videos of me following your tutorials (if i have your permission) and post them for people to watch 2 (some ppl are bad at read tutorials and like videos. all though i prefer readable ones) also i have been telling ppl about your tutorials and put u in my credits !
Thanks for keeping this thread (alive).
For the sprites... it is easy to show, but it isn't that easy to explain in words so I might actually make a video about that.
Making a custom Block drop your custom item is fairly simple so I can make a short tutorial for that as well and put it underneath the block tutorials.
Im also done with the ore generation tutorial, but now I think I need a little break from modding. I will continue tomorrow or so.
As for permission on video stuff, I give everyone permission to use this to helping others. I think that everyone should get the imformation they need to get to start with modding. Though it would be nice with references to this page, and giving some credit to me would be apprieciated.
[Ideas]
Light Blocks
Liquid
Particles Effects
Custom Explosions
Custom mobs and moving entities
For the light blocks, I don't know if it's even worth a tutorial since it's just to add a simple .setLightValue(float) in the main method at your block. (if you didn't taught of blocks like torches)
To be honest I have never looked into liquids, but I can look at it.
Keep leaving suggestions, I am glad for any challenge I get. But before anyone post anything about custom dimensions I'll have to disappoint you, I don't know anything about that. Though I know of someone who got a really nice tutorial on exactly that right now.
For that check out wuppy21's tutorials.
I think I have forgotten a line inside our ClientProxy class. Silly me, I forgot to preload the textures. I will put it inside the tutorial right now.
Edit:
The code that was need inside the ClientProxy is now set into the tutorial under the Proxies spoiler.