Jump to content

JakeZ1990

Members
  • Posts

    8
  • Joined

  • Last visited

Everything posted by JakeZ1990

  1. Awesome! Wasn't too hard to figure out, thanks a lot! I'm getting pretty excited to start making some of my own ideas
  2. Ah! Thanks a lot ^^ Quick question for you, however, if you don't mind. I'm a little confused by the export options for the eclipse software i'm coding in. You wouldn't happen to be able to tell me how to properly export the mod for installation into a Forge client would you?
  3. Being new to Minecraft modding, I've been following a tutorial series which seems to be relatively outdated now, so I've been running into some issues here and there. I've been able to solve some of the changes on my own but I'm stuck on this one. This person is using this Override code to set the direction a block is facing to the direction the player is facing: @Override public IBlockState onBlockPlaced(World worldIn, BlockPos pos, EnumFacing facing, float hitX, float hitY, float hitZ, int meta, EntityLivingBase placer) { return super.onBlockPlaced(worldIn, pos, facing, hitX, hitY, hitZ, meta, placer).withProperty(FACING, facing); } I know I'm not missing any imports, so it seems as though this method no longer exists? If that is the case, then how would I accomplish this now?
  4. Okay cool! Thanks a ton for the tip. Sorry for the late response, had to go to work. I'll be sure to mess around with that when I get the chance. I'm very happy you guys were all so kind to help me out so quickly. I'll definitely be coming here again if I hit another roadblock (Hopefully with decreasing frequency, I've been pretty proud of my learning capabilities in the past, lol)
  5. Ohh! Yea, I knew they were different types. I was just being a dummy and forgot to check getHeldItem() for more sub-methods. So It's actually succeeding the If statement now, and placing crackers in the jar, which I can then take out, however, there is one last issue in my snippet. int count = playerIn.getHeldItem(hand).getCount(); playerIn.getHeldItem(hand).setCount(count--); return true; For some reason, this section here is not decreasing the player's stack by 1. [EDIT] Actually just fixed it by doing this instead: playerIn.getHeldItem(hand).setCount(playerIn.getHeldItem(hand).getCount() - 1); return true; Although, if you don't mind, do you know why using the int like I was wasn't working?
  6. Okay, I get what you're saying, so I found a method I believe will do what I want: if(playerIn.getHeldItem(hand) == (ModItems.cracker)) However, my issue now is that it's telling me Item and ItemStack are incompatible operand types.
  7. I attempted your modification, however it still fails the check. I'm not quite sure how I'd utilize your information? As I said, I'm strictly following tutorials at this point, I'm not very familiar with MDKs code base at all.
  8. I'm new to the forum, so just putting this out here, I have experience with Java (and other similar languages), however I'm very new to modding Minecraft, so much so I'm still largely following any tutorials I can find. However I've hit a block, and I can't seem to figure this out. I'm just trying to get what the player is holding upon right-clicking a block, and then doing something if that item the player is holding matches a specific item. Here's the method I'm working with as it is now: @Override public boolean onBlockActivated(World worldIn, BlockPos pos, IBlockState state, EntityPlayer playerIn, EnumHand hand, EnumFacing facing, float hitX, float hitY, float hitZ) { if(!worldIn.isRemote) { TileEntity tileEntity = worldIn.getTileEntity(pos); if(tileEntity instanceof TileEntityJar) { TileEntityJar jar = (TileEntityJar) tileEntity; if(playerIn.getActiveItemStack() != null) { if(playerIn.getActiveItemStack() == new ItemStack(ModItems.cracker)) { if(jar.addCracker()) { int count = playerIn.getActiveItemStack().getCount(); playerIn.getActiveItemStack().setCount(count--); return true; } } } jar.removeCracker(); } } return true; } Alternatively, the tutorial I'm following originally was using this: @Override public boolean onBlockActivated(World worldIn, BlockPos pos, IBlockState state, EntityPlayer playerIn, EnumHand hand, EnumFacing facing, float hitX, float hitY, float hitZ) { if(!worldIn.isRemote) { TileEntity tileEntity = worldIn.getTileEntity(pos); if(tileEntity instanceof TileEntityJar) { TileEntityJar jar = (TileEntityJar) tileEntity; if(heldItem != null) { if(heldItem.getItem() == ModItems.cracker) { if(jar.addCracker()) { heldItem.stackSize--; return true; } } } jar.removeCracker(); } } return true; } the "heldItem" keyword was something this person put in and it just worked, but for me I only get an error and I can't find any possible thing I did wrong. I don't know if there's an import I'm missing or what. Some help would really be appreciated.
×
×
  • Create New...

Important Information

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