Jump to content

NullPointerException on onItemRightClick


Novârch

Recommended Posts

I get a NullPointerException on my method onItemRightClick. Apparently 'props' is null, but I don't know why.

 

/*    public ActionResult<ItemStack> onItemRightClick(final World worldIn, final EntityPlayer playerIn, final EnumHand handIn) {
        final ItemStack stack = playerIn.getHeldItem(handIn);
        final IJojoBAdvPlayerCap props = (IJojoBAdvPlayerCap)playerIn.getCapability((Capability)JojoBAdvProvider.JOJO_CAP, (EnumFacing)EnumFacing.NORTH);
        if (stack == null) {            
            return (ActionResult<ItemStack>)new ActionResult(EnumActionResult.FAIL, (Object)stack);
        }
        if (props.getStandID() == 0) {
            playerIn.setActiveHand(handIn);
            return (ActionResult<ItemStack>)new ActionResult(EnumActionResult.SUCCESS, (Object)stack);
        }
        playerIn.sendMessage((ITextComponent)new TextComponentTranslation("msg.jojomod.standalready.txt", new Object[0]));
        return (ActionResult<ItemStack>)new ActionResult(EnumActionResult.PASS, (Object)stack);
    }

*/    

It's sad how much time mods spend saying "x is no longer supported on this forum. Please update to a modern version of Minecraft to receive support".

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.

Announcements



×
×
  • Create New...

Important Information

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