These are some new tutorials I have and am willing to share with the community. These are for forge 7.7.1 630 and above. I will update my old tutorials as I get time to do so.....
First up is the slab
<Bare in mind that this is not the only way to do this, its just the way I have discovered with lots of research and combining things that work for me>
SLAB
Mod Class
package yourpackage;//change to your package
import java.util.Arrays;
import java.util.List;
@Mod(modid = "YourMod", name = "Mod", version = "2.0")
@NetworkMod(clientSideRequired = true, serverSideRequired = false)
public class YourMod // your mod class
{
@Instance("YourMod") // your mod id and instance
public static YourMod instance;
// Change block names to your blocks names these are directly from my mod and being used for an example only
//Slabs
public static BlockHalfSlab blackWoodDoubleSlab;
public static BlockHalfSlab blackWoodSingleSlab;
//Slabs
public static int blackWoodDoubleSlabID;
public static int blackWoodSingleSlabID;
@SidedProxy(clientSide = "yourpackage.client.ClientProxy", serverSide = "yourpackage.CommonProxy")
public static CommonProxy proxy;
@cpw.mods.fml.common.Mod.PreInit
public void PreInit(FMLPreInitializationEvent event)
{
//Slabs
blackWoodDoubleSlabID = config.getBlock("blackWoodDoubleSlab ID", 3140, (String)null).getInt();
blackWoodSingleSlabID = config.getBlock("blackWoodSingleSlab ID", 3141, (String)null).getInt();
config.save();
}
@Init
public void load(FMLInitializationEvent event)
{
//Slabs
blackWoodDoubleSlab = (BlockHalfSlab)(new BlockBlackWoodSlab(blackWoodDoubleSlabID, true)).setHardness(1.6F).setResistance(7.5F).setStepSound(Block.soundWoodFootstep).setUnlocalizedName("blackWoodSlab");;
blackWoodSingleSlab = (BlockHalfSlab)(new BlockBlackWoodSlab(blackWoodSingleSlabID, false)).setHardness(1.6F).setResistance(7.5F).setStepSound(Block.soundWoodFootstep).setUnlocalizedName("blackWoodSlab").setCreativeTab(MTJT.tabTreeBlocks);
GameRegistry.registerBlock(blackWoodDoubleSlab, "blackWoodDoubleSlab");
GameRegistry.registerBlock(blackWoodSingleSlab, "blackWoodSingleSlab");
LanguageRegistry.addName(blackWoodDoubleSlab,"BlackWood DoubleSlab");
LanguageRegistry.instance().addStringLocalization(((BlockBlackWoodSlab)blackWoodSingleSlab).getFullSlabName(0)+".name", "BlackWood SingleSlab");
proxy.registerRenderThings();
}
@cpw.mods.fml.common.Mod.PostInit
public void PostInit(FMLPostInitializationEvent event)
{
Item.itemsList[blackWoodSingleSlab.blockID] = (new ItemSlab(blackWoodSingleSlab.blockID - 256, (BlockHalfSlab)blackWoodSingleSlab, (BlockHalfSlab)blackWoodDoubleSlab, false));
}
}
Make sure you fix and import all necessary imports
Slab class
package yourpackage.blocks;
import java.util.List;
import java.util.Random;
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.client.renderer.texture.IconRegister;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.entity.EntityLiving;
import net.minecraft.item.ItemStack;
import net.minecraft.world.World;
public class BlockBlackWoodSlab extends BlockHalfSlab
{
public static final String[] woodType = { "blackWood" };
public BlockBlackWoodSlab(int par1, boolean par2)
{
super(par1, par2, Material.wood);
setBurnProperties(this.blockID, 5, 20);
useNeighborBrightness[this.blockID] = true;
}
public void registerIcons(IconRegister par1IconRegister)
{
this.blockIcon = par1IconRegister.registerIcon("YourMod:blackPlanks");
}
public int idDropped(int par1, Random par2Random, int par3)
{
return YourMod.blackWoodSingleSlab.blockID;
}
public void onBlockPlacedBy(World par1World, int par2, int par3, int par4, EntityLiving par5EntityLiving)
{
if(par1World.getBlockId(par2, par3 - 1, par4) == YourMod.blackWoodSingleSlab.blockID)
{
par1World.setBlock(par2, par3, par4, 0);
par1World.setBlock(par2, par3 - 1, par4, YourMod.blackWoodDoubleSlab.blockID);
}
if(par1World.getBlockId(par2, par3 + 1, par4) == YourMod.blackWoodSingleSlab.blockID)
{
par1World.setBlock(par2, par3, par4, 0);
par1World.setBlock(par2, par3 + 1, par4, YourMod.blackWoodDoubleSlab.blockID);
}
}
protected ItemStack createStackedBlock(int par1)
{
return new ItemStack(YourMod.blackWoodSingleSlab.blockID, 2, par1 & 7);
}
public String getFullSlabName(int par1)
{
if ((par1 < 0) || (par1 >= woodType.length))
{
par1 = 0;
}
return super.getUnlocalizedName2() + "." + woodType[par1];
}
public void getSubBlocks(int par1, CreativeTabs par2CreativeTabs, List par3List)
{
if (par1 != YourMod.blackWoodDoubleSlab.blockID)
{
par3List.add(new ItemStack(par1, 1, 0));
}
}
}
This does work, I have tested it many times in my mod and will be releasing the update to my mod on Monday I hope. So before you say this doesn't work, double check your work and compare. Make sure you have followed everything exactly, and changed your instance and package names accordingly. This is just a guide, not meant to be copy and past....
Custom Villager Trades
Mod Class
[/font][/size]
package yourpackage;
import java.util.Arrays;
import java.util.List;
@Mod(modid = "YourMod", name = "Mod", version = "2.0")
@NetworkMod(clientSideRequired = true, serverSideRequired = false)
public class YourMod
{
@Instance("YourMod")
public static YourMod instance;
@SidedProxy(clientSide = "yourpackage.client.ClientProxy", serverSide = "yourpackage.CommonProxy")
public static CommonProxy proxy;
@cpw.mods.fml.common.Mod.PreInit
public void PreInit(FMLPreInitializationEvent event)
{
VillagerRegistry.instance().registerVillageTradeHandler(3, new TradeHandler());
/// 3 = the villager id in this case its the blacksmith
}
@Init
public void load(FMLInitializationEvent event)
{
proxy.registerRenderThings();
}
@cpw.mods.fml.common.Mod.PostInit
public void PostInit(FMLPostInitializationEvent event)
{
}
}
Trade Handler
package yourpackage.util;
import java.util.Random;
import net.minecraft.block.Block;
import net.minecraft.entity.passive.EntityVillager;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.village.MerchantRecipe;
import net.minecraft.village.MerchantRecipeList;
import cpw.mods.fml.common.registry.VillagerRegistry.IVillageTradeHandler;
public class TradeHandler implements IVillageTradeHandler
{
@Override
public void manipulateTradesForVillager(EntityVillager villager, MerchantRecipeList recipeList, Random random)
{
recipeList.add(new MerchantRecipe(new ItemStack(Item.emerald, 4), new ItemStack(YourMod.yourItem/Block, 1, 0)));
///Item.emerald is the cost and amount
///YourMod.yourItem/Block is the item or block you wish to have sold and the amount you get
}
}
This is how I discovered it to work, I am sure there are more than one way to get this done.
Can you post code for a custom non living entity with a custom model because I am having trouble with an entity that's not a mob but has a custom model and texture and if you do post code and a tutorial I can give you a free pre-release for my mod. I am not giving out free pre-releases only for those who help.
I am not sure exactly what you are asking for. You talking about a minecart, a boat, or a throwing object? A little more detail would be helpful, then I can let you know whether or not I can help at all...
I am not good with custom entities, so maybe if you can tell me exactly what you need, perhaps I can point you in the direction of where you can get help
I am not good with custom entities, so maybe if you can tell me exactly what you need, perhaps I can point you in the direction of where you can get help
He wants a TileEntity linked to a block with a custom model.
He wants a TileEntity linked to a block with a custom model.
Are you sure? Cause thats not what I got out of that at all.... a non living entity that can be seen can be anything really....either way, I am not good with custom tiles either....
I would assume so, as everyone call tile entities "non living entities'. you dont really need a tile entity for block models anyway. i dont know ask him if it is a block or a mob.
Well, since he did say a non living entity, if its a block hes making....try this link here.... as I said I am not good with custom stuff on my own...and this may help...or not
It is like a block but like a mob like a block because it has no ai an can't move but is like a mob with its own model so yes basically like a tileentity.
Flans mod has a bunch of examples. Like their vehicles I want to make something like a flyable vehicle with its own model and texture i can make it as a mob with the model and texture but not as an entity like flans mod has done.
Okay, first you're getting me confused with mob not a mob....a mob is a creature or monster, what you are asking for is an entity or object with interaction. So i will say this, basically all I can do is recreate the boat as I have done before in 1.4.7, wont be SMP because I cant do packets, have not figured them out yet. My models dont work, I am horrible at making models. So unfortunately you will have to ask someone else and I have no idea who, a good place to start is the looking at the boat code and going from there, also THX mod is open source have a look there at his code......
No am i not getting confused i'm trying to relate it to something it has a custom model and texture like a mob but is like a block with no abilities.
A mob is a living thing, a block is not, I understand that.....a mob has no tile entity, a block does. I am sorry, I can not help you with this. I have pointed you in the direction of some examples to look at for this issue, I get it, you want a block you can interact with, and maybe fly or drive around like in flann's mod. Only other blocks that have tile entities are like furnaces or similar....again, I can not make custom, only reproduce original Vanilla code.
I am sorry, as I said, I can not do a tutorial for that, I dont know the process very well.....but have a look here this is a block model with a tile entity and for 1.4.7 so it should work okay...maybe a few minor changes....
A custom block model...now that I know what you are after.....follow these tutorials...look them over carefully, this first on is from ducky, it is forge and the same one I followed
First up is the slab
<Bare in mind that this is not the only way to do this, its just the way I have discovered with lots of research and combining things that work for me>
SLAB
Mod Class
Make sure you fix and import all necessary imports
Slab class
This does work, I have tested it many times in my mod and will be releasing the update to my mod on Monday I hope. So before you say this doesn't work, double check your work and compare. Make sure you have followed everything exactly, and changed your instance and package names accordingly. This is just a guide, not meant to be copy and past....
Custom Villager Trades
Mod Class
Trade Handler
This is how I discovered it to work, I am sure there are more than one way to get this done.
Find out how I generate....coolAlias...world structure generation and rotation tool...
Find out how I generate....coolAlias...world structure generation and rotation tool...
Find out how I generate....coolAlias...world structure generation and rotation tool...
He wants a TileEntity linked to a block with a custom model.
Are you sure? Cause thats not what I got out of that at all.... a non living entity that can be seen can be anything really....either way, I am not good with custom tiles either....
Find out how I generate....coolAlias...world structure generation and rotation tool...
Find out how I generate....coolAlias...world structure generation and rotation tool...
Find out how I generate....coolAlias...world structure generation and rotation tool...
Find out how I generate....coolAlias...world structure generation and rotation tool...
A mob is a living thing, a block is not, I understand that.....a mob has no tile entity, a block does. I am sorry, I can not help you with this. I have pointed you in the direction of some examples to look at for this issue, I get it, you want a block you can interact with, and maybe fly or drive around like in flann's mod. Only other blocks that have tile entities are like furnaces or similar....again, I can not make custom, only reproduce original Vanilla code.
Find out how I generate....coolAlias...world structure generation and rotation tool...
Find out how I generate....coolAlias...world structure generation and rotation tool...
link
the other is the same link I gave you before, still works also and is modloader but will also help
link
Find out how I generate....coolAlias...world structure generation and rotation tool...