public class DemoBlock extends BlockWithEntity { public DemoBlock(Settings settings) { super(settings); } @Override protected MapCodec getCodec() { return createCodec(DemoBlock::new); } @Override public BlockEntity createBlockEntity(BlockPos pos, BlockState state) { return new DemoBlockEntity(pos, state); } @Override protected BlockRenderType getRenderType(BlockState state) { return BlockRenderType.MODEL; } }