User Tools

Site Tools


tutorial:blockstate

Differences

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

Link to this comparison view

Both sides previous revisionPrevious revision
Next revisionBoth sides next revision
tutorial:blockstate [2019/12/15 22:55] – re-yarn b0undarybreakertutorial:blockstate [2020/03/19 10:10] – 1.15 juuz
Line 45: Line 45:
     [...]     [...]
     @Override     @Override
-    public boolean activate(BlockState state, World world, BlockPos pos, PlayerEntity player, Hand hand, BlockHitResult blockHitResult) {+    public ActionResult onUse(BlockState state, World world, BlockPos pos, PlayerEntity player, Hand hand, BlockHitResult hit) {
         world.setBlockState(pos, MyBlocks.MY_BLOCK_INSTANCE.getDefaultState().with(HARDENED, true));         world.setBlockState(pos, MyBlocks.MY_BLOCK_INSTANCE.getDefaultState().with(HARDENED, true));
-        return true;+        return ActionResult.SUCCESS;
     }     }
 } }
tutorial/blockstate.txt · Last modified: 2023/11/18 08:13 by solidblock