Jump to content

jco2641

Members
  • Posts

    4
  • Joined

  • Last visited

Converted

  • Gender
    Undisclosed
  • Personal Text
    I am new!

jco2641's Achievements

Tree Puncher

Tree Puncher (2/8)

0

Reputation

  1. A one character bugfix. Awesome, thank you.
  2. Right. That is what I'm trying to do. It is not working, in that every time I set the item's damage value to 2, the item appears to be immediately replaced with an item with damage value 0.
  3. My understanding is SetMaxDamage is set when using damage for durability. Setting it to 2 makes there be a damage bar on the item that is half gone after the first usage, and the item disappears entirely after the second use. Maybe this provides additional insight. Setting the maxdamage to something big like 128, there is still a damage bar, but on the second use, the item briefly changes to the third version, and then disappears and is replaced with an undamaged item.
  4. I'm probably missing something stupid or obvious. With that said, I've created an item with different names and icons for different damage values. I have 3 sub-items with damage values 0, 1, and 2. I am changing the itemstack damage value in the onItemRightClick callback. This looks to work for damage values of 0 or 1, but when I set the damage value to 2, it resets to 0 an instant later. The icon briefly changes to the damage value 2 icon, and then swaps back to the one for damage 0. The item source is here in full https://github.com/jco2641/SuperOreProcessCraft/blob/master/src/main/java/jco/mods/sopc/item/ItemuniversalMultitool.java Here is the function: @Override public ItemStack onItemRightClick(ItemStack itemStack, World world, EntityPlayer player) { if(world.isRemote) { if (player.isSneaking()) { LogHelper.info("Entering routine, damage = " + this.getDamage(itemStack)); switch (this.getDamage(itemStack)) { case 0: this.setDamage(itemStack, 1); LogHelper.info("Setting damage from 0 to 1"); break; case 1: this.setDamage(itemStack, 2); LogHelper.info("Setting damage from 1 to 2"); break; case 2: this.setDamage(itemStack, 0); LogHelper.info("Setting damage from 2 to 0"); break; } } } return super.onItemRightClick(itemStack, world, player); }
×
×
  • Create New...

Important Information

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