Posted January 2, 201510 yr 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 ??
January 3, 201510 yr 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.