hmmm i wont post the crash code because it is extremely long. the error is on this line
if (getStackInSlot(i) != null && getStackInSlot(i).itemID == mod_ECrystals.EarthCrystal.itemID) {
i will certainly look at the ItemDye, thanks for the idea
You can use [ SPOILER ] tags to comfortably paste crash logs and such. It looks to me like you are either not following Java naming conventions OR you are trying to access itemID from the CLASS EarthCrystal rather than an actual instance of that class.
For example, in your mod_ECrystals class, you should have something like this:
public static Item earthCrystal = new EarthCrystal(id, other parameters).setUnlocalizedName("earthCrystal").whatever else you need;
NOW you can access mod_ECrystals.earthCrystal.itemID with no error. Note the difference between using 'earthCrystal' and 'EarthCrystal'. The first is an object, the second is a class. Please read here for more information on objects and classes.
public static final Item EarthCrystal = new ItemEarthCrystal(1000).setUnlocalizedName("Earth").setTextureName("Earth").setCreativeTab(mod_ECrystals.tabCustom);
yes i do already have this line, so i dont get an error(in the code), just a crash report
i figured it out you guys!!! well, sorta. not i have to make it change back when the item isnt in the slot, but i think i got this. thanks for all of your help!
public static final Item EarthCrystal = new ItemEarthCrystal(1000).setUnlocalizedName("Earth").setTextureName("Earth").setCreativeTab(mod_ECrystals.tabCustom);
yes i do already have this line, so i dont get an error(in the code), just a crash report
Glad you figured it out, but for the future, it will save you lots of problems if you follow Java naming conventions like I mentioned earlier, as well as make it easier for others to help you. "EarthCrystal" looks like the name of a class; it should start with a lowercase letter instead to avoid confusion both for yourself and others, as well as to help prevent accidental errors.
Anyways, good luck with the rest of your project xD
I did everything as written in the tutorial, but I will not open inventory when I press O.
I can't help you if you don't post your code. Post your KeyBinding / KeyHandler classes, as well as your other classes. Please use spoiler and code tags:
Name of This Class
[ spoiler ]
[ code ]
// code for this class goes here
[ /code ]
[ /spoiler ]
I exactly followed the tut and all I got was "A mod tried to open a gui on the server without being a networkmod"
Did you forget to set up your main mod workspace using the @NetworkMod annotation?
// example from my zelda mod
@Mod(modid = ModInfo.ID, name = ModInfo.NAME, version = ModInfo.VERSION)
@NetworkMod(clientSideRequired=true, serverSideRequired=true, channels = {ModInfo.CHANNEL}, packetHandler = ZSSPacketHandler.class)
public class ZSSMain
{
@Instance(ModInfo.ID)
public static ZSSMain instance = new ZSSMain();
@SidedProxy(clientSide = ModInfo.CLIENT_PROXY, serverSide = ModInfo.COMMON_PROXY)
public static CommonProxy proxy;
// rest of the class is the init, load, etc. methods
}
100% sure, to understand the basics of this tutorial i just followed along by copy and pasting in ur code and just change the names of the classes + inv size to my own liking.
btw, its the ItemInventory tutorial and not the player inventory one.
Yes, but I didn't explicitly go over adding in the GuiHandling code in the ItemInventory tutorial, but it is still necessary. I should add that in... in the meantime, you can check the referenced section in the player inventory tutorial. If that doesn't work for you, can you post your IGuiHandler code, as well as the code where you open the Gui?
Alright, well you shouldn't have both onItemUse AND onRightClick opening the Gui - I was just showing that you can use either, but you should choose only one.
What about it doesn't work again? It doesn't open for you when you right-click? I'm going to need to see every class related to the inventory, container, gui, and even your probably your main class at this point, because we're not getting anywhere like this.
if (getStackInSlot(i) != null && getStackInSlot(i).itemID == mod_ECrystals.EarthCrystal.itemID) {
i will certainly look at the ItemDye, thanks for the idea
http://www.planetminecraft.com/mod/couple-of-new-mobs/
-
View User Profile
-
View Posts
-
Send Message
Curse PremiumYou can use [ SPOILER ] tags to comfortably paste crash logs and such. It looks to me like you are either not following Java naming conventions OR you are trying to access itemID from the CLASS EarthCrystal rather than an actual instance of that class.
For example, in your mod_ECrystals class, you should have something like this:
public static Item earthCrystal = new EarthCrystal(id, other parameters).setUnlocalizedName("earthCrystal").whatever else you need;NOW you can access mod_ECrystals.earthCrystal.itemID with no error. Note the difference between using 'earthCrystal' and 'EarthCrystal'. The first is an object, the second is a class. Please read here for more information on objects and classes.
yes i do already have this line, so i dont get an error(in the code), just a crash report
http://www.planetminecraft.com/mod/couple-of-new-mobs/
http://www.planetminecraft.com/mod/couple-of-new-mobs/
Without the crash report we can only GUESS at the reason for the crashes
Just remember that until next time
true true, but for one reason or another, the report was literally 117 pages long, but i figured it out. thanks!
http://www.planetminecraft.com/mod/couple-of-new-mobs/
-
View User Profile
-
View Posts
-
Send Message
Curse PremiumGlad you figured it out, but for the future, it will save you lots of problems if you follow Java naming conventions like I mentioned earlier, as well as make it easier for others to help you. "EarthCrystal" looks like the name of a class; it should start with a lowercase letter instead to avoid confusion both for yourself and others, as well as to help prevent accidental errors.
Anyways, good luck with the rest of your project xD
-
View User Profile
-
View Posts
-
Send Message
Curse PremiumThank you for the interest in my tutorial, but I will not be making any video tutorials at this time. Sorry.
If you have any questions regarding the text tutorials I have provided, however, I am more than happy to do my best to assist you.
-
View User Profile
-
View Posts
-
Send Message
Curse PremiumI can't help you if you don't post your code. Post your KeyBinding / KeyHandler classes, as well as your other classes. Please use spoiler and code tags:
Name of This Class
[ spoiler ]
[ code ]
// code for this class goes here
[ /code ]
[ /spoiler ]
Remove the spaces from within the brackets.
-
View User Profile
-
View Posts
-
Send Message
Curse PremiumThat's because it's a class you have to make. I just named it that as an example, but you could name it anything you like.
-
View User Profile
-
View Posts
-
Send Message
Curse PremiumDid you forget to set up your main mod workspace using the @NetworkMod annotation?
// example from my zelda mod @Mod(modid = ModInfo.ID, name = ModInfo.NAME, version = ModInfo.VERSION) @NetworkMod(clientSideRequired=true, serverSideRequired=true, channels = {ModInfo.CHANNEL}, packetHandler = ZSSPacketHandler.class) public class ZSSMain { @Instance(ModInfo.ID) public static ZSSMain instance = new ZSSMain(); @SidedProxy(clientSide = ModInfo.CLIENT_PROXY, serverSide = ModInfo.COMMON_PROXY) public static CommonProxy proxy; // rest of the class is the init, load, etc. methods }-
View User Profile
-
View Posts
-
Send Message
Curse PremiumDid you set up your GuiHandler to return the correct server and client side elements? See section 4.1: Odds and Ends.
-
View User Profile
-
View Posts
-
Send Message
Curse PremiumYes, but I didn't explicitly go over adding in the GuiHandling code in the ItemInventory tutorial, but it is still necessary. I should add that in... in the meantime, you can check the referenced section in the player inventory tutorial. If that doesn't work for you, can you post your IGuiHandler code, as well as the code where you open the Gui?
-
View User Profile
-
View Posts
-
Send Message
Curse Premium-
View User Profile
-
View Posts
-
Send Message
Curse PremiumWhat about it doesn't work again? It doesn't open for you when you right-click? I'm going to need to see every class related to the inventory, container, gui, and even your probably your main class at this point, because we're not getting anywhere like this.
-
View User Profile
-
View Posts
-
Send Message
Curse PremiumIt looks like you forgot to register your GuiHandler in your main class. Put the following in load or postInit: