Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Featured Replies

Posted

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 >= 8)

{

par1.damageItem(1, par6);

damageTool = 0;

}

}

}

 

 

 

 

how can i make it that the boolean will be on both sides true if its mining.

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.

  • 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.

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...

Important Information

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

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.