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.