User Tools

Site Tools


tutorial:blockentity

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:blockentity [2019/06/29 23:49] – spelling fixes draylartutorial:blockentity [2019/07/21 20:20] draylar
Line 36: Line 36:
 </code> </code>
  
-Once your ''BlockEntityType'' has been created and registered as seen above, you can simply implement ''BlockEntityProvider'' in your ''Block'' class, and override ''createBlockEntity'' with an instance of your new ''BlockEntity''!+Once your ''BlockEntityType'' has been created and registered as seen above, you can simply implement ''BlockEntityProvider'' in your ''Block'' class:
  
 <code java> <code java>
 @Override @Override
 public BlockEntity createBlockEntity(BlockView blockView) { public BlockEntity createBlockEntity(BlockView blockView) {
-   return new DemoBlockEntity(ExampleMod.DEMO_BLOCK_ENTITY);+   return new DemoBlockEntity();
 } }
 </code> </code>
tutorial/blockentity.txt · Last modified: 2023/09/20 19:18 by haykam