Posted December 27, 201410 yr So for my mod I want to remove the item form the players inventory with onItemRightClick() but whenever I try this the game crashes. I have looked all over the internet and in the minecraftForge classes to find out how to do this but everything I try dosent work, here is the code for the method: @Override public ItemStack onItemRightClick(ItemStack stack, World world, EntityPlayer player) { if(stack.getItemDamage()==2 && this.getResearch()!=null && player.getEntityData().getTag(this.getResearch())==null) { PlayerResearch.addResearch(player, this.getResearch()); stack.stackSize--; } return stack; } Any help would be appreciated
December 27, 201410 yr Crash report please. I'm sure it crashes not on stack.stacksize--; Check out my mods: BTAM Armor sets Avoid Exploding Creepers Tools compressor Anti Id Conflict Key bindings overhaul Colourfull blocks Invisi Zones
December 27, 201410 yr Author Managed to solve the problem, it was actually being caused by the NBTTagCompound not being declared properly, DERP!
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.