Posted September 20, 201411 yr Im trying to code in an item into my mod that when a player rightclicks it, then it brings up a GUI, yet i cant find the rightclick event... help would be much apreciated
September 20, 201411 yr You need to override the onItemRightClick(params) in your Item class. Don't PM me with questions. They will be ignored! Make a thread on the appropriate board for support. 1.12 -> 1.13 primer by williewillus. 1.7.10 and older versions of Minecraft are no longer supported due to it's age! Update to the latest version for support. http://www.howoldisminecraft1710.today/
September 20, 201411 yr Author Doing this just gives an error for the @Override saying it needs to be removed "@Override public void onItemRightClick(){ }"
September 20, 201411 yr Author Entire class is package com.iceminecrafter.MetalForgeCraft; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.world.World; public class MFCWaterTalisman extends Item{ @Override public void onItemRightClick(){ } }
September 20, 201411 yr Well, your method signature doesn't equal the method signature from the Item class. Go into the Item class, search for onItemRightClick and copy the method. Make sure you rename the parameters to something readable! Don't PM me with questions. They will be ignored! Make a thread on the appropriate board for support. 1.12 -> 1.13 primer by williewillus. 1.7.10 and older versions of Minecraft are no longer supported due to it's age! Update to the latest version for support. http://www.howoldisminecraft1710.today/
September 20, 201411 yr Author @Override public ItemStack onItemRightClick(ItemStack itemstack, World world, EntityPlayer player){ return ; } That works, yet how would I return a GUI?
September 20, 201411 yr player.openGui(params); Don't PM me with questions. They will be ignored! Make a thread on the appropriate board for support. 1.12 -> 1.13 primer by williewillus. 1.7.10 and older versions of Minecraft are no longer supported due to it's age! Update to the latest version for support. http://www.howoldisminecraft1710.today/
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.