Is there any way to have my textures so that when the user copies my mod over to the mods folder it will already have my textures inside the mods folder and they wont have to manually drop them into the 1.6.4 jar file?
Ive seen this on many mods so i know that its possible but i just dont know how. Thanks!
Thanks Syn! I didn't watch too many of your videos because, although copying and pasting sounds 'fun', I didn't need to for I used to mod back in 1.4.x,1.2.x, etc. and these classes reminded me what-does-what and that is a greater gift than most people can afford. Thank you.
~Blackout
EDIT: I fixed it it was a capitol letter BlockID; and it must me blockID;
OMG: now does the texture not load, what do i need to do about it???
whats wrong with my code???....
Ehm, I'm not sure, but may it be that the file in the .jar/assets/items/ is not Concrete.png but concrete.png? or, well, mine didn't work until i named the file what I named the variable -
electricalIron would not load the texture "electricIron" but only "electricalIron" even if you said that it should be "electricIron"
I hope that helps a tad bit.
Is there any way to have my textures so that when the user copies my mod over to the mods folder it will already have my textures inside the mods folder and they wont have to manually drop them into the 1.6.4 jar file?
Ive seen this on many mods so i know that its possible but i just dont know how. Thanks!
I'm pretty sure mods load like resource packs/texture packs as in you can put an assets folder inside of the mods .zip that contains /minecraft/textures/items and would hold your textures. That's how I used to do it. Now I'm not very sure.
public ZFXitems(int par1) {
super(par1); //Returns super constructor: par1 is ID
setCreativeTab(CreativeTabs.tabMaterials); }//Tells the game what creative mode tab it goes in
public void registerIcons(IconRegister reg) { // Make sure to import IconRegister!
if (itemID == HyperZone.hyperized_diamond.itemID) {
this.itemIcon = reg.registerIcon("hyperized_diamond"); // You can also replace blockID and blockIcon with itemID and itemIcon
}
if (itemID == HyperZone.anti_sugar.itemID) {
this.itemIcon = reg.registerIcon("anti_sugar"); // You can also replace blockID and blockIcon with itemID and itemIcon
}
ok, so that didnt work, any ways, im getting errors trying to add a saphire block, i have the SaphireBlock.class, but i keep getting errors. can u plz help
ok, so i started over with the mod and it was going great, but in the Synitems class, i have amethyst, sapphire, ruby and opal, but only the amethyst texture is loading. i am 100% positive that the textures are in the correct 1.6.4.jar. if u want it, here is the code
ModTutorial.java
package Syn.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;
import net.minecraft.creativetab.CreativeTabs;
/*
* Basic needed forge stuff
*/
@Mod(modid="Mo' Gems Mod",name="Mo' Gems Mod",version="v1.0")
@NetworkMod(clientSideRequired=true,serverSideRequired=false)
public class ModTutorial {
/*
* ToolMaterial
*/
//Telling forge that we are creating these
//items
public static Item amethyst;
public static Item sapphire;
public static Item ruby;
public static Item opal;
//tools
//Declaring Init
@Init
public void load(FMLInitializationEvent event){
// define items
amethyst = new Synitems(2000).setUnlocalizedName("amethyst");
sapphire = new Synitems(3000).setUnlocalizedName("sapphire");
ruby = new Synitems(4000).setUnlocalizedName("ruby");
opal = new Synitems(4500).setUnlocalizedName("opal");
public Synitems(int par1) {
super(par1); //Returns super constructor: par1 is ID
setCreativeTab(CreativeTabs.tabMaterials); }//Tells the game what creative mode tab it goes in
public void registerIcons(IconRegister reg) { // Make sure to import IconRegister!
if (itemID == ModTutorial.amethyst.itemID) {
this.itemIcon = reg.registerIcon("amethyst"); // You can also replace blockID and blockIcon with itemID and itemIcon
if (itemID == ModTutorial.sapphire.itemID) {
this.itemIcon = reg.registerIcon("sapphire"); // You can also replace blockID and blockIcon with itemID and itemIcon
if (itemID == ModTutorial.ruby.itemID) {
this.itemIcon = reg.registerIcon("ruby"); // You can also replace blockID and blockIcon with itemID and itemIcon
if (itemID == ModTutorial.opal.itemID) {
this.itemIcon = reg.registerIcon("opal"); // You can also replace blockID and blockIcon with itemID and itemIcon
}
Synasonic how do i fix a java.io.filenotfoundexception error in my mod.
I'm not sure but does the 'File not Found' in java.io.filenotfoundexception mean anything? Maybe it means the file wasn't found a.k.a you're referencing a class/texture that does not exist.
Try making sure the names of the texture(assumption ring-a-ding-a-ding-dong) are the same in code and in windows explorer.
(Or put all of your classes in spoilers, I can look at them and try to help.)
Okay this is a problem i got doing the Tool tutorial
I have a set of errors, my LanguageRegistey.addName(AmethystAxe, "Amethyst Axe"); all have errors,
all these lines have errors and the error states "Syntax error on tokens, VariableDeclarator expected instead"
see here:
Okay this is a problem i got doing the Tool tutorial
I have a set of errors, my LanguageRegistey.addName(AmethystAxe, "Amethyst Axe"); all have errors,
all these lines have errors and the error states "Syntax error on tokens, VariableDeclarator expected instead"
see here:
Post your full code and I can attempt to help you.I just wanted to say thank you so much for these tutorials. They have helped a lot. I only have one request, and that is that you go back through your code and check for mistakes. I had to change a few things / look up other tutorials to check others code to get stuff working. The majority of what I learned came from you and I thank you so much!
Post your full code and I can attempt to help you.
I just wanted to say thank you so much for these tutorials. They have helped a lot. I only have one request, and that is that you go back through your code and check for mistakes. I had to change a few things / look up other tutorials to check others code to get stuff working. The majority of what I learned came from you and I thank you so much!
Can you help me out too? Here is the code and error message.
Error:
2014-02-12 16:45:54 [SEVERE] [ForgeModLoader] Fatal errors were detected during the transition from INITIALIZATION to POSTINITIALIZATION. Loading cannot continue
2014-02-12 16:45:54 [SEVERE] [ForgeModLoader]
mcp{8.09} [Minecraft Coder Pack] (minecraft.jar) Unloaded->Constructed->Pre-initialized->Initialized
FML{6.4.49.965} [Forge Mod Loader] (bin) Unloaded->Constructed->Pre-initialized->Initialized
Forge{9.11.1.965} [Minecraft Forge] (bin) Unloaded->Constructed->Pre-initialized->Initialized
The LOL Mod{v1} [The LOL Mod] (bin) Unloaded->Constructed->Pre-initialized->Errored
2014-02-12 16:45:54 [SEVERE] [ForgeModLoader] The following problems were captured during this phase
2014-02-12 16:45:54 [SEVERE] [ForgeModLoader] Caught exception from The LOL Mod
java.lang.IllegalArgumentException: Illegal object for naming null
at cpw.mods.fml.common.registry.LanguageRegistry.addNameForObject(LanguageRegistry.java:114)
at cpw.mods.fml.common.registry.LanguageRegistry.addName(LanguageRegistry.java:122)
at Syn.MyMod.TheLOLMod.load(TheLOLMod.java:49)
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:545)
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:201)
at cpw.mods.fml.common.LoadController.propogateStateMessage(LoadController.java:181)
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:112)
at cpw.mods.fml.common.Loader.initializeMods(Loader.java:699)
at cpw.mods.fml.client.FMLClientHandler.finishMinecraftLoading(FMLClientHandler.java:249)
at net.minecraft.client.Minecraft.startGame(Minecraft.java:509)
at net.minecraft.client.Minecraft.run(Minecraft.java:808)
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:131)
at net.minecraft.launchwrapper.Launch.main(Launch.java:27)
TheLOLMod.java:
package Syn.MyMod; //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="The LOL Mod",name="The LOL Mod",version="v1")
@NetworkMod(clientSideRequired=true,serverSideRequired=false)
public class TheLOLMod {
/*
* ToolMaterial
*/
//Telling forge that we are creating these
//items
public static Item LOL;
//blocks
public static Block lolblock;
//tools
//Declaring Init
@Init
public void load(FMLInitializationEvent event){
// define items
LOL = new Synitems(1001).setUnlocalizedName("LOL");
// define blocks
//adding names
//items
LanguageRegistry.addName(LOL, "LOL");
//blocks
LanguageRegistry.addName(lolblock, "LOL Block");
//define blocks
lolblock = new LOLBlock(1002, "lolblock").setUnlocalizedName("lol_block").setHardness(50.0F).setStepSound(Block.soundMetalFootstep).setResistance(50.0F);
GameRegistry.registerBlock(lolblock, "lolblock");
//crafting
}
}
Synitems.java:
package Syn.MyMod;
import net.minecraft.item.Item;
import cpw.mods.fml.common.registry.GameRegistry;
import cpw.mods.fml.relauncher.*;
import net.minecraft.client.renderer.texture.IconRegister;
import net.minecraft.creativetab.CreativeTabs;
public class Synitems extends Item {
public Synitems(int par1) {
super(par1); //Returns super constructor: par1 is ID
setCreativeTab(CreativeTabs.tabMaterials); }//Tells the game what creative mode tab it goes in
public void registerIcons(IconRegister reg) { // Make sure to import IconRegister!
if (itemID == TheLOLMod.LOL.itemID) {
this.itemIcon = reg.registerIcon("LOL"); // You can also replace blockID and blockIcon with itemID and itemIcon
}
}
}
LOLBlock.java:
package Syn.MyMod;
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 LOLBlock extends Block {
public LOLBlock(int par1, String texture) {
super(par1, Material.iron);
setCreativeTab(CreativeTabs.tabBlock); //place in creative tabs
}
//drops when broken with pickaxe
public int idDropped(int par1, Random par2Random, int par3)
{
return TheLOLMod.lolblock.blockID;
}
public int quantityDropped(Random random)
{
return 1;
}
public void registerIcons(IconRegister reg) { // Make sure to import IconRegister!
this.blockIcon = reg.registerIcon("lol_block"); // You can also replace blockID and blockIcon with itemID and itemIcon
}
}
Can you help me out too? Here is the code and error message.
Error:
2014-02-12 16:45:54 [SEVERE] [ForgeModLoader] Fatal errors were detected during the transition from INITIALIZATION to POSTINITIALIZATION. Loading cannot continue
2014-02-12 16:45:54 [SEVERE] [ForgeModLoader]
mcp{8.09} [Minecraft Coder Pack] (minecraft.jar) Unloaded->Constructed->Pre-initialized->Initialized
FML{6.4.49.965} [Forge Mod Loader] (bin) Unloaded->Constructed->Pre-initialized->Initialized
Forge{9.11.1.965} [Minecraft Forge] (bin) Unloaded->Constructed->Pre-initialized->Initialized
The LOL Mod{v1} [The LOL Mod] (bin) Unloaded->Constructed->Pre-initialized->Errored
2014-02-12 16:45:54 [SEVERE] [ForgeModLoader] The following problems were captured during this phase
2014-02-12 16:45:54 [SEVERE] [ForgeModLoader] Caught exception from The LOL Mod
java.lang.IllegalArgumentException: Illegal object for naming null
at cpw.mods.fml.common.registry.LanguageRegistry.addNameForObject(LanguageRegistry.java:114)
at cpw.mods.fml.common.registry.LanguageRegistry.addName(LanguageRegistry.java:122)
at Syn.MyMod.TheLOLMod.load(TheLOLMod.java:49)
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:545)
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:201)
at cpw.mods.fml.common.LoadController.propogateStateMessage(LoadController.java:181)
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:112)
at cpw.mods.fml.common.Loader.initializeMods(Loader.java:699)
at cpw.mods.fml.client.FMLClientHandler.finishMinecraftLoading(FMLClientHandler.java:249)
at net.minecraft.client.Minecraft.startGame(Minecraft.java:509)
at net.minecraft.client.Minecraft.run(Minecraft.java:808)
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:131)
at net.minecraft.launchwrapper.Launch.main(Launch.java:27)
TheLOLMod.java:
package Syn.MyMod; //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="The LOL Mod",name="The LOL Mod",version="v1")
@NetworkMod(clientSideRequired=true,serverSideRequired=false)
public class TheLOLMod {
/*
* ToolMaterial
*/
//Telling forge that we are creating these
//items
public static Item LOL;
//blocks
public static Block lolblock;
//tools
//Declaring Init
@Init
public void load(FMLInitializationEvent event){
// define items
LOL = new Synitems(1001).setUnlocalizedName("LOL");
// define blocks
//adding names
//items
LanguageRegistry.addName(LOL, "LOL");
//blocks
LanguageRegistry.addName(lolblock, "LOL Block");
//define blocks
lolblock = new LOLBlock(1002, "lolblock").setUnlocalizedName("lol_block").setHardness(50.0F).setStepSound(Block.soundMetalFootstep).setResistance(50.0F);
GameRegistry.registerBlock(lolblock, "lolblock");
//crafting
}
}
Synitems.java:
package Syn.MyMod;
import net.minecraft.item.Item;
import cpw.mods.fml.common.registry.GameRegistry;
import cpw.mods.fml.relauncher.*;
import net.minecraft.client.renderer.texture.IconRegister;
import net.minecraft.creativetab.CreativeTabs;
public class Synitems extends Item {
public Synitems(int par1) {
super(par1); //Returns super constructor: par1 is ID
setCreativeTab(CreativeTabs.tabMaterials); }//Tells the game what creative mode tab it goes in
public void registerIcons(IconRegister reg) { // Make sure to import IconRegister!
if (itemID == TheLOLMod.LOL.itemID) {
this.itemIcon = reg.registerIcon("LOL"); // You can also replace blockID and blockIcon with itemID and itemIcon
}
}
}
LOLBlock.java:
package Syn.MyMod;
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 LOLBlock extends Block {
public LOLBlock(int par1, String texture) {
super(par1, Material.iron);
setCreativeTab(CreativeTabs.tabBlock); //place in creative tabs
}
//drops when broken with pickaxe
public int idDropped(int par1, Random par2Random, int par3)
{
return TheLOLMod.lolblock.blockID;
}
public int quantityDropped(Random random)
{
return 1;
}
public void registerIcons(IconRegister reg) { // Make sure to import IconRegister!
this.blockIcon = reg.registerIcon("lol_block"); // You can also replace blockID and blockIcon with itemID and itemIcon
}
}
I just started coding so I can't actually pinpoint where in your code it causes it to crash, but it seems to have to do with this:
java.lang.IllegalArgumentException: Illegal object for naming null
ok, thx, i use a windows 8 laptop with 4 gigs of RAM so that might be the case, but ill check the settings too.
Just one more block...
~Blackout
Ehm, I'm not sure, but may it be that the file in the .jar/assets/items/ is not Concrete.png but concrete.png? or, well, mine didn't work until i named the file what I named the variable -
electricalIron would not load the texture "electricIron" but only "electricalIron" even if you said that it should be "electricIron"
I hope that helps a tad bit.
I'm pretty sure mods load like resource packs/texture packs as in you can put an assets folder inside of the mods .zip that contains /minecraft/textures/items and would hold your textures. That's how I used to do it. Now I'm not very sure.
Youtube - http://www.youtube.com/channel/UCd3RSrIHxtzz_Z09vbVwPww
</lel>
If anyone can fix my problems I'd thank them.
HyperZone.java
package ZeFirstXperian.ModHyperZone; //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="HyperZone",name="Hyper Zone",version="v0.0.1")
@NetworkMod(clientSideRequired=true,serverSideRequired=false)
public class HyperZone {
/*
* ToolMaterial
*/
//Telling forge that we are creating these
//items
public static Item hyperized_diamond;
public static Item anti_sugar;
//blocks
public static Block hyperized_diamond_block;
//tools
//Declaring Init
@Init
public void load(FMLInitializationEvent event){
// define items
hyperized_diamond = new ZFXitems(422).setUnlocalizedName("hyperized_diamond");
anti_sugar = new ZFXitems(423).setUnlocalizedName("anti_sugar");
// define blocks
hyperized_diamond_block = new HyperizedDiamondBlock(174, "hyperized_diamond_block").setUnlocalizedName("blockHyperizedDiamond").setHardness(10.0F).setStepSound(Block.soundMetalFootstep).setResistance(20.0F);
GameRegistry.registerBlock(hyperized_diamond_block, "hyperized_diamond_block");
//adding names
//adding names
//items
LanguageRegistry.addName(hyperized_diamond, "Hyperized Diamond");
//blocks
LanguageRegistry.addName(hyperized_diamond_block, "Hyperized Diamond Block");
//crafting
GameRegistry.addRecipe(new ItemStack(hyperized_diamond,1), new Object[]{
"XXX","XNX","XXX",'N',Item.diamond,'X',Item.sugar
});
GameRegistry.addRecipe(new ItemStack(hyperized_diamond_block,1), new Object[]{
"TTT","TTT","TTT",'T',hyperized_diamond,
});
GameRegistry.addShapelessRecipe(new ItemStack(hyperized_diamond,9), new Object[]{
hyperized_diamond_block
});
//smelting
GameRegistry.addSmelting(Item.sugar.itemID, new ItemStack(anti_sugar, 1), 5F);
}
}
ZFXitems.java
package ZeFirstXperian.ModHyperZone;
import net.minecraft.item.Item;
import cpw.mods.fml.common.registry.GameRegistry;
import cpw.mods.fml.relauncher.*;
import net.minecraft.client.renderer.texture.IconRegister;
import net.minecraft.creativetab.CreativeTabs;
public class ZFXitems extends Item {
public ZFXitems(int par1) {
super(par1); //Returns super constructor: par1 is ID
setCreativeTab(CreativeTabs.tabMaterials); }//Tells the game what creative mode tab it goes in
public void registerIcons(IconRegister reg) { // Make sure to import IconRegister!
if (itemID == HyperZone.hyperized_diamond.itemID) {
this.itemIcon = reg.registerIcon("hyperized_diamond"); // You can also replace blockID and blockIcon with itemID and itemIcon
}
if (itemID == HyperZone.anti_sugar.itemID) {
this.itemIcon = reg.registerIcon("anti_sugar"); // You can also replace blockID and blockIcon with itemID and itemIcon
}
}
}
The problem is that it says: item.anti_sugar.name
Things just aren't what they seem anymore.
i hope the video worked, plz make a response video
ModTutorial.java
package Syn.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;
import net.minecraft.creativetab.CreativeTabs;
/*
* Basic needed forge stuff
*/
@Mod(modid="Mo' Gems Mod",name="Mo' Gems Mod",version="v1.0")
@NetworkMod(clientSideRequired=true,serverSideRequired=false)
public class ModTutorial {
/*
* ToolMaterial
*/
//Telling forge that we are creating these
//items
public static Item amethyst;
public static Item sapphire;
public static Item ruby;
public static Item opal;
//tools
//Declaring Init
@Init
public void load(FMLInitializationEvent event){
// define items
amethyst = new Synitems(2000).setUnlocalizedName("amethyst");
sapphire = new Synitems(3000).setUnlocalizedName("sapphire");
ruby = new Synitems(4000).setUnlocalizedName("ruby");
opal = new Synitems(4500).setUnlocalizedName("opal");
// define blocks
//adding names
//items
LanguageRegistry.addName(amethyst, "Amethyst");
LanguageRegistry.addName(sapphire, "Sapphire");
LanguageRegistry.addName(ruby, "Ruby");
LanguageRegistry.addName(opal, "Opal");
//blocks
//crafting
//creative tab(s)
}
}
Synitems.java
package Syn.Tutorial;
import net.minecraft.item.Item;
import cpw.mods.fml.common.registry.GameRegistry;
import cpw.mods.fml.relauncher.*;
import net.minecraft.client.renderer.texture.IconRegister;
import net.minecraft.creativetab.CreativeTabs;
public class Synitems extends Item {
public Synitems(int par1) {
super(par1); //Returns super constructor: par1 is ID
setCreativeTab(CreativeTabs.tabMaterials); }//Tells the game what creative mode tab it goes in
public void registerIcons(IconRegister reg) { // Make sure to import IconRegister!
if (itemID == ModTutorial.amethyst.itemID) {
this.itemIcon = reg.registerIcon("amethyst"); // You can also replace blockID and blockIcon with itemID and itemIcon
if (itemID == ModTutorial.sapphire.itemID) {
this.itemIcon = reg.registerIcon("sapphire"); // You can also replace blockID and blockIcon with itemID and itemIcon
if (itemID == ModTutorial.ruby.itemID) {
this.itemIcon = reg.registerIcon("ruby"); // You can also replace blockID and blockIcon with itemID and itemIcon
if (itemID == ModTutorial.opal.itemID) {
this.itemIcon = reg.registerIcon("opal"); // You can also replace blockID and blockIcon with itemID and itemIcon
}
}
}
}
}
}
Just one more block...
I'm not sure but does the 'File not Found' in java.io.filenotfoundexception mean anything? Maybe it means the file wasn't found a.k.a you're referencing a class/texture that does not exist.
Try making sure the names of the texture(assumption ring-a-ding-a-ding-dong) are the same in code and in windows explorer.
(Or put all of your classes in spoilers, I can look at them and try to help.)
Youtube - http://www.youtube.com/channel/UCd3RSrIHxtzz_Z09vbVwPww
</lel>
I have a set of errors, my LanguageRegistey.addName(AmethystAxe, "Amethyst Axe"); all have errors,
all these lines have errors and the error states "Syntax error on tokens, VariableDeclarator expected instead"
see here:
LanguageRegistry.addName(RubyAxe, "Amethyst Axe");
LanguageRegistry.addName(RubyShovel, "Amethyst Shovel");
LanguageRegistry.addName(RubyPickaxe, "Amethyst Pickaxe");
LanguageRegistry.addName(RubySword, "Amethyst Sword");
LanguageRegistry.addName(RubyHoe, "Amethyst Hoe");
can you help?
Post your full code and I can attempt to help you.I just wanted to say thank you so much for these tutorials. They have helped a lot. I only have one request, and that is that you go back through your code and check for mistakes. I had to change a few things / look up other tutorials to check others code to get stuff working. The majority of what I learned came from you and I thank you so much!
SYNASONIC
can u make a video to show how to make a block that can be broken by only certain pickaxes
Can you help me out too? Here is the code and error message.
Error:
TheLOLMod.java:
Synitems.java:
LOLBlock.java:
Just one more block...
I just started coding so I can't actually pinpoint where in your code it causes it to crash, but it seems to have to do with this:
java.lang.IllegalArgumentException: Illegal object for naming null
(In your ErrorLog).
http://pastebin.com/A7SMrdTy