Jump to content

RCKraken

Members
  • Posts

    3
  • Joined

  • Last visited

Everything posted by RCKraken

  1. So just for clarification, in case anyone has the same problem, if you're trying to damage an item on right click in creative mode, it will go down to whatever you set it to and then bounce right back, but has completely normal behavior in survival. I am beyond embarrassed that I spent 2 days on this lol. Thanks everyone!
  2. Okay, so doesn't return ActionResult.success(stack); give the player's hand the new itemstack? Also, This is my new code: @Override public ActionResult<ItemStack> use(World world, PlayerEntity playerEntity, Hand hand) { if (!world.isClientSide) { ItemStack stack = playerEntity.getItemInHand(hand); stack.setDamageValue(stack.getDamageValue() + 1); return ActionResult.success(stack); } else return super.use(world, playerEntity, hand); } This still does not work. I can see that ActionResult.success(stack) does get run, because of the in game animation, but the durability doesn't change.
  3. The durability of my custom Item goes down only for a second then goes back to where it was before I clicked. I'd really appreciate if someone can point me in the right direction to get this working. @Override public ActionResult<ItemStack> use(World world, PlayerEntity playerEntity, Hand hand) { ItemStack stack = playerEntity.getItemInHand(hand); if (!world.isClientSide) { ItemStack newStack = new ItemStack(stack.getItem()); newStack.setDamageValue(stack.getDamageValue() + 1); return ActionResult.success(newStack); } else return super.use(world, playerEntity, hand); }
×
×
  • Create New...

Important Information

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