Jump to content

Kamber56

Members
  • Posts

    11
  • Joined

  • Last visited

Converted

  • Gender
    Undisclosed
  • Personal Text
    I am new!

Kamber56's Achievements

Tree Puncher

Tree Puncher (2/8)

0

Reputation

  1. I'm trying to make my food apply multiple potion effects to the player, But it is only applying the first one? I read that there's an issue that causes it to only apply the potion effect if it's the first modifier, so Is there a way around it? public static Item Food = new Food(5011, 6, 0.8f, false).setPotionEffect(Potion.moveSlowdown.id, 2, 10, 100).setPotionEffect(Potion.hunger.id, 2, 10, 100).setCreativeTab(CreativeTabs.tabFood).setUnlocalizedName("Food").setTextureName(BasicInfo.NAME + ":Food");
  2. this.addOreSpawn(Basic.genericOre, world, random, x, z, 16, 16, 1+random.nextInt(2), 32, 10, 20); For this line, I want to make the number of chances available for the block to spawn per-chunk (currently 32) to be more rare than diamond basically. So does anyone know what value diamond has for this?
  3. I can't edit it right now as I'm on my iPad in bed; but ill be sure to do what you guys have suggested tomorrow, thanks!
  4. I haven't set it to drop anything else, So By default I'm guessing its dropping itself, which it does in-game. If that helps
  5. Can anyone point out why my ore Isn't dropping any XP? I'm clueless public void dropBlockAsItemWithChance(World world, int par2, int par3, int par4, int par5, float par6, int par7){ super.dropBlockAsItemWithChance(world, par2, par3, par4, par5, par6, par7); if (this.idDropped(par5, world.rand, par7) != this.blockID){ int xp = 0; xp = MathHelper.getRandomIntegerInRange(world.rand, 2, 75); this.dropXpOnBlockBreak(world, par2, par3, par4, xp);
  6. Picture to show my problem - http://d.pr/i/JXer I've made some leaves and I cant' figure out why it's causing this? It also makes the sound of stone when placing and walking on it, so I'm guessing the material is being set to material.stone, But I've definately set it to material.leaves? public final static Block genericLeaf = new GenericLeaf(502, Material.leaves).setCreativeTab(CreativeTabs.tabBlock).setTextureName("basic:genericLeaf").setLightOpacity(1000).setLightValue(1.0F).setUnlocalizedName("genericLeaf"); Leaf class: package kamber56.tutorial; 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 GenericLeaf extends Block { public GenericLeaf (int id, Material material) { super(id, material); } }
  7. I've got a similar problem now, I'm trying to make it so that my genericItem is made when I put 3 genericIngots in a line in the crafting bench. It comes up with no errors in eclipse but when I launch Minecraft it says : java.lang.ClassCastException: java.lang.Float cannot be cast to java.lang.Character 2014-02-13 17:28:22 [iNFO] [sTDOUT] at net.minecraft.item.crafting.CraftingManager.addRecipe(CraftingManager.java:187) 2014-02-13 17:28:22 [iNFO] [sTDOUT] at cpw.mods.fml.common.registry.GameRegistry.addShapedRecipe(GameRegistry.java:245) 2014-02-13 17:28:22 [iNFO] [sTDOUT] at cpw.mods.fml.common.registry.GameRegistry.addRecipe(GameRegistry.java:240) 2014-02-13 17:28:22 [iNFO] [sTDOUT] at kamber56.tutorial.Basic.load(Basic.java:80) Here is the code I'm using. And it's this line which is causing it as when I remove it it launches fine. GameRegistry.addRecipe(new ItemStack(genericItem, 1), " x ", " x ", " x ", 'x', new ItemStack(genericIngot, 1), 0.1F); (And yeah I sort of went straight into playing around with making a mod because it seemed a lot more fun than following 100 or so YouTube tutorials on learning Java fully ) [EDIT] Managed to fix it! I Just made the ItemStacks above it; separate from the GameRegistry.addrecipe ItemStack genericItemStack = new ItemStack(genericItem); ItemStack genericIngotStack = new ItemStack(genericIngot); GameRegistry.addRecipe(genericItemStack, " x ", " x ", " x ", 'x', genericIngotStack); It would be cool if someone could explain what I've done wrong and how that's fixed itself? [EDIT2] Managed to find out, It was the 0.1F making it crash
  8. Ah, thanks! I just assumed that it always had to have Block. In front of it. And I have no idea where I got 1.6.5 from :L
  9. This is my first time modding and I'm most probably doing something stupid, But I'm trying to make it so my custom ore is able to be smelted into my custom ingot, I'm following the tutorial on the wiki so it is 'genericOre' and 'genericIngot'. Usually you put GameRegistry.addSmelting(Block.dirt.blockID, diamondstack, 0.1f); But I have no idea how to put in my genericOre and genericIngot? This is the class file to my Generic Ingot and Generic Ore: package kamber56.tutorial; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.monster.EntityCreeper; import net.minecraft.entity.monster.EntityZombie; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; public class GenericItem extends Item { public GenericItem(int id) { super(id); setMaxStackSize(64); setCreativeTab(CreativeTabs.tabMisc); setUnlocalizedName("genericItem"); setTextureName(BasicInfo.NAME.toLowerCase() + ":genericItem"); } } package kamber56.tutorial; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.monster.EntityCreeper; import net.minecraft.entity.monster.EntityZombie; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; public class GenericIngot extends Item { public GenericIngot(int id) { super(id); setMaxStackSize(64); setCreativeTab(CreativeTabs.tabMaterials); setUnlocalizedName("genericIngot"); setTextureName("Basic:genericIngot"); } } I also have in the Load eventhandler this: GameRegistry.registerItem(genericItem, "genericItem"); LanguageRegistry.addName(genericItem, "Generic Item"); GameRegistry.registerBlock(genericOre, "genericOre"); LanguageRegistry.addName(genericOre, "Generic Ore"); MinecraftForge.setBlockHarvestLevel(genericOre, "pickaxe", 3); Any help would be appreciated! [Edit] A Pastebin link to the 3 classes http://pastebin.com/ZWc2LUkv
×
×
  • Create New...

Important Information

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