tutorial:stats
Differences
This shows you the differences between two versions of the page.
Next revision | Previous revisionNext revisionBoth sides next revision | ||
tutorial:stats [2021/02/08 18:46] – created jummit | tutorial:stats [2021/02/08 18:51] – increment stats on both server and client jummit | ||
---|---|---|---|
Line 26: | Line 26: | ||
<code java> | <code java> | ||
@Override | @Override | ||
- | public ActionResult onUse(BlockState state, World world, BlockPos pos, PlayerEntity player, Hand hand, | + | public ActionResult onUse(BlockState state, World world, BlockPos pos, PlayerEntity player, Hand hand, BlockHitResult hit) { |
- | BlockHitResult hit) { | + | player.incrementStat(ModClass.INTERACT_WITH_COOL_BLOCK); |
- | if (!world.isClient) { | + | |
- | player.incrementStat(ModClass.INTERACT_WITH_COOL_BLOCK); | + | |
- | } | + | |
return ActionResult.SUCCESS; | return ActionResult.SUCCESS; |
tutorial/stats.txt · Last modified: 2021/02/08 22:05 by 127.0.0.1