public class DemoBlock extends BlockWithEntity { [...] @Override public BlockEntityTicker getTicker(World world, BlockState state, BlockEntityType type) { // 如果只需要在服务器上有刻,确保检查 world.isClient return validateTicker(type, ExampleMod.DEMO_BLOCK_ENTITY, DemoBlockEntity::tick); }