Skip to content

Commit

Permalink
Add usage stat to tinker weapons (#5007)
Browse files Browse the repository at this point in the history
  • Loading branch information
KnightMiner committed Nov 24, 2022
1 parent 2e12737 commit fcf05b1
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -383,6 +383,11 @@ public static boolean attackEntity(IToolStackView tool, LivingEntity attackerLiv
}
// removed: fire damage, handled in modifier hook above
attackerPlayer.causeFoodExhaustion(0.1F);

// add usage stat
if (!isExtraAttack) {
attackerPlayer.awardStat(Stats.ITEM_USED.get(tool.getItem()));
}
}

// damage the tool
Expand Down

0 comments on commit fcf05b1

Please sign in to comment.