Posted January 30, 201510 yr I cant seem to get this to work package com.linumhost.Items; import com.linumhost.Blocks.Blocks; import net.minecraft.block.Block; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.world.World; public class Wrench extends Item{ private static Block[] canWrench = new Block[1]; public static void populateArray(){ canWrench[0] = Blocks.conduit; } public boolean onItemUse(ItemStack item, EntityPlayer player, World world, int posx, int posy, int posz, int side, float x, float y, float z) { if(!world.isRemote) { for(int i = 0; i > canWrench.length; i++){ if(world.getBlock(posx, posy, posz) == canWrench[i]){ System.out.println(canWrench[i]); return true; } return false; } return false; } return false; } }
January 30, 201510 yr Author Solved, simple but yet impossible mistake to find turns out I was checking if "i > canWrench.length" when i should of checked if "i < canWrench.length"
January 30, 201510 yr Sorry, just a little side note, but here, we can't help you if you don't describe the issue or problem to us. And a worse case of that, as you put it: I cant seem to get this to work ^^^ That my friend is not telling us anything. We need a detailed description on the issue or at least a little more explanation or we can't do anything. On the other hand, Thank you for posting your code. That was wise of you. You don't know how many times people don't and it really is a struggle. -Mitchellbrine Minecraft can do ANYTHING, it's coded in Java and you got the full power of Java behind you when you code. So nothing is impossible. It may be freaking fucking hard though, but still possible If you create a topic on Modder Support, live by this motto: I don't want your charity, I want your information
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.