try the render code using the Scale method go GL11 before drawing?
By rendering I mean the one responsible for calling the rendering it, not the model file.
IT BETTER COME OUT QUICK AND IT BETTER BE ABOUT ARMOR I WANT TO FINISH OFF MY MOD AND SHOW IT OFF CAUSE SOME OF MY FRIENDS ARE SAYING I CANT DO IT AND I WANT TO PROVE EM WRONG
TheDog330: You could check other mods how they implement armor, or other tutorials there are some.
Or figure it out yourself it shouldn't be hard if you know Java
Can someone show me how to make a custom block using techne? Like not a normal block but a block that looks like a column. If you can help I perfer you either message me or email me at [email protected] If you quote this I might not get it.
Can someone show me how to make a custom block using techne? Like not a normal block but a block that looks like a column. If you can help I perfer you either message me or email me at [email protected] If you quote this I might not get it.
There's a lot of techne tutorials out there, google them yourself mate
What I Mean Is When You Open Eclipse You Set Your Workplace...
In Your Case C:\Users\Rick\Desktop\Whippy's Ores And Such Mod\eclipse
But Because Of 1.6.2 It's Changed... Now You Have To Go Into Forge, Then FML, And Then Choose The Eclipse File In There...
Hope I Help.
ok i understand the workspace but when i install forge no new folders open like the src, runtime, and temp
Is there a way to add all the textures of all my items or blocks without having to make a class file for each one ?
For any item that doesn't require special code, I have a class called ItemDefault that sets each item in my custom creative tab, and a method called registerIcons(IconRegister iconregister) that is @SideOnly(Side.CLIENT) and I have a bunch of if/else if statements saying if the item ID is this, set the texture to this, and so on.
hey I'm having some trouble with this i keep getting this error
2013-07-10 21:08:50 [SEVERE] [ForgeModLoader] Fatal errors were detected during the transition from INITIALIZATION to POSTINITIALIZATION. Loading cannot continue
2013-07-10 21:08:50 [SEVERE] [ForgeModLoader]
mcp{8.03} [Minecraft Coder Pack] (minecraft.jar) Unloaded->Constructed->Pre-initialized->Initialized
FML{6.1.39.775} [Forge Mod Loader] (coremods) Unloaded->Constructed->Pre-initialized->Initialized
Forge{8.9.0.775} [Minecraft Forge] (coremods) Unloaded->Constructed->Pre-initialized->Initialized
TutorialMod{v1} [Tutorial Mod] (bin) Unloaded->Constructed->Pre-initialized->Errored
2013-07-10 21:08:50 [SEVERE] [ForgeModLoader] The following problems were captured during this phase
2013-07-10 21:08:50 [SEVERE] [ForgeModLoader] Caught exception from TutorialMod
java.lang.ArrayIndexOutOfBoundsException: 5000
at net.minecraft.block.Block.(Block.java:345)
at EvoCraft.MithrilBlock.(MithrilBlock.java:17)
at EvoCraft.EvoCraft.load(EvoCraft.java:59)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at cpw.mods.fml.common.FMLModContainer.handleModStateEvent(FMLModContainer.java:540)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at com.google.common.eventbus.EventHandler.handleEvent(EventHandler.java:74)
at com.google.common.eventbus.SynchronizedEventHandler.handleEvent(SynchronizedEventHandler.java:45)
at com.google.common.eventbus.EventBus.dispatch(EventBus.java:313)
at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:296)
at com.google.common.eventbus.EventBus.post(EventBus.java:267)
at cpw.mods.fml.common.LoadController.sendEventToModContainer(LoadController.java:193)
at cpw.mods.fml.common.LoadController.propogateStateMessage(LoadController.java:173)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at com.google.common.eventbus.EventHandler.handleEvent(EventHandler.java:74)
at com.google.common.eventbus.SynchronizedEventHandler.handleEvent(SynchronizedEventHandler.java:45)
at com.google.common.eventbus.EventBus.dispatch(EventBus.java:313)
at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:296)
at com.google.common.eventbus.EventBus.post(EventBus.java:267)
at cpw.mods.fml.common.LoadController.distributeStateMessage(LoadController.java:104)
at cpw.mods.fml.common.Loader.initializeMods(Loader.java:697)
at cpw.mods.fml.client.FMLClientHandler.finishMinecraftLoading(FMLClientHandler.java:222)
at net.minecraft.client.Minecraft.startGame(Minecraft.java:502)
at net.minecraft.client.Minecraft.run(Minecraft.java:792)
at net.minecraft.client.main.Main.main(Main.java:93)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at net.minecraft.launchwrapper.Launch.launch(Launch.java:57)
at net.minecraft.launchwrapper.Launch.main(Launch.java:18)
mind helping me?
Your mithril block can't have an ID of 5000, it seems to be too high. Try lowering the id, and if it doesnt solve the problem, post what is on line 17 of MithrilBlock.java
how in the earth can I code my custom sounds?!?!?!?!? I want to add them finally at some day!!!!!!!!!
Normally I try not to feed code to people, but custom sounds are simple so this is how I did mine:
Placed custom sound in folder "/forge/mcp/src/minecraft/assets/civil war/sound/{sound name}.{ogg or wav}
Then I made class EventHandler{mod initials} and put this code inside it:
Ninjapancakes87 where's your load method in your load method in your main class
Here is the methods in my main class
@EventHandler
public void preInit(FMLPreInitializationEvent event){
Config.Init(event);
EventHandlerCW eventHandler = new EventHandlerCW();
MinecraftForge.EVENT_BUS.register(eventHandler);
CwLogger.setParent(FMLLog.getLogger());
Registry.preInit();
}
@EventHandler
public void Init(FMLInitializationEvent event){
Registry.Init();
}
@EventHandler
public void PostInit(FMLPostInitializationEvent event){
CwLogger.info("Civil War " + version + " Initialized");
Registry.postInit();
}
And then in my registry class i have a method named preInit, Init, and postInit which each contains smaller methods like InitBlocksAndItems and EntityRegistry, stuff like that
After making your Mod class, now paste the following code your class:
package SCMowns.Tutorial; //Package directory
/*
* Basic importing
*/
import net.minecraft.block.Block;
import net.minecraft.item.EnumToolMaterial;
import net.minecraft.item.Item;
import net.minecraft.item.ItemFood;
import net.minecraft.item.ItemStack;
import net.minecraftforge.common.EnumHelper;
import cpw.mods.fml.common.Mod;
import cpw.mods.fml.common.Mod.Init;
import cpw.mods.fml.common.event.FMLInitializationEvent;
import cpw.mods.fml.common.network.NetworkMod;
import cpw.mods.fml.common.registry.GameRegistry;
import cpw.mods.fml.common.registry.LanguageRegistry;
/*
* Basic needed forge stuff
*/
@Mod(modid="TutorialMod",name="Tutorial Mod",version="v1")
@NetworkMod(clientSideRequired=true,serverSideRequired=false)
public class TutorialMod {
/*
* ToolMaterial
*/
//Telling forge that we are creating these
public static Item topaz;
//Declaring Init
@Init
public void load(FMLInitializationEvent event){
// define items/blocks
topaz = new GemItems(2013).setUnlocalizedName("topaz");
//adding names
LanguageRegistry.addName(topaz, "Topaz Gem");
//crafting
}
}
Watch the video tutorial for information about what some lines mean.
Time to make a class for the GemItems. Here's what you add in that class:
package SCMowns.Tutorial;
import net.minecraft.item.Item;
import cpw.mods.fml.relauncher.*;
import net.minecraft.creativetab.CreativeTabs;
public class GemItems extends Item {
public GemItems(int par1) {
super(par1); //Returns super constructor: par1 is ID
setCreativeTab(CreativeTabs.tabMaterials); //Tells the game what creative mode tab it goes in
}
}
alright, after importing everything we need, now lets make the block,
in your public class brackets, make a new public static block.
public static Block BlockName;
now we need to declare what BlockName is,
in your public void load brackets, put there lines of code inside:
BlockName= new NewBlockClass(3608, "BlockName_Whatever").setUnlocalizedName("Texture_For_Block").setHardness(2.0F).setStepSound(Block.soundMetalFootstep).setResistance(10.0F);
GameRegistry.registerBlock(BlockName, "BlockName");
LanguageRegistry.addName(BlockName, "Blood Name");
setHardness = how hard your block will be, to see the list of vanilla blocks, you can check out the Block.java file
setResistance is how much resistence would the block have against impacts.
You can follow the video tutorial for the little things.
Now we need to define our new NewBlockClass.java.
Make a new class, for example: NewBlockClass
Now paste these lines of code inside:
package Your.Package;
import java.util.Random;
import cpw.mods.fml.common.Mod.Init;
import cpw.mods.fml.common.event.FMLInitializationEvent;
import cpw.mods.fml.common.registry.LanguageRegistry;
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.client.renderer.texture.IconRegister;
import net.minecraft.creativetab.CreativeTabs;
public class NewBlockClass extends Block {
public BlockName(int par1, String texture) {
super(par1, Material.rock);
setCreativeTab(CreativeTabs.tabBlock); //place in creative tabs
}
//drops when broken with pickaxe
public int idDropped(int par1, Random par2Random, int par3)
{
return MainClass.ITEM.itemID;
}
public int quantityDropped(Random random)
{
return 3;
}
//texure the block (Not sure if it's required)
public String getTextureFile(){
return "/textures/blocks/TEXTURE_NAME.png";
}
}
Video: Src: Basic Crafting:
In your main class, paste the code in your public void load():
GameRegistry.addRecipe(new ItemStack(topazblock,1), new Object[]{
"TTT","TTT","TTT",'T',topaz,
});
To read this code, we are making a topaz block with 9 topaz. T = 1 topaz, (topazblock,1) = we are crafting a topaz block and only getting one of them.
Here is an example using numbers in the crafting grid. Do you see the "TTT","TTT","TTT"
Not think of this code:
"TTT","TTT","TTT"
as:
"123","456","789"
That is how you can tell the crafting grid in java. (Watch my video for a better explanation.)
Shapeless Crafting:
shapless crafting is making anything freely in the crafting table, without having any specific order.
(watch the video for a better explanation)
GameRegistry.addShapelessRecipe(new ItemStack(TrioItem,1), new Object[]{
RubyItem, SapphireItem, Item.emerald });
The coding is a lot similar to the Basic Crafting, but worded differently.
To make a Trio Gem, You need a Rubie, Sapphire, and an Emerald. These gems can be placed in the crafting table without any order to make a Trio Gem. ( This mod is Copyrighted. TrioGems Mod.)
6.Ores / World Gen in Overworld 1.5.2 (New!)
Video:
In order to make an ore in Minecraft forge we need to make a basic block. We have already made one before (Episode 4). After we have made a new block, we need it to generate around the overworld. We need to make a new World generator!
In your Main class, under public void load's brackets we need to register out new world gen. Paste this line of code within the brackets:
You will have a red underline around this are: WorldGeneratorSCMowns - You need to hover over it, and make a new class in your package named WorldGeneratorSCMowns. (or whatever you named it) You can call it WorldGeneratorOreGen (To make it simple)
Next after you have made a new class called "WorldGeneratorSCMowns", Paste this entire line of codes inside that class.
package Your.Package;
import java.util.Random;
import net.minecraft.world.World;
import net.minecraft.world.chunk.IChunkProvider;
import net.minecraft.world.gen.feature.WorldGenMinable;
import cpw.mods.fml.common.IWorldGenerator;
import cpw.mods.fml.common.IWorldGenerator;
public class WorldGeneratorSCMowns implements IWorldGenerator {
@Override
public void generate(Random random, int chunkX, int chunkZ, World world,
IChunkProvider chunkGenerator, IChunkProvider chunkProvider) {
// TODO Auto-generated method stub
switch(world.provider.dimensionId){
//case -1: generateNether(world, random,chunkX*16,chunkZ*16);
case 0 : generateSurface(world, random,chunkX*16,chunkZ*16);
}
}
private void generateSurface(World world, Random random, int BlockX, int BlockZ) {
for(int i =0; i<10;i++){
int Xcoord = BlockX + random.nextInt(16);
int Zcoord = BlockZ + random.nextInt(16);
int Ycoord = random.nextInt(16);
(new WorldGenMinable(YourClass.YourBlock.blockID, 4)).generate(world, random, Xcoord, Ycoord, Zcoord);
}}}
I have left some code out of the class, that is where you see the "//" comment. That will be used in our Nether ore generation if you are inerested in that later on.
So first off, Make sure you fix your package import.
then rename anything that you have changed, so if you changed the name "WorldGeneratorSCMowns" to something else like "WorldGeneratorMyOres" rename this line of code:
public class WorldGeneratorSCMowns implements IWorldGenerator
If we look at our private void generateSurface we will be making our Basic Block genterate around in Minecraft. So since the case is set to 0, it will generate in the overworld, see this line of codes:
case 0 : generateSurface(world, random,chunkX*16,chunkZ*16);
If the case = 0 then it will generate in the overworld,
we have this here in our private void generateSurface:
(int i =0; i<10;i++)
i is the case, and it = 0. You can mess around with the i<10 - The higher the #, it should increase the chances when the ore spawns in the overworld.
For these lines of code:
int Xcoord = BlockX + random.nextInt(16);
int Zcoord = BlockZ + random.nextInt(16);
int Ycoord = random.nextInt(16);
These are the cordance of where the ores generate at random. I normally leave them 16x16x16 if you would like them to generate like Iron ores, You can chnage 16 to 32, if you would like the ore to generate more farther apart from each other.
For this line of code:
(new WorldGenMinable(YourClass.YourBlock.blockID, 4)).generate(world, random, Xcoord, Ycoord, Zcoord);
We are defining what is being generated. Replace YourClass with your main class, and YourBlock with your Basic Block you made. 4 = the vane size of the ore. Like how many ores will be together when generating. You can lower it or raise it if you like. Other then that, you should be set! Check the video for more info!
7.Tools (Sword, Shovel, Pickaxe, Hoe, Axe) and new Tool material1.5.2 (New!)
Video:
In order to begin making your first forge tools you need to make a new enum tool material. What that is, think of a diamond, it has the highest durability, strengh, etc. You can make your weapons/tools weak or strong, all it takes is to make a new enum tool material.
Copy and paste this line of coding in the public class of your main mod class:
For an example, this tool material named EnumToolMaterialTopaz is considered "Low Powered". For more info about the enum tool material, check out Minecraft's class: "EnumToolMaterial".
Once you have the enum tool material, time to make the tools!
Copy and paste this line of codes in your public class section:
public static Item TopazAxe;
public static Item TopazShovel;
public static Item TopazSword;
public static Item TopazPickaxe;
public static Item TopazHoe;
Now we have made the tools registered, time to define them,
Copy and paste these lines of code in your public void load():
TopazAxe = new SCMownsAxe(9014, EnumToolMaterialTopaz).setUnlocalizedName("Texture_file_name");
TopazShovel = new SCMownsShovel(9015, EnumToolMaterialTopaz).setUnlocalizedName("Texture_file_name");
TopazPickaxe = new SCMownsPickaxe(9016, EnumToolMaterialTopaz).setUnlocalizedName("Texture_file_name");
TopazHoe = new SCMownsHoe(9017, EnumToolMaterialTopaz).setUnlocalizedName("Texture_file_name");
TopazSword = new SCMownsSword(9018, EnumToolMaterialTopaz).setUnlocalizedName("Texture_file_name");
You will get some red underlines, we will clear them up in a bit. First off make sure all your picture file names are replaced. "Texture_file_name" replace that with your pictures file's name. The 9014 is the Item ID. And now we gotta make a new class for SCMownsAxe, SCMownsShovel, SCMownsPickaxe, SCMownsHoe, and SCMownsSword.
So make those new classes!
And once you are done making all the 5 new classes, paste this inside the SCMownsAxe, SCMownsShovel, SCMownsPickaxe, SCMownsHoe, and SCMownsSword classes.
package Your.Package;
import net.minecraft.item.EnumToolMaterial;
import net.minecraft.item.ItemPickaxe;
// *REMEBER* Change "ItemPickaxe" to ItemAxe, ItemHoe, ItemSword, etc if you are making those tools!
public class SCMownsPickaxe extends ItemPickaxe {
public SCMownsPickaxe(int ItemID, EnumToolMaterial material){
super(ItemID, material);
}
}
Read that remember comment! You will need to change the "ItemPickaxe" if you are making a axe, sword, shovel, etc.
In order to begin making a creative tab in Minecraft forge you will need to open up your main mod class and paste the following code: (paste it somewhere in your public static section)
public static CreativeTabs tabYourTab = new TabSCMownsTutorialMod(CreativeTabs.getNextID(), "SCMowns Tutorial Mod");
Reading this, you are creating a new CreativeTab. tabYourTab is the actual tab you are making. Change that to something different like tabSCMowns, tabSteven, etc. What CreativeTabs.getNextID() is doing is looking for the next available ID for the creative tab. And inside those quotes I put SCMowns Tutorial Mod, change that to something else, the reason why is when the player hovers over the tab that name will appear.
Make sure to import the following package:
import net.minecraft.creativetab.CreativeTabs;
You will have a red underline on TabSCMownsTutorialMod. What you need to do now is create a new class called: TabSCMownsTutorialMod, and paste in this code:
package SCMowns.Tutorial;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.creativetab.CreativeTabs;
public final class TabSCMownsTutorialMod extends CreativeTabs
{
public TabSCMownsTutorialMod(int par1, String par2Str)
{
super(par1, par2Str);
}
//sets the image for the creative tab
@SideOnly(Side.CLIENT)
public int getTabIconItemIndex()
{
//there is a difference between items and blocks. will give an example of both
return TutorialMod.topaz.itemID;
}
//sets the title/name for the creative tab
public String getTranslatedTabLabel()
{
return "SCMowns Tutorial Mod";
}
}
So now that you have created a new class called TabSCMownsTutorialMod, you will need to make sure your package is right, and fix any red underlines you might come across. You will need to change " return TutorialMod.topaz.itemID;" to a item/block of your choice. What that is doing is displaying that particular item/block on the creative tab. I picked my Topaz Gem to be displayed, see it here:
Ok, now after you have found the right block/item to showcase on the tab, time to change this: "return "SCMowns Tutorial Mod";" changing that to anything you like will have it displayed on the actual tab itself. As you see on the picture, it's witten on the tab. (above the tools/blocks)
So now that you have changed everything. Time for you to set your items and blocks in that new creative tab. To do that, find your item/block classes, like "GemItems" for example, or "SCMownsBasicAxe" or "TopazOre". when you open the class replace the old creative tab code and use this one:
By rendering I mean the one responsible for calling the rendering it, not the model file.
IT BETTER COME OUT QUICK AND IT BETTER BE ABOUT ARMOR I WANT TO FINISH OFF MY MOD AND SHOW IT OFF CAUSE SOME OF MY FRIENDS ARE SAYING I CANT DO IT AND I WANT TO PROVE EM WRONG
Or figure it out yourself it shouldn't be hard if you know Java
There's a lot of techne tutorials out there, google them yourself mate
ok i understand the workspace but when i install forge no new folders open like the src, runtime, and temp
-
View User Profile
-
View Posts
-
Send Message
Curse PremiumHelp modders out by contributing to the Forge Ore Dictionary List! http://mce626.wix.com/odnlist
-
View User Profile
-
View Posts
-
Send Message
Curse Premiumare you talking about my mod, or just how to compile a mod that you made into a jar?
Help modders out by contributing to the Forge Ore Dictionary List! http://mce626.wix.com/odnlist
For any item that doesn't require special code, I have a class called ItemDefault that sets each item in my custom creative tab, and a method called registerIcons(IconRegister iconregister) that is @SideOnly(Side.CLIENT) and I have a bunch of if/else if statements saying if the item ID is this, set the texture to this, and so on.
For my textures, I have them in "forge/mcp/src/minecraft/assets/civil war/textures/{blocks/items}/{item name}.png" and I call my textures with
if(itemID == Registry.barrel.itemID) { this.itemIcon = iconRegister.registerIcon("Civil War:barrel"); }Your mithril block can't have an ID of 5000, it seems to be too high. Try lowering the id, and if it doesnt solve the problem, post what is on line 17 of MithrilBlock.java
Normally I try not to feed code to people, but custom sounds are simple so this is how I did mine:
Placed custom sound in folder "/forge/mcp/src/minecraft/assets/civil war/sound/{sound name}.{ogg or wav}
Then I made class EventHandler{mod initials} and put this code inside it:
@ForgeSubscribe @SideOnly(Side.CLIENT) public void onSoundLoad(SoundLoadEvent event) { try{ event.manager.addSound("civil war:gunshot.ogg"); event.manager.addSound("civil war:hurt.wav"); event.manager.addSound("civil war:thump.wav"); CivilWar.CwLogger.finer("Sounds successfully registered"); } catch(Exception e){ CivilWar.CwLogger.log(Level.WARNING, "Sounds not loaded!"); } }in my load method
Here is the methods in my main class
@EventHandler public void preInit(FMLPreInitializationEvent event){ Config.Init(event); EventHandlerCW eventHandler = new EventHandlerCW(); MinecraftForge.EVENT_BUS.register(eventHandler); CwLogger.setParent(FMLLog.getLogger()); Registry.preInit(); } @EventHandler public void Init(FMLInitializationEvent event){ Registry.Init(); } @EventHandler public void PostInit(FMLPostInitializationEvent event){ CwLogger.info("Civil War " + version + " Initialized"); Registry.postInit(); }-
View User Profile
-
View Posts
-
Send Message
Curse Premiumoh, nope i do not know how...i've only used zips...
Help modders out by contributing to the Forge Ore Dictionary List! http://mce626.wix.com/odnlist
THX MAN IT HELPED ME A LOT !