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.

[1.8]How you create a mouse event to use leftclick in custom actions ?? <SOLVED>

Featured Replies

Posted

good days

 

i wanna use left click to make somethink whith a custome item a sort of

onItemRightClick() but  onItemLeftClick() version

 

time ago someone tell that a must create a custom event thath time  i tink wass done whit a KeyInputHandler class

and let it for later

and now i realize thath nop dont works this way 

 

package mercenarymod.utilidades;

import org.lwjgl.input.Mouse;

import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
import net.minecraftforge.fml.common.gameevent.InputEvent;
import mercenarymod.utilidades.gearbox;

public class KeyInputHandler {

    @SubscribeEvent
    public void onKeyInput(InputEvent.KeyInputEvent event) {
       
    	if(KeyBindings.gearup.isPressed()){
            System.out.println("gearUp");
            gearbox.up();}
            
        if(KeyBindings.geardown.isPressed()){
            System.out.println("geardown");
        	gearbox.down();}
       
        
        if(KeyBindings.extraer.isPressed()){
            System.out.println("extraer");
        	//todavia nu se que hacer con el pero nesesita world and entityplayer ;
                                           }
        
        if (Mouse.isButtonDown(0)){System.out.println("Botton Zero");}
        
        if (Mouse.isButtonDown(1)){System.out.println("Botton Uno");}
        
        if (Mouse.isButtonDown(2)){System.out.println("Botton Dos");}
        
        
    }

}

 

well i get stuck  an have no idea of wtha i m doing

 

how do you make a custom event trigger by left click ??

  • Author

 

is so easy that i get embarrased

 

 

public boolean onEntitySwing(EntityLivingBase entityLiving, ItemStack stack)
    {

	World worldIn=entityLiving.getEntityWorld();
	EntityPlayer playerIn=(EntityPlayer) entityLiving;

	System.out.println("SWING"+"entityLiving="+entityLiving.getName()+"\n Mundo="+worldIn.isRemote+"\n playerIn="+playerIn.getName());


        return false;
    }

 

[19:30:40] [Client thread/INFO] [sTDOUT]:

SWINGentityLiving=Player380

Mundo=true

playerIn=Player380

[19:30:40] [server thread/INFO] [sTDOUT]:

SWINGentityLiving=Player380

Mundo=false

playerIn=Player380

[19:30:43] [Client thread/INFO] [sTDOUT]:

SWINGentityLiving=Player380

Mundo=true

playerIn=Player380

[19:30:43] [server thread/INFO] [sTDOUT]:

SWINGentityLiving=Player380

Mundo=false

playerIn=Player380

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.