Posted November 19, 201212 yr Hello. Here is the code. package spmod.tools.src.core; import java.util.HashSet; import org.lwjgl.input.Mouse; import org.lwjgl.input.Controllers; import net.minecraft.client.Minecraft; import net.minecraft.src.*; public class SpmodMouseReader { public static boolean isMining = false; private void clickMouse(int par1, Material par2) { if(par1 == 0) { if(par2 != null) { isMining = true; } } } and here is the tool: package spmod.tools.src.items.basic; import net.minecraft.src.*; import net.minecraft.src.forge.*; import spmod.tools.src.core.SpmodMouseReader; public class ItemTestPickaxe extends Item implements ITextureProvider { public static boolean isMining = false; private int damageTool = 0; private int minMining = 0; public ItemTestPickaxe(int id) { super(id); setMaxDamage(10); } @Override public String getTextureFile() { return "/gui/items.png"; } public int getIconIndex() { return 200; } public String getItemDisplayName(ItemStack par1) { return "Lol"; } public void onUpdate(ItemStack par1, World par2World, Entity par3, int par4, boolean par5) { EntityPlayer par6 = null; if(isMining == true) { damageTool = damageTool + 1; minMining = minMining + 1; } if(isMining == false && minMining > 0 && minMining < 3) { par1.damageItem(1, par6); minMining = 0; } if(isMining == false && minMining >= 3) { minMining = 0; } if(isMining == true && damageTool >= { par1.damageItem(1, par6); damageTool = 0; } } } how can i make it that the boolean will be on both sides true if its mining.
November 20, 201212 yr Item's are not unique, they are static duplicates. you can not have an item unique variable. These items ARE contained within item stacks however, which are unique to one another tho.
November 26, 201212 yr Author Ok but how can i solve my problem when he is hitting a block that the boolean goes to true?
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.