Everything posted by Ablaze
-
Custom tree generation problems
Hey! I'm trying to generate my custom tree. But I keep getting an error. Here are my files:- Main Class - Tutorial.java BlockArkmanditeLog.java BlockArkmanditeLeaf.java BlockArkmanditeSapling.java ColorizeLeaves.java EventManager.java ArkmanditeWorldGenTrees.java Stack Trace (there was more above this, but my console didn't hold all of it..) Please help me if you can. Regards, Ablaze.
-
Live tutor
Hello there! My name is Ablaze. I started modding a week ago and I'm loving it. But I'm having too many, lets say, "doubts", or "how-to-do-this" things. So I would like a live tutor(am I going to receive great criticism about this? Hope not.) who is mostly free and has a Skype so he can teach me about new things. I like to learn. Anyways hopefully you will consider this, and help me out. Please don't shout - "GO FREAKING WATCH SOME TUTORIALS!" or "NO ONE HAS TIME TO TEACH YOU PERSONALLY!!!!" . If you can't, just move on. If you can, please do. Regards, Ablaze.
-
Modding error: State engine forced into a different state
Hello everyone! My name is Ablaze. I was impressed by the forum with my last topic. I had 4 replies by the next day of the OP. Anyways, here is my newest problem. I got into modding 3-4 days back. I don't mind if I have a coding error; in the sense a problem in the code. I will Google as much as possible, and rack my brains to figure it out. But this one is a real bad one. It isn't an error. When I run Minecraft through eclipse, this is the log i get:- Aug 28, 2013 10:04:37 PM net.minecraft.launchwrapper.LogWrapper log INFO: Using tweak class name cpw.mods.fml.common.launcher.FMLTweaker 2013-08-28 22:04:39 [iNFO] [ForgeModLoader] Forge Mod Loader version 6.2.55.842 for Minecraft 1.6.2 loading 2013-08-28 22:04:39 [iNFO] [ForgeModLoader] Java is Java HotSpot(TM) 64-Bit Server VM, version 1.7.0_21, running on Windows 7:amd64:6.1, installed at C:\Program Files\Java\jdk1.7.0_21\jre 2013-08-28 22:04:39 [iNFO] [ForgeModLoader] Managed to load a deobfuscated Minecraft name- we are in a deobfuscated environment. Skipping runtime deobfuscation 2013-08-28 22:04:41 [iNFO] [sTDOUT] Loaded 39 rules from AccessTransformer config file fml_at.cfg 2013-08-28 22:04:42 [iNFO] [sTDOUT] Loaded 107 rules from AccessTransformer config file forge_at.cfg 2013-08-28 22:04:44 [sEVERE] [ForgeModLoader] The binary patch set is missing. Either you are in a development environment, or things are not going to work! 2013-08-28 22:04:46 [iNFO] [ForgeModLoader] Launching wrapped minecraft 2013-08-28 22:04:56 [iNFO] [Minecraft-Client] Setting user: Player505 2013-08-28 22:04:56 [iNFO] [Minecraft-Client] (Session ID is null) 2013-08-28 22:05:08 [iNFO] [Minecraft-Client] LWJGL Version: 2.9.0 2013-08-28 22:05:13 [iNFO] [Minecraft-Client] Reloading ResourceManager: Default 2013-08-28 22:05:15 [iNFO] [sTDOUT] 2013-08-28 22:05:15 [iNFO] [sTDOUT] Starting up SoundSystem... 2013-08-28 22:05:15 [iNFO] [sTDOUT] Initializing LWJGL OpenAL 2013-08-28 22:05:15 [iNFO] [sTDOUT] (The LWJGL binding of OpenAL. For more information, see http://www.lwjgl.org) 2013-08-28 22:05:19 [iNFO] [MinecraftForge] Attempting early MinecraftForge initialization 2013-08-28 22:05:19 [iNFO] [sTDOUT] MinecraftForge v9.10.0.842 Initialized 2013-08-28 22:05:19 [iNFO] [ForgeModLoader] MinecraftForge v9.10.0.842 Initialized 2013-08-28 22:05:22 [iNFO] [sTDOUT] Replaced 101 ore recipies 2013-08-28 22:05:23 [iNFO] [MinecraftForge] Completed early MinecraftForge initialization 2013-08-28 22:05:24 [iNFO] [ForgeModLoader] Reading custom logging properties from C:\Users\********\Desktop\forge\mcp\jars\config\logging.properties 2013-08-28 22:05:24 [OFF] [ForgeModLoader] Logging level for ForgeModLoader logging is set to ALL 2013-08-28 22:05:26 [iNFO] [ForgeModLoader] Searching C:\Users\********\Desktop\forge\mcp\jars\mods for mods 2013-08-28 22:05:26 [iNFO] [sTDOUT] OpenAL initialized. 2013-08-28 22:05:26 [iNFO] [sTDOUT] 2013-08-28 22:06:20 [iNFO] [ForgeModLoader] Forge Mod Loader has identified 4 mods to load 2013-08-28 22:06:20 [iNFO] [mcp] Activating mod mcp 2013-08-28 22:06:20 [iNFO] [FML] Activating mod FML 2013-08-28 22:06:20 [iNFO] [Forge] Activating mod Forge 2013-08-28 22:06:20 [iNFO] [AblazeTheBest_TutorialMod] Activating mod AblazeTheBest_TutorialMod 2013-08-28 22:06:20 [WARNING] [Tutorial Mod] Mod Tutorial Mod is missing a pack.mcmeta file, things may not work well 2013-08-28 22:06:20 [iNFO] [Minecraft-Client] Reloading ResourceManager: Default, FMLFileResourcePack:Tutorial Mod 2013-08-28 22:06:21 [iNFO] [sTDOUT] 2013-08-28 22:06:21 [iNFO] [sTDOUT] SoundSystem shutting down... 2013-08-28 22:06:21 [iNFO] [sTDOUT] Author: Paul Lamb, www.paulscode.com 2013-08-28 22:06:21 [iNFO] [sTDOUT] 2013-08-28 22:06:21 [iNFO] [sTDOUT] 2013-08-28 22:06:21 [iNFO] [sTDOUT] Starting up SoundSystem... 2013-08-28 22:06:21 [iNFO] [sTDOUT] Initializing LWJGL OpenAL 2013-08-28 22:06:21 [iNFO] [sTDOUT] (The LWJGL binding of OpenAL. For more information, see http://www.lwjgl.org) 2013-08-28 22:06:21 [iNFO] [ForgeModLoader] Registering Forge Packet Handler 2013-08-28 22:06:22 [iNFO] [ForgeModLoader] Succeeded registering Forge Packet Handler 2013-08-28 22:06:22 [iNFO] [sTDOUT] OpenAL initialized. 2013-08-28 22:06:22 [iNFO] [sTDOUT] 2013-08-28 22:06:22 [iNFO] [ForgeModLoader] Configured a dormant chunk cache size of 0 2013-08-28 22:06:34 [iNFO] [ForgeModLoader] Forge Mod Loader has successfully loaded 4 mods 2013-08-28 22:06:34 [WARNING] [Tutorial Mod] Mod Tutorial Mod is missing a pack.mcmeta file, things may not work well 2013-08-28 22:06:34 [iNFO] [Minecraft-Client] Reloading ResourceManager: Default, FMLFileResourcePack:Tutorial Mod 2013-08-28 22:06:35 [iNFO] [sTDOUT] 2013-08-28 22:06:35 [iNFO] [sTDOUT] SoundSystem shutting down... 2013-08-28 22:06:36 [iNFO] [sTDOUT] Author: Paul Lamb, www.paulscode.com 2013-08-28 22:06:36 [iNFO] [sTDOUT] 2013-08-28 22:06:36 [iNFO] [sTDOUT] 2013-08-28 22:06:36 [iNFO] [sTDOUT] Starting up SoundSystem... 2013-08-28 22:06:36 [iNFO] [sTDOUT] Initializing LWJGL OpenAL 2013-08-28 22:06:36 [iNFO] [sTDOUT] (The LWJGL binding of OpenAL. For more information, see http://www.lwjgl.org) 2013-08-28 22:06:36 [iNFO] [sTDOUT] OpenAL initialized. 2013-08-28 22:06:36 [iNFO] [sTDOUT] 2013-08-28 22:07:06 [sEVERE] [Minecraft-Client] Realms: Invalid session id 2013-08-28 22:07:07 [iNFO] [Minecraft-Server] Starting integrated minecraft server version 1.6.2 2013-08-28 22:07:07 [iNFO] [Minecraft-Server] Generating keypair 2013-08-28 22:07:13 [iNFO] [ForgeModLoader] Loading dimension 0 (New World) (net.minecraft.server.integrated.IntegratedServer@60d0e35f) 2013-08-28 22:07:14 [iNFO] [ForgeModLoader] Loading dimension 1 (New World) (net.minecraft.server.integrated.IntegratedServer@60d0e35f) 2013-08-28 22:07:15 [iNFO] [ForgeModLoader] Loading dimension -1 (New World) (net.minecraft.server.integrated.IntegratedServer@60d0e35f) 2013-08-28 22:07:15 [iNFO] [Minecraft-Server] Preparing start region for level 0 2013-08-28 22:07:16 [iNFO] [sTDERR] java.lang.IllegalArgumentException: n must be positive 2013-08-28 22:07:16 [iNFO] [sTDERR] at java.util.Random.nextInt(Random.java:300) 2013-08-28 22:07:16 [iNFO] [sTDERR] at tutorial.EventManager.addOreSpawn(EventManager.java:57) 2013-08-28 22:07:16 [iNFO] [sTDERR] at tutorial.EventManager.generateSurface(EventManager.java:24) 2013-08-28 22:07:16 [iNFO] [sTDERR] at tutorial.EventManager.generate(EventManager.java:18) 2013-08-28 22:07:16 [iNFO] [sTDERR] at cpw.mods.fml.common.registry.GameRegistry.generateWorld(GameRegistry.java:103) 2013-08-28 22:07:16 [iNFO] [sTDERR] at net.minecraft.world.gen.ChunkProviderServer.populate(ChunkProviderServer.java:259) 2013-08-28 22:07:16 [iNFO] [sTDERR] at net.minecraft.world.chunk.Chunk.populateChunk(Chunk.java:1249) 2013-08-28 22:07:16 [iNFO] [sTDERR] at net.minecraft.world.gen.ChunkProviderServer.loadChunk(ChunkProviderServer.java:153) 2013-08-28 22:07:16 [iNFO] [sTDERR] at net.minecraft.server.MinecraftServer.initialWorldChunkLoad(MinecraftServer.java:292) 2013-08-28 22:07:16 [iNFO] [sTDERR] at net.minecraft.server.integrated.IntegratedServer.loadAllWorlds(IntegratedServer.java:90) 2013-08-28 22:07:16 [iNFO] [sTDERR] at net.minecraft.server.integrated.IntegratedServer.startServer(IntegratedServer.java:107) 2013-08-28 22:07:16 [iNFO] [sTDERR] at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:443) 2013-08-28 22:07:16 [iNFO] [sTDERR] at net.minecraft.server.ThreadMinecraftServer.run(ThreadMinecraftServer.java:16) 2013-08-28 22:07:16 [sEVERE] [Minecraft-Server] Encountered an unexpected exception IllegalArgumentException java.lang.IllegalArgumentException: n must be positive at java.util.Random.nextInt(Random.java:300) at tutorial.EventManager.addOreSpawn(EventManager.java:57) at tutorial.EventManager.generateSurface(EventManager.java:24) at tutorial.EventManager.generate(EventManager.java:18) at cpw.mods.fml.common.registry.GameRegistry.generateWorld(GameRegistry.java:103) at net.minecraft.world.gen.ChunkProviderServer.populate(ChunkProviderServer.java:259) at net.minecraft.world.chunk.Chunk.populateChunk(Chunk.java:1249) at net.minecraft.world.gen.ChunkProviderServer.loadChunk(ChunkProviderServer.java:153) at net.minecraft.server.MinecraftServer.initialWorldChunkLoad(MinecraftServer.java:292) at net.minecraft.server.integrated.IntegratedServer.loadAllWorlds(IntegratedServer.java:90) at net.minecraft.server.integrated.IntegratedServer.startServer(IntegratedServer.java:107) at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:443) at net.minecraft.server.ThreadMinecraftServer.run(ThreadMinecraftServer.java:16) 2013-08-28 22:07:16 [sEVERE] [Minecraft-Server] This crash report has been saved to: C:\Users\Eehit\Desktop\forge\mcp\jars\.\crash-reports\crash-2013-08-28_22.07.16-server.txt 2013-08-28 22:07:16 [iNFO] [Minecraft-Server] Stopping server 2013-08-28 22:07:16 [iNFO] [Minecraft-Server] Saving players 2013-08-28 22:07:16 [iNFO] [Minecraft-Server] Saving worlds 2013-08-28 22:07:16 [iNFO] [Minecraft-Server] Saving chunks for level 'New World'/Overworld 2013-08-28 22:07:17 [iNFO] [Minecraft-Server] Saving chunks for level 'New World'/Nether 2013-08-28 22:07:17 [iNFO] [Minecraft-Server] Saving chunks for level 'New World'/The End 2013-08-28 22:07:17 [iNFO] [ForgeModLoader] Unloading dimension 0 2013-08-28 22:07:17 [iNFO] [ForgeModLoader] Unloading dimension -1 2013-08-28 22:07:17 [iNFO] [ForgeModLoader] Unloading dimension 1 2013-08-28 22:07:17 [iNFO] [ForgeModLoader] The state engine was in incorrect state SERVER_STARTING and forced into state SERVER_STOPPED. Errors may have been discarded. See the last line? I.E. - The state engine was in incorrect state SERVER_STARTING and forced into state SERVER_STOPPED. Errors may have been discarded. Here is all my code :- Tutorial.java package tutorial; import net.minecraft.block.Block; import net.minecraft.block.material.Material; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.item.crafting.FurnaceRecipes; import net.minecraft.potion.Potion; import cpw.mods.fml.common.Mod; import cpw.mods.fml.common.Mod.EventHandler; 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; @Mod(modid = Tutorial.modid, name = "Tutorial Mod", version = "1.0") @NetworkMod(clientSideRequired = true, serverSideRequired = false) public class Tutorial { public static final String modid = "AblazeTheBest_TutorialMod"; public static Block fieryIndestuctibleBlock; public static Block arkmanditeOre; public static Item fieryFood; public static Item arkmanditeIngot; EventManager eventmanager = new EventManager(); @EventHandler public void load(FMLInitializationEvent event) { fieryIndestuctibleBlock = new BlockTutorialBlock(500, Material.rock).setUnlocalizedName("fieryIndestuctibleBlock"); GameRegistry.registerBlock(fieryIndestuctibleBlock, modid + fieryIndestuctibleBlock.getUnlocalizedName().substring(5)); LanguageRegistry.addName(fieryIndestuctibleBlock, "Fiery Indestructible Block"); arkmanditeOre = new BlockArkmanditeOre(501, Material.rock).setUnlocalizedName("arkmanditeOre"); GameRegistry.registerBlock(arkmanditeOre, modid + arkmanditeOre.getUnlocalizedName().substring(5)); LanguageRegistry.addName(arkmanditeOre, "Arkmandite Ore"); arkmanditeIngot = new ItemArkmanditeIngot(5001).setUnlocalizedName("arkmanditeIngot"); GameRegistry.registerItem(arkmanditeIngot, modid + arkmanditeIngot.getUnlocalizedName().substring(5)); fieryFood = new ItemTutorial(5000, 3, 12.0f, false).setPotionEffect(Potion.fireResistance.id, 5, 0, 0.9f); fieryFood.setUnlocalizedName("fieryFood"); GameRegistry.registerItem(fieryFood, modid + fieryFood.getUnlocalizedName().substring(5)); LanguageRegistry.addName(fieryFood, "Fiery Food"); GameRegistry.registerWorldGenerator(eventmanager); TutorialCrafting.loadRecipes(); } } BlockTutorialBlock.java:- package tutorial; import net.minecraft.block.Block; import net.minecraft.block.material.Material; import net.minecraft.client.renderer.texture.IconRegister; import net.minecraft.creativetab.CreativeTabs; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; public class BlockTutorialBlock extends Block{ public BlockTutorialBlock(int id, Material material) { super(id, material); this.setCreativeTab(CreativeTabs.tabBlock); this.setHardness(2.0f); this.setResistance(18000000.0f); } @SideOnly(Side.CLIENT) public void registerIcons(IconRegister par1IconRegister) { this.blockIcon = par1IconRegister.registerIcon(Tutorial.modid + ":" + (this.getUnlocalizedName().substring(5))); } } ItemTutorial.java:- package tutorial; import net.minecraft.client.renderer.texture.IconRegister; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.item.ItemFood; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; public class ItemTutorial extends ItemFood{ public ItemTutorial(int id, int hunger, float saturation, boolean wolfFood) { super(id, hunger, saturation, wolfFood); this.setCreativeTab(CreativeTabs.tabFood); } @SideOnly(Side.CLIENT) public void registerIcons(IconRegister par1IconRegister) { this.itemIcon = par1IconRegister.registerIcon(Tutorial.modid + ":" + (this.getUnlocalizedName().substring(5))); } } TutorialCrafting.java:- package tutorial; import net.minecraft.block.Block; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.item.crafting.FurnaceRecipes; import cpw.mods.fml.common.registry.GameRegistry; public class TutorialCrafting { public static void loadRecipes() { GameRegistry.addRecipe(new ItemStack(Tutorial.fieryFood, 3), new Object[]{ "CXC", " C ", 'C', Block.obsidian, 'X', Item.blazePowder }); FurnaceRecipes.smelting().addSmelting(Tutorial.fieryIndestuctibleBlock.blockID, new ItemStack(Tutorial.fieryFood), 0.5f); } } EventManager.java:- package tutorial; import java.util.Random; import net.minecraft.block.Block; import net.minecraft.world.World; import net.minecraft.world.chunk.IChunkProvider; import net.minecraft.world.gen.feature.WorldGenMinable; import cpw.mods.fml.common.IWorldGenerator; public class EventManager implements IWorldGenerator{ @Override public void generate(Random random, int chunkX, int chunkZ, World world, IChunkProvider chunkGenerator, IChunkProvider chunkProvider) { switch(world.provider.dimensionId) { case 0: generateSurface(world, random, chunkX * 16, chunkZ * 16); } } private void generateSurface(World world, Random random, int x, int z) { this.addOreSpawn(Tutorial.arkmanditeOre, world, random, x, z, 16, 16, 2 + random.nextInt(3), 6, 40, 20); } /** * Adds an Ore Spawn to Minecraft. Simply register all Ores to spawn with this method in your Generation method in your IWorldGeneration extending Class * * @param The Block to spawn * @param The World to spawn in * @param A Random object for retrieving random positions within the world to spawn the Block * @param An int for passing the X-Coordinate for the Generation method * @param An int for passing the Z-Coordinate for the Generation method * @param An int for setting the maximum X-Coordinate values for spawning on the X-Axis on a Per-Chunk basis * @param An int for setting the maximum Z-Coordinate values for spawning on the Z-Axis on a Per-Chunk basis * @param An int for setting the maximum size of a vein * @param An int for the Number of chances available for the Block to spawn per-chunk * @param An int for the minimum Y-Coordinate height at which this block may spawn * @param An int for the maximum Y-Coordinate height at which this block may spawn **/ public void addOreSpawn(Block block, World world, Random random, int blockXPos, int blockZPos, int maxX, int maxZ, int maxVeinSize, int chancesToSpawn, int minY, int maxY) { int maxPossY = minY + (maxY - 1); assert maxY > minY: "The maximum Y must be greater than the Minimum Y"; assert maxX > 0 && maxX <= 16: "addOreSpawn: The Maximum X must be greater than 0 and less than 16"; assert minY > 0: "addOreSpawn: The Minimum Y must be greater than 0"; assert maxY < 256 && maxY > 0: "addOreSpawn: The Maximum Y must be less than 256 but greater than 0"; assert maxZ > 0 && maxZ <= 16: "addOreSpawn: The Maximum Z must be greater than 0 and less than 16"; int diffBtwnMinMaxY = maxY - minY; for(int x = 0; x < chancesToSpawn; x++) { int posX = blockXPos + random.nextInt(maxX); int posY = minY + random.nextInt(diffBtwnMinMaxY); int posZ = blockZPos + random.nextInt(maxZ); (new WorldGenMinable(block.blockID, maxVeinSize)).generate(world, random, posX, posY, posZ); } } } BlockArkmanditeOre.java:- package tutorial; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; 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 BlockArkmanditeOre extends Block{ public BlockArkmanditeOre(int id, Material material) { super(id, material); this.setCreativeTab(CreativeTabs.tabBlock); this.setHardness(6.0F); this.setResistance(5.0F); } @SideOnly(Side.CLIENT) public void registerIcons(IconRegister par1IconRegister) { this.blockIcon = par1IconRegister.registerIcon(Tutorial.modid + ":" + (this.getUnlocalizedName().substring(5))); } } ItemArkmanditeIngot.java:- package tutorial; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import net.minecraft.client.renderer.texture.IconRegister; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.item.Item; public class ItemArkmanditeIngot extends Item{ public ItemArkmanditeIngot(int id) { super(id); this.setCreativeTab(CreativeTabs.tabMaterials); } @SideOnly(Side.CLIENT) public void registerIcons(IconRegister par1IconRegister) { this.itemIcon = par1IconRegister.registerIcon(Tutorial.modid + ":" + (this.getUnlocalizedName().substring(5))); } } Please help me and reply if you can. Thanking you, Yours sincerely, Ablaze.
-
Adding a potion effect
Thanks a lot for the quick reply guys! I solved the problem on my own. This was the problem- there is a setPotionEffect method in the Item class. That one uses a string. There is a setPotionEffect method in the ItemFood class, which uses int, int, int float. I was trying to use the latter, but java for some reason was using the former. This is how I fixed the code, for anyone else having the same problem, for later reference. fieryFood = new ItemTutorial(5000, 3, 12.0f, false).setPotionEffect(Potion.fireResistance.id, 5, 0, 0.9f); fieryFood.setUnlocalizedName("fieryFood"); Thanks a lot, Ablaze. P.S. Locking the topic.
-
Adding a potion effect
Hello! My name is Ablaze. I'm relatively new to Forge modding, but I'm doing my best. I want to add a potion effect to a food item. If it helps, I follow Wuppy29's tutorials. Here is my Tutorial.java package tutorial; import net.minecraft.block.Block; import net.minecraft.block.material.Material; import net.minecraft.item.Item; import net.minecraft.potion.Potion; import cpw.mods.fml.common.Mod; import cpw.mods.fml.common.Mod.EventHandler; 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; @Mod(modid = Tutorial.modid, name = "Tutorial Mod", version = "1.0") @NetworkMod(clientSideRequired = true, serverSideRequired = false) public class Tutorial { public static final String modid = "AblazeTheBest_TutorialMod"; public static Block fieryIndestuctibleBlock; public static Item fieryFood; @EventHandler public void load(FMLInitializationEvent event) { fieryIndestuctibleBlock = new BlockTutorialBlock(500, Material.rock).setUnlocalizedName("fieryIndestuctibleBlock"); GameRegistry.registerBlock(fieryIndestuctibleBlock, modid + fieryIndestuctibleBlock.getUnlocalizedName().substring(5)); LanguageRegistry.addName(fieryIndestuctibleBlock, "Fiery Indestructible Block"); fieryFood = new ItemTutorial(5000, 3, 12.0f, false).setUnlocalizedName("fieryFood").setPotionEffect(Potion.fireResistance, 30, 0, 1.0F); GameRegistry.registerItem(fieryFood, modid + fieryFood.getUnlocalizedName().substring(5)); LanguageRegistry.addName(fieryFood, "Fiery Food"); } } This is the line with the error:- fieryFood = new ItemTutorial(5000, 3, 12.0f, false).setUnlocalizedName("fieryFood").setPotionEffect(Potion.fireResistance, 30, 0, 1.0F); The error is:- The method setPotionEffect(String) in the type Item is not applicable for the arguments (Potion, int, int, float) BlockTutorialBlock.java:- package tutorial; import net.minecraft.block.Block; import net.minecraft.block.material.Material; import net.minecraft.client.renderer.texture.IconRegister; import net.minecraft.creativetab.CreativeTabs; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; public class BlockTutorialBlock extends Block{ public BlockTutorialBlock(int id, Material material) { super(id, material); this.setCreativeTab(CreativeTabs.tabBlock); this.setHardness(2.0f); this.setResistance(18000000.0f); } @SideOnly(Side.CLIENT) public void registerIcons(IconRegister par1IconRegister) { this.blockIcon = par1IconRegister.registerIcon(Tutorial.modid + ":" + (this.getUnlocalizedName().substring(5))); } } ItemTutorial.java:- package tutorial; import net.minecraft.client.renderer.texture.IconRegister; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.item.ItemFood; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; public class ItemTutorial extends ItemFood{ public ItemTutorial(int id, int hunger, float saturation, boolean wolfFood) { super(id, hunger, saturation, wolfFood); this.setCreativeTab(CreativeTabs.tabFood); } @SideOnly(Side.CLIENT) public void registerIcons(IconRegister par1IconRegister) { this.itemIcon = par1IconRegister.registerIcon(Tutorial.modid + ":" + (this.getUnlocalizedName().substring(5))); } } What I want it to do:Add Fire Resistance to the item Fiery Food. What it is doing:Giving an error saying The method setPotionEffect(String) in the type Item is not applicable for the arguments (Potion, int, int, float) Please reply. Regards, Ablaze.
IPS spam blocked by CleanTalk.