
Javada
Members-
Posts
21 -
Joined
-
Last visited
Converted
-
Gender
Undisclosed
-
Personal Text
I am new!
Javada's Achievements

Tree Puncher (2/8)
0
Reputation
-
I placed the @Override item into my code and I got an error message. Do I need to place it under a different heading, like super or private? Second, best way to code an item's chance of being dropped is an if/then or simply EventHandle?
-
So, similarly, if I wanted at add the chance for an item to drop when the player hits a new block type, I would create a class, extend the block class and simply add the new drop event. Because it is a new class, this added event will only affect it and not the blocks in the vanilla game but the new block will have all the regular features of the vanilla block from which it is extended. Correct?
-
Currently coding for 1.7.10 Minecraft. Two issues I am facing right now. First, when I test out my mod, the name of all the items shows as "item.itemname.name" when the item is held in the player's hand. All the graphics show up fine, but the names do not. Also, for some reason, the language files is showing up as it's own asset bundle in Eclipse, which I think is what is causing the issue but it will not let me add it to the main mod's asset package. Secondly, I am having trouble getting the player to consume the foods. I have examined the source code for food in the vanilla game and in a few other food mods, but it still isn't working. A fellow modder said all I needed to do was create a new class, for example "ItemModFood", and then put a single line of code to get it to work, "public class ItemModFood extends ItemFood", but Eclipse threw a ton of errors at me when I tried to save that class. This is the code as I have it now, sans the first two quotations marks; " public class ItemModFood extends ItemFood { private int itemUseDuration; private int healAmount; private int getMaxItemUseDuration; private int setMaxStackSize; private float saturationModifier; private boolean isWolfsFavoriteMeat; private boolean alwaysEdible; public ItemModFood(int hunger, float sat, boolean wolf) { super(hunger, sat, wolf); this.itemUseDuration=24; this.healAmount=hunger; this.saturationModifier=sat; this.isWolfsFavoriteMeat=wolf; this.setMaxStackSize=16; this.setCreativeTab(CreativeTabs.tabFood); } public ItemStack onEaten(ItemStack food, World world, EntityPlayer player) { player.getFoodStats().func_151686_a(this, food); world.playSoundAtEntity(player, "random burp", 0.5F, world.rand.nextFloat()*0.1F + 0.9F); this.onFoodEaten(food, world, player); return food; } public EnumAction getItemUseAction(ItemStack food) { return EnumAction.eat; } public ItemModFood setAlwaysEdible() { this.alwaysEdible=false; return this; } public ItemStack onItemRightClick(ItemStack food, World world, EntityPlayer player) { if(player.canEat(this.alwaysEdible)) { player.setItemInUse(food, this.getMaxItemUseDuration(food)); } return food; } }" Any suggestions would be appreciated.
-
So much for spell check. Thanks, Elyon. As far as the code, when I use the second method I get the following error: "Type mismatch: cannot convert from Item to ItemModSoup" I am assuming that means I need a line that says "public static ItemFood extends Item" somewhere on the page or a new class that states it, but you know what they say about people who assume. I remember Java coding being so much easier. Either I really lost it or it has changed that much. Regardless, the old adage of "if you don't use it, you lose it" is statement(true) in this case.
-
Found some of the food files and I have a question. Which of the following strings is the correct way to code a new food item? porriage = (ItemModSoup) new ItemModSoup(3, 1.0F, false).setUnlocalizedName(Recipes.MODID + "_" + "porriage").setTextureName(Recipes.MODID + ":" + "porriage"); OR porriage = new ItemModSoup(3, 1.0F, false).setUnlocalizedName(Recipes.MODID + "_" + "porriage").setTextureName(Recipes.MODID + ":" + "porriage") Also, does this code need to be on the main mod page or the class page under which the new item falls?
-
Thanks. So change "public class ItemFoodporriage extends Item" to "public class ItemFoodporriage extends ItemFood" Some of the numbers were place holders until I could figure out what needed to go there. As far as the Vanilla foods, when I try to open the file I get this error: "The Class File Viewer cannot handle the given input". Any ideas?
-
I pulled up the ItemFood Class in Forge and it has a lot of fields with p_i#####_#_ with no explanation of what those numbers represent or if they are fields I have to create. So, I fiddled and came up with this. ------------------------------------------------------------------------- import net.minecraft.creativetab.CreativeTabs; import net.minecraft.item.Item; import net.minecraft.item.ItemFood; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.potion.PotionEffect; import net.minecraft.world.World; public class ItemFoodporriage extends Item { public final int itemUseDuration; private final int healAmount; private final float saturationModifier; private final boolean isWolfsFavoriteMeat; private boolean alwaysEdible; private int potionID; private int potionDuration; private int potionAmplifier; public ItemFoodporriage(int 1, float 2, boolean 3) { this.itemUseDuration=32; this.healAmount=4; this.isWolfsFavoriteMeat=false; this.saturationModifier=15; this.setCreativeTab(CreativeTabs.tabFood); setUnlocalizedName(Recipes.MODID + "_" + "porriage"); setTextureName(Recipes.MODID + ":" + "porriage"); setCreativeTab(CreativeTabs.tabFood); } public ItemFoodporriage setAlwaysEdible() { this.alwaysEdible=false; return this; } } ------------------------------------------------------------------------ I am receiving 2 Syntax errors. The first is "Syntax error on token "1", invalid VariableDeclaratorId" but near the (int 1, Float 2) line. And the second error is "Syntax error, insert "}" to complete BlockStatements" is appearing after the setCreativeTab line towards the bottom. I know I am missing lines of code, I'm not finished yet, but I was hoping to get some feedback or tips for the code thus far. Also, if someone could explain what the p_i#####_#_ thing is I would appreciate it. I believe it is a place holder, but I am not certain with what values I am supposed to replace them. Thank you
-
[1.7.10] Questions on Using a Water Bucket in Recipe
Javada replied to Javada's topic in Modder Support
a) I am trying to avoid destroying my computer ... again. I won't pester the forum. b) Thank you -
I am writing a new recipe that uses a bucket of water. Is there anything special I need to add to the code to ensure I get an empty bucket back in addition to the new item?
-
Errors in Eclipse Workshop, where did I go wrong?
Javada replied to Javada's topic in Modder Support
Many thanks for all your help. I deleted the unneeded folder and extracted from fresh downloads of both Eclipse and Forge and there are no more errors. I appreciate all the time you took to help me! Thank you -
Errors in Eclipse Workshop, where did I go wrong?
Javada replied to Javada's topic in Modder Support
I am still receiving the same errors and the scr/main folder is still empty. I am going to delete the Forge folder and the Folder 1 created earlier, reboot my computer, download a fresh Forge package from the website and try again. I will let you know if I still get the errors after that. -
Errors in Eclipse Workshop, where did I go wrong?
Javada replied to Javada's topic in Modder Support
Will do. Is there anything special I need to do to get ride of the folders I created using the older method? Or can I simply delete them? -
Errors in Eclipse Workshop, where did I go wrong?
Javada replied to Javada's topic in Modder Support
The original instructions I followed where found here -> http://minecraft.gamepedia.com/Mods/Creating_mods/Setting_up_the_MCP_workspace The steps I followed boil down to this: "Create a new folder (Folder 1) wherever you would like to have all of your modding workspaces. Create a new folder (Folder 2) in this folder to store your mods. Unpack the MCP folder in Folder 1. Back up your minecraft 'bin' file. Copy the "bin" and "resources" folders, open the "jars" folder inside Folder 2 and paste the copies. Downloand Modloader, install it into the "Jar" of Folder 2. Delete the META-INF folder (This step I skipped, as I all ready had Forge on my computer and was told I did not need Modloader if I had Forge) Download the minecraft_server.jar from the Minecraft Website into the jar of Folder 2. Run the udpatemcp.bat file found in Folder 2. Type "yes" if you wish to run an update. Press any key to continue. Next, run the "decompile.bat" file. When completed, press any key to continue / close window." Thoughts? -
Errors in Eclipse Workshop, where did I go wrong?
Javada replied to Javada's topic in Modder Support
No. The instructions said to create a new folder and extract the MCP there. It is not in the Forge folder. Should I move it there or delete it? -
Errors in Eclipse Workshop, where did I go wrong?
Javada replied to Javada's topic in Modder Support
I'll give you the run down. First I downloaded and installed the latest JDK for 64 bit Windows, which I have. I added the address to the JDK bin to my environment variables path. I downloaded Eclipse and extracted it in a new folder in my My Documents folder. I then created a new folder for Forge on my desk top and extracted the latest Forge into it. I ran the prompt you mentioned and placed the address to the eclipse folder into that new folder into Eclipse's workspace prompt. Long before all of this, though, I had downloaded the latest Minecraft Coder Pack and run the two .bat files mentioned in the Mods/Creating Mods Tutorial (link to which posted earlier). I had been told to follow the instructions found there by a friend who mods Minecraft and Skyrim. Running Eclipse after following those instructions, however, revealed most of the necessary folders and files missing. It was then that I noticed the note on the webpage that said the instructions were no longer valid for the current version of Minecraft.