Jump to content

Help checking block


GodOfYeti

Recommended Posts

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;
}

}

Link to comment
Share on other sites

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
Link to comment
Share on other sites

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



×
×
  • Create New...

Important Information

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