User Tools

Site Tools


tutorial:stats

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
tutorial:stats [2021/02/08 18:46] – created jummittutorial:stats [2021/02/08 22:05] (current) – external edit 127.0.0.1
Line 14: Line 14:
 </code> </code>
  
-Then specify the stat formatter. It determines how the number is shown in the Statistics screen. You can use DEFAULT, DIVIDE_BY_TEN, DISTANCE or TIME.+Then add the stat to the statistic screen, where you can also specify the stat formatter. It determines how the number is shown in the stat list. You can use DEFAULT, DIVIDE_BY_TEN, DISTANCE or TIME.
  
 <code java> <code java>
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.1612810010.txt.gz · Last modified: 2021/02/08 18:46 by jummit