Jump to content

Javada

Members
  • Posts

    21
  • Joined

  • Last visited

Everything posted by Javada

  1. 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?
  2. 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?
  3. 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.
  4. 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.
  5. 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?
  6. 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?
  7. 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
  8. a) I am trying to avoid destroying my computer ... again. I won't pester the forum. b) Thank you
  9. 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?
  10. 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
  11. 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.
  12. 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?
  13. 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?
  14. 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?
  15. 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.
  16. I fixed the Path and ran the prompt again. It took about 12 minutes but there were no errors. However, when I open Eclipse I get the following errors again: Description Resource Path Location Type The project was not built since its build path is incomplete. Cannot find the class file for java.lang.CharSequence. Fix the build path then try building this project Minecraft Unknown Java Problem Description Resource Path Location Type The type java.lang.CharSequence cannot be resolved. It is indirectly referenced from required .class files ExampleMod.java /Minecraft/src/main/java/com/example/examplemod line 1 Java Problem The errors appear to be attached to the Example Mod, however the src file only has one empty folder called main. Any thoughts?
  17. Easiest way to get it on the path is by adding a new environment variable, correct? Do I name it Path or Java_Home?
  18. Received error message "Failure: Build failed with an exception. Execution failed for tast ';makeStart'. A Problem occurred starting process 'command 'javac'' Any ideas? I am sorry I keep pestering you.
  19. This might be a silly question, but which Forge? The installer, the SCR or the Javadoc; because I have been told three different things from modder friends. And if I ran the installer previously to install mods, will that cause a problem when I run the command prompt? I know, silly questions, but (again) I have been told multiple things and I don't want to screw up my computer anymore than I probably have done all ready. Thank you, by the way.
  20. Initially I followed the Workshop setup instructions on the Minecraft Wiki found here -> http://minecraft.gamepedia.com/Mods/Creating_mods/Setting_up_the_MCP_workspace then saw the giant "Not valid with current game version" note at the top, so I followed Wuppy's Tutorial for 1.7 found on this site's wiki. I have the feeling I am going to have to uninstall everything and start over, aren't I?
  21. Good evening, Tried to set up a new workspace in Eclipse and I got the following two error messages. I searched for answers on the various Eclipse websites but the answers all involved Andriod, not Minecraft, so I figured I'd ask the Minecraft experts. First Error: The project was not built since its build path is incomplete. Cannot find the class file for java.lang.CharSequence. Fix the build path then try building this project Minecraft Second Error: The type java.lang.CharSequence cannot be resolved. It is indirectly referenced from required .class files I am using the latest Forge and I have Minecraft 1.7.10. If you need more information, just let me know what and I will provide it. ~Javada~
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.