Skip to main content

How to implement CCE and IAE in 1.21.5+

· One min read

In the java file of AbstractBlock of 1.21.5-

    protected void onStateReplaced(BlockState state, World world, BlockPos pos, BlockState newState, boolean moved) {
if (state.hasBlockEntity() && !state.isOf(newState.getBlock())) {
world.removeBlockEntity(pos);
}
}